2013-03-01 59 views
2

我在JBoss遷移項目爲7從球衣版本1.9到1.17,我得到以下異常:JBoss應用服務器7 +球衣 - ClassNotFound的com.sun.jersey.server.impl.container.servlet.Include

12:05:48,573 WARN [org.jboss.as.ee] (MSC service thread 1-10) JBAS011006: Not installing optional component com.sun.jersey.server.impl.container.servlet.Include due to except 
ion: java.lang.ClassNotFoundException: com.sun.jersey.server.impl.container.servlet.Include from [Module "deployment.ApiEar-2.0.0-SNAPSHOT.ear.ApiService-2.0.0-SNAPSHOT.war:ma 
in" from Service Module Loader] 
     at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190) 
     at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468) 
     at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456) 
     at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:423) 
     at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398) 
     at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120) 
     at java.lang.Class.forName0(Native Method) [rt.jar:1.6.0_32-ea] 
     at java.lang.Class.forName(Class.java:247) [rt.jar:1.6.0_32-ea] 
     at org.jboss.as.server.deployment.reflect.DeploymentClassIndex.classIndex(DeploymentClassIndex.java:54) 
     at org.jboss.as.ee.component.deployers.EEModuleConfigurationProcessor.deploy(EEModuleConfigurationProcessor.java:81) [jboss-as-ee-7.1.2.Final-redhat-1.jar:7.1.2.Final- 
redhat-1] 
     at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:116) 
     at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) 
     at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) 
     at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_32-ea] 
     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_32-ea] 
     at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_32-ea] 

代碼在1.9下運行良好。這裏是我的依賴:

<dependency> 
    <groupId>com.sun.jersey</groupId> 
    <artifactId>jersey-core</artifactId> 
    <version>1.9.1</version> 
</dependency> 
<dependency> 
    <groupId>com.sun.jersey</groupId> 
    <artifactId>jersey-client</artifactId> 
    <version>1.9.1</version> 
</dependency> 

什麼可能會導致這樣的異常?

回答

4

我認爲你的問題與澤西島從1.9版變化到1.10有很大關係;即Servlet功能發生了重大變化。你可以在這裏閱讀更多:Jersey 1.10 released 只要你的問題,我想你只是失去了一些依賴。我知道我不得不添加以下到我的.pom文件:

 <!-- Jersey 1.17 dependencies --> 
     <dependency> 
      <groupId>com.sun.jersey</groupId> 
      <artifactId>jersey-servlet</artifactId> 
      <version>${jersey-version}</version> 
      <scope>compile</scope> 
     </dependency> 
     <dependency> 
      <groupId>javax.persistence</groupId> 
      <artifactId>persistence-api</artifactId> 
      <version>1.0.2</version> 
      <scope>compile</scope> 
     </dependency> 
     <!-- end Jersey 1.17 dependencies --> 
+0

謝謝你,那工作,乾杯 – user2118176 2013-03-01 14:13:54

相關問題