2012-03-09 60 views
4

我使用CXF 2.5.2創建web服務。它在tomcat上運行良好。但是,當移民到JBoss,出現錯誤象下面這樣:使用CXF 2.5.2和JBoss AS 7的問題

14:47:42,721 WARN [org.jboss.as.ee] (MSC service thread 1-3) JBAS011006: Not installing optional component org.apache.cxf.transport.ht 
tp.Servlet3ContinuationProvider$Servlet3Continuation due to exception: org.jboss.as.server.deployment.DeploymentUnitProcessingException 
: JBAS011054: Could not find default constructor for class org.apache.cxf.transport.http.Servlet3ContinuationProvider$Servlet3Continuat 
ion 
     at org.jboss.as.ee.component.ComponentDescription$DefaultComponentConfigurator.configure(ComponentDescription.java:606) 
     at org.jboss.as.ee.component.deployers.EEModuleConfigurationProcessor.deploy(EEModuleConfigurationProcessor.java:81) 
     at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.0. 
Final.jar:7.1.0.Final] 
     at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar: 
1.0.2.GA] 
     at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA] 

     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0_03] 
     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0_03] 
     at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_03] 

14:47:42,756 WARN [org.jboss.as.ee] (MSC service thread 1-3) JBAS011006: Not installing optional component org.eclipse.jetty.continuat 
ion.Servlet3Continuation$1 due to exception: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS011054: Could not fi 
nd default constructor for class org.eclipse.jetty.continuation.Servlet3Continuation$1 
     at org.jboss.as.ee.component.ComponentDescription$DefaultComponentConfigurator.configure(ComponentDescription.java:606) 
     at org.jboss.as.ee.component.deployers.EEModuleConfigurationProcessor.deploy(EEModuleConfigurationProcessor.java:81) 
     at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.0. 
Final.jar:7.1.0.Final] 
     at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar: 
1.0.2.GA] 
     at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA] 

     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0_03] 
     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0_03] 
     at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_03] 

14:47:42,790 WARN [org.jboss.as.ee] (MSC service thread 1-3) JBAS011006: Not installing optional component org.eclipse.jetty.continuat 
ion.Servlet3Continuation$2 due to exception: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS011054: Could not fi 
nd default constructor for class org.eclipse.jetty.continuation.Servlet3Continuation$2 
     at org.jboss.as.ee.component.ComponentDescription$DefaultComponentConfigurator.configure(ComponentDescription.java:606) 
     at org.jboss.as.ee.component.deployers.EEModuleConfigurationProcessor.deploy(EEModuleConfigurationProcessor.java:81) 
     at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.0. 
Final.jar:7.1.0.Final] 
     at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar: 
1.0.2.GA] 
     at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA] 

     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0_03] 
     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0_03] 
     at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_03] 

14:47:42,929 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-3) MSC00001: Failed to start service jboss.deployment.unit."PocWS 
-0.0.1-SNAPSHOT.war".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.unit."PocWS-0.0.1-SNAPSHOT.war".INSTALL: 
Failed to process phase INSTALL of deployment "PocWS-0.0.1-SNAPSHOT.war" 
     at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:119) [jboss-as-server-7.1.0. 
Final.jar:7.1.0.Final] 
     at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar: 
1.0.2.GA] 
     at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA] 

     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0_03] 
     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0_03] 
     at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_03] 
Caused by: javax.persistence.PersistenceException: JBAS011466: PersistenceProvider 'org.apache.openjpa.persistence.PersistenceProviderI 
mpl' not found 
     at org.jboss.as.jpa.processor.PersistenceUnitDeploymentProcessor.lookupProvider(PersistenceUnitDeploymentProcessor.java:546) 
     at org.jboss.as.jpa.processor.PersistenceUnitDeploymentProcessor.addPuService(PersistenceUnitDeploymentProcessor.java:279) 
     at org.jboss.as.jpa.processor.PersistenceUnitDeploymentProcessor.handleWarDeployment(PersistenceUnitDeploymentProcessor.java:19 
4) 
     at org.jboss.as.jpa.processor.PersistenceUnitDeploymentProcessor.deploy(PersistenceUnitDeploymentProcessor.java:118) 
     at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.0. 
Final.jar:7.1.0.Final] 
     ... 5 more 

我的服務代碼的段子:

@WebService 
public interface UserService { 

    @WebMethod 
    public void addNewUser(@WebParam(name="userName") String userName, @WebParam(name="address") String address, @WebParam(name="phoneNum") String phoneNum); 

而且我使用XML等構成的服務:

<bean id="UserService" class="com.hp.poc.service.UserServiceImpl" /> 

    <!-- WebService --> 
    <jaxws:endpoint id="UserWSEndPoint" implementor="#UserService" 
     address="/userws"> 
    </jaxws:endpoint> 

莫非你請給我一些幫助?

+0

沒有人閱讀本張貼? – 2012-03-12 01:38:30

回答

0

如果jar的版本與jboss lib文件夾相同,即jboss的modules文件夾中的cxf jar應該在您的pom.xml或classpath中聲明的相同,請檢查您的依賴關係。

也排除了來自cxf束的任何碼頭依賴性。即:

<dependency> 
     <groupId>org.apache.cxf</groupId> 
     <artifactId>cxf-bundle-jaxrs</artifactId> 
     <version>${cxf.version}</version> 
     <scope>provided</scope> 
      <exclusions> 
       <exclusion> 
        <groupId>org.eclipse.jetty</groupId> 
        <artifactId>jetty-server</artifactId> 
       </exclusion> 
      </exclusions> 
    </dependency> 

最後,你將留下:

10:27:00,424 WARN [org.jboss.as.ee] (MSC service thread 1-7) JBAS011006: Not installing optional component org.apache.cxf.transport.http.Servlet3ContinuationProvider$Servlet3Continuation due to exception: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS011054: Could not find default constructor for class org.apache.cxf.transport.http.Servlet3ContinuationProvider$Servlet3Continuation 
    at org.jboss.as.ee.component.ComponentDescription$DefaultComponentConfigurator.configure(ComponentDescription.java:606) 
    at org.jboss.as.ee.component.deployers.EEModuleConfigurationProcessor.deploy(EEModuleConfigurationProcessor.java:81) 
    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final] 
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA] 
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA] 
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) [rt.jar:1.6.0_45] 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.6.0_45] 
    at java.lang.Thread.run(Unknown Source) [rt.jar:1.6.0_45] 

我相信這是因爲來自Jboss的檢查默認的jar文件:

Spring3.2 and jboss as 7