JBO查找类的麻烦:由于异常,未安装可选组件"X":java.lang.ClassNotFoundException



我正在尝试使用Ant将EAR文件部署到我的JBoss。我使用JBoss 7.1。我已经有一些战争在那里工作(使用相同的部署过程),但这个EAR包含关于我需要工作的框架的数据。这个框架特别使用了一个JAR (index-app),我已经将它包含在它的lib文件夹中。

我的EAR build.xml中的这个片段显示了它如何从它的lib文件夹(所有呈现的子文件夹都存在)读取JAR:

   <copy todir="${build.home}" flatten="true" includeemptydirs="false">
        <fileset dir="${lib.home}">             
            <include name="index/**/*.jar" />
            <include name="crawler/**/*.jar" />
            <include name="poi/**/*.jar" />
            <include name="*.jar" />
            <exclude name="local/**" />
        </fileset>
    </copy>

当我部署EAR时,我没有编译问题,只有实际部署在我的日志上生成这个:

09:33:52,452 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-15) JBAS015876: Starting deployment of "scp-app.ear"
09:33:52,642 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-8) JBAS015876: Starting deployment of "scp-app-web.war"
09:33:52,642 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-4) JBAS015876: Starting deployment of "scp-app.jar"
09:33:52,700 INFO  [org.jboss.as.jpa] (MSC service thread 1-7) JBAS011401: Read persistence.xml for CST_SPC_DS
09:33:52,737 WARN  [org.jboss.as.ee] (MSC service thread 1-1) JBAS011006: Not installing optional component com.t1c.modules.index.servlets.SPCCentralServlet due to exception: java.lang.ClassNotFoundException: com.t1c.modules.index.servlets.SPCCentralServlet from [Module "deployment.scp-app.ear.scp-app-web.war:main" from Service Module Loader]
    at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190) [jboss-modules.jar:1.1.1.GA]
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468) [jboss-modules.jar:1.1.1.GA]
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456) [jboss-modules.jar:1.1.1.GA]
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:423) [jboss-modules.jar:1.1.1.GA]
    at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398) [jboss-modules.jar:1.1.1.GA]
    at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120) [jboss-modules.jar:1.1.1.GA]
    at java.lang.Class.forName0(Native Method) [rt.jar:1.6.0_39]
    at java.lang.Class.forName(Class.java:249) [rt.jar:1.6.0_39]
    at org.jboss.as.server.deployment.reflect.DeploymentClassIndex.classIndex(DeploymentClassIndex.java:54) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
    at org.jboss.as.ee.component.deployers.EEModuleConfigurationProcessor.deploy(EEModuleConfigurationProcessor.java:79)
    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(ThreadPoolExecutor.java:895) [rt.jar:1.6.0_39]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) [rt.jar:1.6.0_39]
    at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_39]
09:33:52,759 INFO  [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/spc]] (MSC service thread 1-6) Marking servlet SPC Startup Servlet as unavailable
09:33:52,759 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/spc]] (MSC service thread 1-6) Servlet /spc threw load() exception: java.lang.ClassNotFoundException: com.t1c.modules.index.servlets.SPCCentralServlet from [Module "deployment.scp-app.ear.scp-app-web.war:main" 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.performLoadClass(ConcurrentClassLoader.java:398)
    at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)
    at org.jboss.as.web.deployment.WebInjectionContainer.newInstance(WebInjectionContainer.java:72) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1156) [jbossweb-7.0.13.Final.jar:]
    at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1102) [jbossweb-7.0.13.Final.jar:]
    at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3655) [jbossweb-7.0.13.Final.jar:]
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:3873) [jbossweb-7.0.13.Final.jar:]
    at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
    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:895) [rt.jar:1.6.0_39]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) [rt.jar:1.6.0_39]
    at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_39]
09:33:52,767 INFO  [org.jboss.web] (MSC service thread 1-6) JBAS018210: Registering web context: /spc
09:33:52,968 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 1) JBAS015870: Deploy of deployment "scp-app.ear" was rolled back with failure message JBAS014750: Operation handler failed to complete
09:33:52,983 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-15) JBAS015877: Stopped deployment scp-app-web.war in 13ms
09:33:52,993 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-11) JBAS015877: Stopped deployment scp-app.jar in 24ms
09:33:53,004 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-11) JBAS015877: Stopped deployment scp-app.ear in 35ms
09:33:53,005 ERROR [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 2) {"JBAS014653: Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-2" => "JBAS014750: Operation handler failed to complete"}}

我仔细检查了一下,包含类SPCCentralServlet的JAR文件存在,它就在生成的EAR文件中的JAR中,但不知怎的JBoss找不到它。

谁有任何解释或想法?

您需要指定包含com.t1c.modules.index.servlets.SPCCentralServlet类的jar:
1. MANIFEST.MF为WAR
2. 作为jboss模块
3.作为jboss-deployment-structure.xml的依赖

相关内容

  • 没有找到相关文章

最新更新