2014-10-02 81 views
1

Firstable對不起我的英語,我有一個Maven項目,該項目是一個Web服務(打包成一個war文件)Maven的:拋出java.lang.ClassNotFoundException在JBoss

我用這個POM:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 
<modelVersion>4.0.0</modelVersion> 
<groupId>ec.gob.turismo</groupId> 
<artifactId>mintur-bpm</artifactId> 
<version>0.0.1-SNAPSHOT</version> 
<packaging>war</packaging> 
<name>mintur-bpm</name> 
<description>Servicio Web que interactúa con los procesos del negocio</description> 
<properties> 
    <jbpm.version>6.0.1.Final</jbpm.version> 
</properties> 
<build> 
    <sourceDirectory>src/main/java</sourceDirectory> 
    <plugins> 
     <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-compiler-plugin</artifactId> 
      <version>3.1</version> 
      <configuration> 
       <source>1.6</source> 
       <target>1.6</target> 
       <encoding>UTF-8</encoding> 
      </configuration> 
     </plugin> 
     <plugin> 
      <groupId>org.jboss.as.plugins</groupId> 
      <artifactId>jboss-as-maven-plugin</artifactId> 
      <version>7.5.Final</version> 
      <executions> 
       <execution> 
        <phase>install</phase> 
        <goals> 
         <goal>deploy</goal> 
        </goals> 
       </execution> 
      </executions> 
     </plugin> 
    </plugins> 
</build> 
<dependencies> 
    <dependency> 
     <groupId>ec.gob.turismo.siete.establecimientos</groupId> 
     <artifactId>establecimientos-dto</artifactId> 
     <version>1.0.0-SNAPSHOT</version> 
    </dependency> 
    <dependency> 
     <groupId>org.apache.cxf</groupId> 
     <artifactId>cxf-rt-core</artifactId> 
     <version>2.7.11</version> 
    </dependency> 
    <dependency> 
     <groupId>org.apache.cxf</groupId> 
     <artifactId>cxf-rt-frontend-jaxws</artifactId> 
     <version>2.7.11</version> 
    </dependency> 
    <dependency> 
     <groupId>org.kie</groupId> 
     <artifactId>kie-api</artifactId> 
     <version>${jbpm.version}</version> 
    </dependency> 
    <dependency> 
     <groupId>org.kie.remote</groupId> 
     <artifactId>kie-services-client</artifactId> 
     <version>${jbpm.version}</version> 
    </dependency> 
</dependencies> 
</project> 

我使用JbossEAP 6.3,當我輸入mvn clean install時,maven生成war文件並複製到獨立目錄中。接下來,當我看到我的控制檯在我的日食我看到這個錯誤:

[DEBUG] Executing deployment 
[INFO] ------------------------------------------------------------------------ 
[INFO] BUILD FAILURE 
[INFO] ------------------------------------------------------------------------ 
[INFO] Total time: 18.643s 
[INFO] Finished at: Thu Oct 02 16:49:19 COT 2014 
[INFO] Final Memory: 29M/358M 
[INFO] ------------------------------------------------------------------------ 
[ERROR] Failed to execute goal org.jboss.as.plugins:jboss-as-maven-plugin:7.5.Final:deploy (default) on project mintur-bpm: Deployment failed and was rolled back. -> [Help 1] 
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.jboss.as.plugins:jboss-as-maven-plugin:7.5.Final:deploy (default) on project mintur-bpm: Deployment failed and was rolled back. 
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217) 
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) 
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) 
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84) 
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59) 
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183) 
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161) 
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320) 
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156) 
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537) 
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196) 
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141) 
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
at java.lang.reflect.Method.invoke(Method.java:606) 
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290) 
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230) 
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409) 
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352) 
Caused by: org.jboss.as.plugin.common.DeploymentExecutionException: Deployment failed and was rolled back. 
at org.jboss.as.plugin.deployment.standalone.StandaloneDeployment.execute(StandaloneDeployment.java:180) 
at org.jboss.as.plugin.deployment.AbstractDeployment.executeDeployment(AbstractDeployment.java:121) 
at org.jboss.as.plugin.deployment.AbstractDeployment.doExecute(AbstractDeployment.java:146) 
at org.jboss.as.plugin.deployment.AbstractAppDeployment.doExecute(AbstractAppDeployment.java:70) 
at org.jboss.as.plugin.deployment.AbstractDeployment.execute(AbstractDeployment.java:111) 
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101) 
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209) 
... 19 more 
[ERROR] 
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles: 
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException 

最後在JBoss中日誌(server.log)中,我看到這個堆棧跟蹤:

