我正在尝试在服务器上部署我的REST API并继续收到此错误java.lang.NoClassDefFoundError: javax/ws/rs/ext/RuntimeDelegate
我已检入javax.ws.rs
JAR并找到了课程RuntimeDelegate
我正在使用
泽西
这是我的pom.xml
http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.car.apiproject</groupId>
<artifactId>carcreation_jdbc</artifactId>
<packaging>war</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>carcreation_jdbc</name>
<build>
<finalName>carcreation_jdbc</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<inherited>true</inherited>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.4</version>
</plugin>
</plugins>
</build>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.glassfish.jersey</groupId>
<artifactId>jersey-bom</artifactId>
<version>2.16</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.glassfish.jersey.containers</groupId>
<artifactId>jersey-container-servlet-core</artifactId>
<!-- use the following artifactId if you don't need servlet 2.x compatibility -->
<!-- artifactId>jersey-container-servlet</artifactId -->
</dependency>
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs-api</artifactId>
<version>2.0.1</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-bundle-jaxrs</artifactId>
<version>2.7.18</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-moxy</artifactId>
</dependency>
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc14</artifactId>
<version>11.2.0.3.0</version>
</dependency>
</dependencies>
<properties>
<jersey.version>2.16</jersey.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
这是完整的堆栈跟踪
java.lang.NoClassDefFoundError: javax/ws/rs/ext/RuntimeDelegate
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:792)
at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.findClass(BundleWiringImpl.java:2128)
at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1432)
at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:72)
at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1843)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at org.apache.felix.framework.BundleWiringImpl.getClassByDelegation(BundleWiringImpl.java:1317)
at org.apache.felix.framework.BundleWiringImpl.searchDynamicImports(BundleWiringImpl.java:1558)
at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1439)
at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:72)
at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1843)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at org.ow2.jonas.lib.loader.OSGiClassLoader.loadClass(OSGiClassLoader.java:87)
at org.ow2.jonas.lib.loader.OSGiClassLoader.loadClass(OSGiClassLoader.java:96)
at java.lang.ClassLoader.loadClass(ClassLoader.java:411)
at org.ow2.jonas.lib.loader.FilteringClassLoader.loadClass(FilteringClassLoader.java:200)
at java.lang.ClassLoader.loadClass(ClassLoader.java:411)
at java.lang.ClassLoader.loadClass(ClassLoader.java:411)
at java.lang.ClassLoader.loadClass(ClassLoader.java:411)
at org.ow2.jonas.lib.loader.FilteringClassLoader.loadClass(FilteringClassLoader.java:200)
at java.lang.ClassLoader.loadClass(ClassLoader.java:411)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:270)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1663)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1558)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:270)
at javax.ws.rs.ext.FactoryFinder.newInstance(FactoryFinder.java:107)
at javax.ws.rs.ext.FactoryFinder.find(FactoryFinder.java:166)
at javax.ws.rs.ext.RuntimeDelegate.findDelegate(RuntimeDelegate.java:135)
at javax.ws.rs.ext.RuntimeDelegate.getInstance(RuntimeDelegate.java:120)
at javax.ws.rs.core.MediaType.valueOf(MediaType.java:179)
at org.glassfish.jersey.server.model.IntrospectionModeller.extractMediaTypes(IntrospectionModeller.java:280)
at org.glassfish.jersey.server.model.IntrospectionModeller.extractMediaTypes(IntrospectionModeller.java:269)
at org.glassfish.jersey.server.model.IntrospectionModeller.resolveProducedTypes(IntrospectionModeller.java:258)
at org.glassfish.jersey.server.model.IntrospectionModeller.addResourceMethods(IntrospectionModeller.java:315)
at org.glassfish.jersey.server.model.IntrospectionModeller.doCreateResourceBuilder(IntrospectionModeller.java:155)
at org.glassfish.jersey.server.model.IntrospectionModeller.access$000(IntrospectionModeller.java:80)
at org.glassfish.jersey.server.model.IntrospectionModeller$1.call(IntrospectionModeller.java:111)
at org.glassfish.jersey.server.model.IntrospectionModeller$1.call(IntrospectionModeller.java:108)
at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
at org.glassfish.jersey.internal.Errors.processWithException(Errors.java:255)
at org.glassfish.jersey.server.model.IntrospectionModeller.createResourceBuilder(IntrospectionModeller.java:108)
at org.glassfish.jersey.server.model.Resource.from(Resource.java:744)
at org.glassfish.jersey.server.ApplicationHandler.initialize(ApplicationHandler.java:404)
at org.glassfish.jersey.server.ApplicationHandler.access$500(ApplicationHandler.java:166)
at org.glassfish.jersey.server.ApplicationHandler$3.run(ApplicationHandler.java:327)
at org.glassfish.jersey.internal.Errors$2.call(Errors.java:289)
at org.glassfish.jersey.internal.Errors$2.call(Errors.java:286)
at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
at org.glassfish.jersey.internal.Errors.processWithException(Errors.java:286)
at org.glassfish.jersey.server.ApplicationHandler.<init>(ApplicationHandler.java:324)
at org.glassfish.jersey.servlet.WebComponent.<init>(WebComponent.java:336)
at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:170)
at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:358)
at javax.servlet.GenericServlet.init(GenericServlet.java:160)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1280)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1193)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1088)
at org.ow2.jonas.web.tomcat7.JOnASStandardContext.loadOnStartup(JOnASStandardContext.java:715)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5407)
at org.ow2.jonas.web.tomcat7.JOnASStandardContext.startInternal(JOnASStandardContext.java:331)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
at org.ow2.jonas.web.tomcat7.Tomcat7Service.__M_doRegisterWar(Tomcat7Service.java:856)
at org.ow2.jonas.web.tomcat7.Tomcat7Service.doRegisterWar(Tomcat7Service.java)
at org.ow2.jonas.web.base.BaseWebContainerService.registerWar(BaseWebContainerService.java:1222)
at org.ow2.jonas.web.base.BaseWebContainerService.registerWar(BaseWebContainerService.java:1531)
at org.ow2.jonas.web.base.WARDeployer.doDeploy(WARDeployer.java:78)
at org.ow2.util.ee.deploy.impl.deployer.AbsDeployer$1.execute(AbsDeployer.java:85)
at org.ow2.util.ee.deploy.impl.deployer.AbsDeployer$1.execute(AbsDeployer.java:83)
at org.ow2.util.execution.helper.RunnableHelper.execute(RunnableHelper.java:69)
at org.ow2.util.ee.deploy.impl.deployer.AbsDeployer.deploy(AbsDeployer.java:83)
at org.ow2.util.ee.deploy.impl.deployer.AbsDeployerList.deploy(AbsDeployerList.java:44)
at org.ow2.util.ee.deploy.impl.deployer.AbsDeployer.doDeploy(AbsDeployer.java:225)
at org.ow2.util.ee.deploy.impl.deployer.AbsDeployer.deploy(AbsDeployer.java:205)
at org.ow2.util.ee.deploy.impl.deployer.DeployerManager.deployOneTypeList(DeployerManager.java:231)
at org.ow2.util.ee.deploy.impl.deployer.DeployerManager.doDeploymentOperation(DeployerManager.java:198)
at org.ow2.util.ee.deploy.impl.deployer.DeployerManager.deploy(DeployerManager.java:212)
at org.ow2.jonas.deployablemonitor.DeployableMonitor.deploy(DeployableMonitor.java:644)
at org.ow2.jonas.deployablemonitor.DeployableMonitor.detectNewArchives(DeployableMonitor.java:557)
at org.ow2.jonas.deployablemonitor.DeployableMonitor.checkNewArchives(DeployableMonitor.java:380)
at org.ow2.jonas.deployablemonitor.DeployableMonitor.run(DeployableMonitor.java:260)
Caused by: java.lang.ClassNotFoundException: javax.ws.rs.ext.RuntimeDelegate not found by org.apache.cxf.bundle [198]
at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1460)
at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:72)
at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1843)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)