0
   <dependency>
        <groupId>javax.ws.rs</groupId>
        <artifactId>javax.ws.rs-api</artifactId>
        <version>2.0.1</version>
    </dependency>

    <dependency>
        <groupId>org.glassfish.jersey.containers</groupId>
        <artifactId>jersey-container-servlet</artifactId>
        <version>2.25.1</version>
    </dependency>

    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>javax.servlet-api</artifactId>
        <version>3.1.0</version>
        <type>jar</type>
    </dependency>
</dependencies>

Hi,
I am trying to deploy a test app with jersey 2.0 in tomcat 8.5, which has only one service When I try to access the service getting this error :

java.lang.IllegalStateException: No generator was provided and there is no default generator registered   
at org.glassfish.hk2.internal.ServiceLocatorFactoryImpl.internalCreate(ServiceLocatorFactoryImpl.java:308)   
at org.glassfish.hk2.internal.ServiceLocatorFactoryImpl.create(ServiceLocatorFactoryImpl.java:268)   
at org.glassfish.jersey.internal.inject.Injections._createLocator(Injections.java:138)   
at org.glassfish.jersey.internal.inject.Injections.createLocator(Injections.java:123)   
at org.glassfish.jersey.server.ApplicationHandler.<init>(ApplicationHandler.java:330)  

I am using the jersey jars 2.25.1. What could be the cause of this error?

Tschallacka
  • 24,188
  • 10
  • 79
  • 121
Stalin
  • 1
  • 2
  • see https://stackoverflow.com/questions/25740556/error-while-using-jersey-client-in-osgi-no-generator-was-provided – PrasadU Jul 16 '20 at 06:48
  • Thanks, Prasad. I have added all jersey2 dependency jar in WEB-INF/lib it's working. but **when I change all the Rest Service Classes in WEB-INF/classes folder, instead of placing the jar in WEB-INF/lib** but getting this error. Am trying to resolution for the below issue, there is an issue when I deploy the jersey2 service in WebSphere-8.5. Please look into the link [link](https://stackoverflow.com/questions/62890157/jersy2-0-service-deployment-issue-java-lang-nosuchmethoderror-javax-ws-rs-core) !!!Thanks once again !!! – Stalin Jul 16 '20 at 07:55
  • Any one can you please help this issue.. – Stalin Jul 23 '20 at 18:09

0 Answers0