16:49:17,770 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC000001: Failed to start service jboss.deployment.unit."mintur-bpm-0.0.1-SNAPSHOT.war".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.unit."mintur-bpm-0.0.1-SNAPSHOT.war".INSTALL: JBAS018733: Error al procesar la fase INSTALL de deployment "mintur-bpm-0.0.1-SNAPSHOT.war" 
    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:127) [jboss-as-server-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14] 
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1] 
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1] 
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_67] 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_67] 
    at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_67] 
Caused by: java.lang.RuntimeException: java.lang.ClassNotFoundException: ec.gob.turismo.siete.serviciosweb.bmp.BusinessProcessManagement from [Module "deployment.mintur-bpm-0.0.1-SNAPSHOT.war:main" from Service Module Loader] 
    at org.jboss.wsf.stack.cxf.metadata.MetadataBuilder.createDDEndpoint(MetadataBuilder.java:241) 
    at org.jboss.wsf.stack.cxf.metadata.MetadataBuilder.build(MetadataBuilder.java:82) 
    at org.jboss.wsf.stack.cxf.deployment.aspect.DescriptorDeploymentAspect.generateMetadataFromDeployment(DescriptorDeploymentAspect.java:135) 
    at org.jboss.wsf.stack.cxf.deployment.aspect.DescriptorDeploymentAspect.start(DescriptorDeploymentAspect.java:68) 
    at org.jboss.as.webservices.deployers.AspectDeploymentProcessor.deploy(AspectDeploymentProcessor.java:74) 
    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:120) [jboss-as-server-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14] 
    ... 5 more 
Caused by: java.lang.ClassNotFoundException: ec.gob.turismo.siete.serviciosweb.bmp.BusinessProcessManagement from [Module "deployment.mintur-bpm-0.0.1-SNAPSHOT.war:main" from Service Module Loader] 
    at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:197) [jboss-modules.jar:1.3.0.Final-redhat-2] 
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:443) [jboss-modules.jar:1.3.0.Final-redhat-2] 
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:431) [jboss-modules.jar:1.3.0.Final-redhat-2] 
    at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:373) [jboss-modules.jar:1.3.0.Final-redhat-2] 
    at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:118) [jboss-modules.jar:1.3.0.Final-redhat-2] 
    at org.jboss.wsf.stack.cxf.metadata.MetadataBuilder.createDDEndpoint(MetadataBuilder.java:237) 
    ... 10 more 

16:49:17,781 ERROR [org.jboss.as.server] (management-handler-thread - 29) JBAS015870: La implementaci▒n de "mintur-bpm-0.0.1-SNAPSHOT.war" se deshizo con el siguiente mensaje de fallo: 
{"JBAS014671: Servicios fallidos" => {"jboss.deployment.unit.\"mintur-bpm-0.0.1-SNAPSHOT.war\".INSTALL" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"mintur-bpm-0.0.1-SNAPSHOT.war\".INSTALL: JBAS018733: Error al procesar la fase INSTALL de deployment \"mintur-bpm-0.0.1-SNAPSHOT.war\" 
Caused by: java.lang.RuntimeException: java.lang.ClassNotFoundException: ec.gob.turismo.siete.serviciosweb.bmp.BusinessProcessManagement from [Module \"deployment.mintur-bpm-0.0.1-SNAPSHOT.war:main\" from Service Module Loader] 
Caused by: java.lang.ClassNotFoundException: ec.gob.turismo.siete.serviciosweb.bmp.BusinessProcessManagement from [Module \"deployment.mintur-bpm-0.0.1-SNAPSHOT.war:main\" from Service Module Loader]"}} 
16:49:19,100 INFO [org.jboss.as.server.deployment] (MSC service thread 1-6) JBAS015877: Se detuvo la implementaci▒nmintur-bpm-0.0.1-SNAPSHOT.war (runtime-name: mintur-bpm-0.0.1-SNAPSHOT.war) en 1317ms 

上述錯誤說,一個在我的war文件中找不到類,這是不正確的,因爲我已經打開了很多次war文件,裏面有所有的類。

請問您能否幫助我,因爲我找不到解決方案?

謝謝。

PD:如果您需要更多信息,請告訴我。

回答

0

這是我的錯,這個包並不在我的戰爭文件的存在,這就是爲什麼錯誤:

ec.gob.turismo.siete.serviciosweb.bmp.BusinessProcessManagement 

正確的包是:

ec.gob.turismo.serviciosweb.bmp.BusinessProcessManagement 

aditional的我已經把網絡。 xml文件,用於引用實現BusinessProcessManagement接口的類。

謝謝。

相關問題