0

I am following along a tutorial but it is an old tutorial and i am trying to follow along with new tools and new code

I am using

Weblogic 12.1.3 Jersey 2.21 (Jersey was downloaded as .zip and not through Maven) JDK 8 Eclipse Mars

I am attaching a screenshot of the class along with project explorer. I have commented out all of the code in the class because i thought that was what was causing the error. It is not.

enter image description here

The code from the web.xml file is below.

enter image description here

The error message is below.

enter image description here

Can someone please explain to me why i am getting this error message?

hfrog713
  • 400
  • 1
  • 5
  • 18
  • Possible duplicate of [Java RestFull WebService: JAX-RS implementation with Jersey 2.3.1 libraries](http://stackoverflow.com/questions/19225618/java-restfull-webservice-jax-rs-implementation-with-jersey-2-3-1-libraries) – tddmonkey Oct 20 '15 at 21:15
  • I am not using Maven. I downloaded the Jersey .zip and copied all files into my lib folder manually. The other solution says to take a look at the POM file. Not sure where this or what it is but i dont think i have one in my project because i am not using Maven. – hfrog713 Oct 20 '15 at 21:47
  • You might not be using maven but the problem is the same - you have multiple versions of JAX-RS api on your classpath. I see you're using WebLogic - does this ship with JAX-RS and if so, what version does it use? – tddmonkey Oct 21 '15 at 10:02
  • This does ship with Jax-rs as a deployable library. I installed the jar on the web server through the admin console and i am still recieving an error. – hfrog713 Oct 21 '15 at 19:14
  • Now i am getting error message "Caused by: weblogic.application.ModuleException: java.lang.NoSuchMethodError: org.glassfish.hk2.api.ServiceLocatorFactory.create(Ljava/lang/String;Lorg/glassfish/hk2/api/ServiceLocator;Lorg/glassfish/hk2/extension/ServiceLocatorGenerator;Lorg/glassfish/hk2/api/ServiceLocatorFactory$CreatePolicy;)Lorg/glassfish/hk2/api/ServiceLocator;" – hfrog713 Oct 22 '15 at 02:40
  • I think this answer might be useful for you: http://stackoverflow.com/questions/26361136/using-jersey-2-x-web-service-on-weblogic-12-1-1 – tddmonkey Oct 22 '15 at 08:48

1 Answers1

0

I think that is not the problem with using new tools. It is the issue of having two different versions of the class on your classpath. Try replacing javax.ws.rs.api from 2.X.X version to 1.X.X version.

JavaGeek
  • 303
  • 4
  • 6