1
votes

I am having a difficult time trying to figure how the issue I am having. I couldn't deploy a JAX-RS web service that uses Jersey 2.3.1 on the Tomcat 6.

I use Eclipse 3.8.2 and deploy my Jersey 2.3.1 web service by clicking on my 'project -> Run As -> Run on Server' I got the following exception.

Oct 08, 2013 3:42:29 PM org.glassfish.jersey.server.ApplicationHandler initialize
INFO: Initiating Jersey application, version Jersey: 2.3.1 2013-09-27 07:50:09...
Oct 08, 2013 3:42:29 PM org.glassfish.jersey.internal.Errors logErrors
WARNING: The following warnings have been detected: WARNING: HK2 service reification failed for [org.glassfish.jersey.server.internal.inject.WebTargetValueFactoryProvider] with an exception:
MultiException stack 1 of 4
java.lang.NoClassDefFoundError: org/glassfish/jersey/client/ClientConfig
...
MultiException stack 4 of 4
java.lang.IllegalArgumentException: Errors were discovered while reifying SystemDescriptor(
    implementation=org.glassfish.jersey.server.internal.inject.WebTargetValueFactoryProvider
    contracts={org.glassfish.jersey.server.spi.internal.ValueFactoryProvider}
    scope=javax.inject.Singleton
    qualifiers={}
    descriptorType=CLASS
    descriptorVisibility=NORMAL
    metadata=
    rank=0
    loader=org.glassfish.hk2.utilities.binding.AbstractBinder$2@1c756a8
    proxiable=null
    proxyForSameScope=null
    analysisName=null
    id=25
    locatorId=0
    identityHashCode=677756
    reified=false)

Any idea what could be wrong with my configuration? Thanks!!

1
If you're using maven, and you've included the jar that contains org.glassfish.jersey.client.ClientConfig in your pom, make sure you don't have a scope of provided. If you do have scope of provided, make sure the jar that contains that class is in the tomcat/lib directory. And if neither of those is the case, could you post your pom perhaps? And are you sure it's deploying to the tomcat you think it is?Alper Akture

1 Answers

2
votes

It was a total mistake. I forgot to add jersey-client.jar into my Eclipse project.