40769

Running Java EE 7 on Tomcat 7 in Netbeans

Question:

I'm not able to run a Java EE 7 webapp on tomcat 7 while in Eclipse using the same tomcat server it works. I can find my tomcat 7 server if I change the following in my pom.xml:

<dependency> <groupId>javax</groupId> <artifactId>javaee-web-api</artifactId> <version>7.0</version> <scope>provided</scope> </dependency>

If i change it to 6.0 it works fine in Netbeans but the problem is I'm using Jersey for my Rest API and at client side I use:

new Gson().fromJson(resp.readEntity(String.class), User.class);

But it doesn't know the method readEntity anymore and I only have the option using the getEntity method but I can't get it to work and I refuse to change all my code...

It's working in Eclipse and not complaining... Netbeans fault I think Ok weird thing is Tomcat 7 doesn't support Java EE 7. How come this is working in Eclipse with no problems?

Answer1:

Nevermind, it's Jersey fault. I changed to java--ee 6 version in pom and some dependencies fixes with Jersey.

Recommend

  • Deploy war problem
  • Changing app.servlet.version does not affect web.xml
  • How to handle Service unavailable scenarios with Jersey REST
  • Pure JerseyTest without letting Spring messing with services
  • Error: Wrapper cannot find servlet class VendorRegistration or a class it depends on
  • How to get (-8)^0.333333 = -2 in MATLAB?
  • Jersey REST api multiple resources
  • PrimeFaces p:fileUpload Listener method is never invoked for mode=“simple”
  • Laravel phpunit always 404
  • “undefined symbol: SQLAllocEnv” error in Java [duplicate]
  • how to exclude java sources from a third party jar?
  • Easy Way to Get Averages Based on Names in List
  • Regarding client side code generation from WSDL
  • How can I create one checksum of two files in Maven to use it in the name of a directory
  • jersey/tomcat Description The origin server did not find a current representation for the target res
  • drawing random circles, storing their coorindates in an array
  • How to log in to an HTTPS website with Jsoup?
  • Using $compile in a directive triggers AngularJS infinite digest error
  • Updating Dojo provide
  • Authentication in Play! and RestEasy
  • jQuery ready not fired after rails link_to is clicked
  • Problems compiling files using JOGL
  • Jetty 9 HashLoginService
  • Swing - Get new component under mouseReleased
  • How to attach a node.js readable stream to a Sendgrid email?
  • Bad request using file_get_contents for PUT request in PHP
  • Is it possible to access block's scope in method?
  • Reading JSON from a file using C++ REST SDK (Casablanca)
  • FB SDK and cURL: Unknown SSL protocol error in connection to graph.facebook.com:443
  • Deserializing XML into class C#
  • Hazelcast - OperationTimeoutException
  • RestKit - RKRequestDelegate does not exist
  • Is there a mandatory requirement to switch app.yaml?
  • bootstrap to use multiple ng-app
  • Matrix multiplication with MKL
  • How to include full .NET prerequisite for Wix Burn installer
  • Revoking OAuth Access Token Results in 404 Not Found
  • costura.fody for a dll that references another dll
  • UserPrincipal.Current returns apppool on IIS
  • jQuery Masonry / Isotope and fluid images: Momentary overlap on window resize