NoClassDefFoundError: javax/ws/rs/Produces

milad.sajjadi.gmail.com's picture

I used JPA and hibernate in my project. and when i add "ejb3-persistence.jar" to my libs, i got the following exception in server startup.

 

 

 

 

TheUserService service, which is not valid, caused java.lang.NoClassDefFoundError: javax/ws/rs/Produces
    at org.apache.axis2.JAXRS.JAXRSUtils.getMethodModel(JAXRSUtils.java:86)
    at org.apache.axis2.description.java2wsdl.DefaultSchemaGenerator.processMethods(DefaultSchemaGenerator.java:312)
    at org.apache.axis2.description.java2wsdl.DefaultSchemaGenerator.generateSchema(DefaultSchemaGenerator.java:257)
    at org.apache.axis2.deployment.util.Utils.fillAxisService(Utils.java:516)
    at org.apache.axis2.deployment.ServiceBuilder.populateService(ServiceBuilder.java:391)
    at org.apache.axis2.deployment.repository.util.ArchiveReader.buildServiceGroup(ArchiveReader.java:102)
    at org.apache.axis2.deployment.repository.util.ArchiveReader.processServiceGroup(ArchiveReader.java:179)
    at org.apache.axis2.deployment.ServiceDeployer.deploy(ServiceDeployer.java:82)
    at org.apache.axis2.deployment.repository.util.DeploymentFileData.deploy(DeploymentFileData.java:136)
    at org.apache.axis2.deployment.DeploymentEngine.doDeploy(DeploymentEngine.java:795)
    at org.apache.axis2.deployment.repository.util.WSInfoList.update(WSInfoList.java:144)
    at org.apache.axis2.deployment.RepositoryListener.update(RepositoryListener.java:338)
    at org.apache.axis2.deployment.RepositoryListener.checkServices(RepositoryListener.java:241)
    at org.apache.axis2.deployment.DeploymentEngine.loadServices(DeploymentEngine.java:136)
    at org.wso2.carbon.core.CarbonAxisConfigurator.loadServices(CarbonAxisConfigurator.java:288)
    at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContext(ConfigurationContextFactory.java:95)
    at org.wso2.carbon.core.CarbonConfigurationContextFactory.createNewConfigurationContext(CarbonConfigurationContextFactory.java:76)
    at org.wso2.carbon.core.init.CarbonServerManager.initializeCarbon(CarbonServerManager.java:308)
    at org.wso2.carbon.core.init.CarbonServerManager.removePendingItem(CarbonServerManager.java:221)
    at org.wso2.carbon.core.init.OSGiAxis2ServicesListener.bundleChanged(OSGiAxis2ServicesListener.java:82)
    at org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent(BundleContextImpl.java:916)
    at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:220)
    at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:330)
Caused by: java.lang.ClassNotFoundException: javax.ws.rs.Produces
    at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:489)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:405)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:393)
    at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:105)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
    ... 23 more

 

 

 

 

any suggestion?

 

 

werdex86.yahoo.com's picture

Hi! Copy jsr311-api-1.1.1.jar

Hi! Copy jsr311-api-1.1.1.jar to repository/components/lib Maven dependency for this artifact:         <dependency>             <groupId>javax.ws.rs</groupId>             <artifactId>jsr311-api</artifactId>             <version>1.1.1</version>         </dependency>
library project main code
Learn Cloud
Learn
Cloud

The WSO2 Application Server is a reliable application server that can host your enterprise web applications. The WSO2 Application Server as a Service is offered in StratosLive, the WSO2 Platform as a Service. This article explains how a simple web application can be developed and deployed from Carbon Studio to the WSO2 Application Server...

Latest Webinar
Different groups within an organization need to monitor different Key Performance Indicators (KPIs) - An operations team will be interested in the response times of business services and loads of each service,..
Thursday, February 9th 2012, 09.00 AM (PST)

Thursday, February 9th 2012, 10.00 AM (GMT)