2017-11-23 29 views
0

私はJbossヒューズ6.3で作業しています。これはJboss EAP 6.4で動作し、アプリケーションに必要なすべてのモジュールが含まれています。私はcamel warアプリケーションをビルドしています。私はwarファイルですべての必要なライブラリをパッケージ化したくないので、maven pom xmlの範囲で述べたように言いました。私はcamel warアプリケーションがjboss eap modules.IはJboss-deployment-structure.xmlのすべてのcamel warアプリケーションの依存関係として追加された共通モジュールを持っています。共通モジュールの依存関係として必要なモジュールを追加しましたが、クラスが見つかりません。クラスロードの問題Jboss EAP 6.4

1.)私はアプリケーションの依存関係としてモジュールを追加する必要がありますか?それはサーバーのモジュールとして存在していますか?

2.)問題の特定にご協力いただけますか?

共通モジュールのxml:

<?xml version="1.0" encoding="UTF-8"?> 
    <module xmlns="urn:jboss:module:1.1" name="com.company.esb"> 
     <resources> 
     <resource-root path="common-0.0.1-SNAPSHOT.jar" /> 
     </resources> 
     <dependencies> 
     <module name="javax.xml.bind.api" /> 
     <module name="org.slf4j" /> 


     <!-- added all the provided dependencies !--> 
     <module name="org.springframework.web" /> 
    <module name="org.wildfly.extension.camel" /> 
    <module name="org.wildfly.camel.wildfly-camel-modules" /> 
    <module name="org.apache.camel.core" /> 
    <module name="org.apache.camel.spring" /> 

     </dependencies> 
    </module> 

のjboss-展開するstructure.xml

<?xml version="1.0" encoding="UTF-8"?> 
<jboss-deployment-structure> 
    <deployment> 
     <dependencies> 
       <module name="com.company.esb"/> 
     </dependencies> 
    </deployment> 
</jboss-deployment-structure> 

エラーログ。

15:12:46,175 INFO [org.jboss.as.server.deployment] (MSC service thread 1-4) JBAS015876: Starting deployment of "Component-0.0.1-SNAPSHOT.war" (runtime-name: "Component-0.0.1-SNAPSHOT.war") 
15:12:46,637 WARN [org.jboss.as.ee] (MSC service thread 1-3) JBAS011006: Not installing optional component org.springframework.web.context.ContextLoaderListener due to an exception (enable DEBUG log level to see the cause) 
15:12:46,658 INFO [org.jboss.web] (ServerService Thread Pool -- 88) JBAS018210: Register web context: /Component-0.0.1-SNAPSHOT 
15:12:46,669 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/Component-0.0.1-SNAPSHOT]] (ServerService Thread Pool -- 88) JBWEB000285: Error configuring application listener of class org.springframework.web.context.ContextLoaderListener: java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener from [Module "deployment.Component-0.0.1-SNAPSHOT.war:main" from Service Module Loader] 
    at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:211) [jboss-modules.jar:1.3.10.Final-redhat-1] 
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:459) [jboss-modules.jar:1.3.10.Final-redhat-1] 
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:408) [jboss-modules.jar:1.3.10.Final-redhat-1] 
    at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:389) [jboss-modules.jar:1.3.10.Final-redhat-1] 
    at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:134) [jboss-modules.jar:1.3.10.Final-redhat-1] 
    at org.jboss.as.web.deployment.WebInjectionContainer.newInstance(WebInjectionContainer.java:78) [jboss-as-web-7.5.17.Final-redhat-4.jar:7.5.17.Final-redhat-4] 
    at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3294) [jbossweb-7.5.24.Final-redhat-1.jar:7.5.24.Final-redhat-1] 
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:3780) [jbossweb-7.5.24.Final-redhat-1.jar:7.5.24.Final-redhat-1] 
    at org.jboss.as.web.deployment.WebDeploymentService.doStart(WebDeploymentService.java:163) [jboss-as-web-7.5.17.Final-redhat-4.jar:7.5.17.Final-redhat-4] 
    at org.jboss.as.web.deployment.WebDeploymentService.access$000(WebDeploymentService.java:61) [jboss-as-web-7.5.17.Final-redhat-4.jar:7.5.17.Final-redhat-4] 
    at org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:96) [jboss-as-web-7.5.17.Final-redhat-4.jar:7.5.17.Final-redhat-4] 
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [rt.jar:1.8.0_151] 
    at java.util.concurrent.FutureTask.run(FutureTask.java:266) [rt.jar:1.8.0_151] 
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [rt.jar:1.8.0_151] 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [rt.jar:1.8.0_151] 
    at java.lang.Thread.run(Thread.java:748) [rt.jar:1.8.0_151] 
    at org.jboss.threads.JBossThread.run(JBossThread.java:122) 

15:12:46,674 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/Component-0.0.1-SNAPSHOT]] (ServerService Thread Pool -- 88) JBWEB000286: Skipped installing application listeners due to previous error(s) 
15:12:46,674 ERROR [org.apache.catalina.core] (ServerService Thread Pool -- 88) JBWEB001103: Error detected during context /Component-0.0.1-SNAPSHOT start, will stop it 
15:12:46,675 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 88) MSC000001: Failed to start service jboss.web.deployment.default-host."/Component-0.0.1-SNAPSHOT": org.jboss.msc.service.StartException in service jboss.web.deployment.default-host."/Component-0.0.1-SNAPSHOT": org.jboss.msc.service.StartException in anonymous service: JBAS018040: Failed to start context 
    at org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:99) 
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [rt.jar:1.8.0_151] 
    at java.util.concurrent.FutureTask.run(FutureTask.java:266) [rt.jar:1.8.0_151] 
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [rt.jar:1.8.0_151] 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [rt.jar:1.8.0_151] 
    at java.lang.Thread.run(Thread.java:748) [rt.jar:1.8.0_151] 
    at org.jboss.threads.JBossThread.run(JBossThread.java:122) 
Caused by: org.jboss.msc.service.StartException in anonymous service: JBAS018040: Failed to start context 
    at org.jboss.as.web.deployment.WebDeploymentService.doStart(WebDeploymentService.java:168) 
    at org.jboss.as.web.deployment.WebDeploymentService.access$000(WebDeploymentService.java:61) 
    at org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:96) 
    ... 6 more 

15:12:46,679 ERROR [org.jboss.as.controller.management-operation] (DeploymentScanner-threads - 2) JBAS014612: Operation ("deploy") failed - address: ([("deployment" => "Component-0.0.1-SNAPSHOT.war")]) - failure description: {"JBAS014671: Failed services" => {"jboss.web.deployment.default-host.\"/Component-0.0.1-SNAPSHOT\"" => "org.jboss.msc.service.StartException in service jboss.web.deployment.default-host.\"/Component-0.0.1-SNAPSHOT\": org.jboss.msc.service.StartException in anonymous service: JBAS018040: Failed to start context 
    Caused by: org.jboss.msc.service.StartException in anonymous service: JBAS018040: Failed to start context"}} 
15:12:46,681 ERROR [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS015870: Deploy of deployment "Component-0.0.1-SNAPSHOT.war" was rolled back with the following failure message: 
{"JBAS014671: Failed services" => {"jboss.web.deployment.default-host.\"/Component-0.0.1-SNAPSHOT\"" => "org.jboss.msc.service.StartException in service jboss.web.deployment.default-host.\"/Component-0.0.1-SNAPSHOT\": org.jboss.msc.service.StartException in anonymous service: JBAS018040: Failed to start context 
    Caused by: org.jboss.msc.service.StartException in anonymous service: JBAS018040: Failed to start context"}} 
15:12:46,770 INFO [org.jboss.as.server.deployment] (MSC service thread 1-2) JBAS015877: Stopped deployment Component-0.0.1-SNAPSHOT.war (runtime-name: Component-0.0.1-SNAPSHOT.war) in 88ms 
15:12:46,772 INFO [org.jboss.as.controller] (DeploymentScanner-threads - 2) JBAS014774: Service status report 
JBAS014777: Services which failed to start:  service jboss.web.deployment.default-host."/Component-0.0.1-SNAPSHOT" 

のweb.xml:

<?xml version="1.0" encoding="UTF-8"?> 
<web-app xmlns="http://java.sun.com/xml/ns/javaee" 
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
      xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
      http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" 
      version="2.5"> 
    <display-name>FTP-JMS</display-name> 
    <!-- location of spring xml files --> 
    <context-param> 
     <param-name>contextConfigLocation</param-name> 
     <param-value>classpath:META-INF/spring/*.xml</param-value> 
    </context-param> 
    <!-- the listener that kick-starts Spring --> 
    <listener> 
     <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> 
    </listener> 
</web-app> 

モジュールのXMLの春のウェブ:私はEAP 6.4にモジュールを作成して、問題を再現しようとする簡単な実験室を作った

<?xml version="1.0" encoding="UTF-8"?> 
<module xmlns="urn:jboss:module:1.1" name="org.springframework.web"> 
    <resources> 
    <resource-root path="spring-web-3.2.18.RELEASE.jar" /> 
    </resources> 
    <dependencies> 
    <module name="javax.api" /> 
    <module name="org.apache.commons.logging" /> 
    <module name="org.springframework.aop" /> 
    <module name="org.springframework.beans" /> 
    <module name="org.springframework.context" /> 
    <module name="org.springframework.core" /> 
    <module name="org.springframework.tx" /> 
    <module name="org.springframework.expression" /> 

    </dependencies> 
</module> 
+0

あなたの春のWebモジュールの定義を投稿できますか? –

+0

EAPにWildFly-Camelをインストールしましたか?この回答を確認してください:https://stackoverflow.com/questions/47304685/camel-cxf-on-wildfly/47321669#47321669 –

+0

Hi Tadayoshi.iは、付属のデフォルトインストール設定を使用して、EAP.IamにWildfly-Camelをインストールできません。ヒューズ6.3。Wildfly-Camelをインストールする必要があります。必須ではないと思いますか? – Ravi

答えて

1

このモジュールを参照するSpring Webアプリケーション。このディレクトリ内

1)module.xml$JBOSS_HOME/modules/org/springframework/3.2.18

<?xml version="1.0"?> 
<module xmlns="urn:jboss:module:1.1" name="org.springframework" slot="3.2.18"> 
    <resources> 
      <resource-root path="aopalliance-1.0.jar" /> 
      <resource-root path="spring-aop-3.2.18.RELEASE.jar" /> 
      <resource-root path="spring-beans-3.2.18.RELEASE.jar" /> 
      <resource-root path="spring-context-3.2.18.RELEASE.jar" /> 
      <resource-root path="spring-context-support-3.2.18.RELEASE.jar" /> 
      <resource-root path="spring-core-3.2.18.RELEASE.jar" /> 
      <resource-root path="spring-expression-3.2.18.RELEASE.jar" /> 
      <resource-root path="spring-web-3.2.18.RELEASE.jar" /> 
    </resources> 
    <dependencies> 
      <module name="org.apache.commons.logging" /> 
      <module name="javaee.api"/> 
      <module name="javax.api" export="true" /> 
      <module name="javax.servlet.api" /> 
      <module name="org.jboss.vfs" /> 
    </dependencies> 
</module> 

、すべてのSpringフレームワークに必要なlibsにあります:

aopalliance-1.0.jar 
spring-aop-3.2.18.RELEASE.jar 
spring-beans-3.2.18.RELEASE.jar 
spring-context-3.2.18.RELEASE.jar 
spring-context-support-3.2.18.RELEASE.jar 
spring-core-3.2.18.RELEASE.jar 
spring-expression-3.2.18.RELEASE.jar 
spring-web-3.2.18.RELEASE.jar 

2)あなたのjboss-deployment-structure.xmlで参照:

<?xml version="1.0" encoding="UTF-8"?> 
<jboss-deployment-structure> 
    <deployment> 
     <dependencies> 
       <module name="org.springframework" slot="3.2.18" export="true" meta-inf="export"/> 
     </dependencies> 
    </deployment> 
</jboss-deployment-structure> 

exportとに注意してくださいタグ。そうすれば、Spring jarsのディレクトリMETA-INFから必要なリソースがクラスパスに入ります。詳細はhereをご覧ください。

最後に、web.xmlでServlet 2.5バージョンを使用していることに気付きました。それには理由がありますか?それはEAP 6.4でサポートされていますので、サーブレット3.0を使用してみてください:

<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
     http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0"> 

結果が成功の展開だった:

11:53:23,808 INFO [org.jboss.as.server.deployment] (MSC service thread 1-6) JBAS015876: Starting deployment of "spring-web-wildfly-0.0.1-SNAPSHOT.war" (runtime-name: "spring-web-wildfly-0.0.1-SNAPSHOT.war") 
11:53:23,821 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-4) JBAS010400: Bound data source [java:jboss/datasources/ExampleDS] 
11:53:24,071 INFO [org.jboss.web] (ServerService Thread Pool -- 55) JBAS018210: Register web context: /spring-web-wildfly-0.0.1-SNAPSHOT 
11:53:24,110 INFO [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/spring-web-wildfly-0.0.1-SNAPSHOT]] (ServerService Thread Pool -- 55) Initializing Spring root WebApplicationContext 
11:53:24,117 INFO [org.springframework.web.context.ContextLoader] (ServerService Thread Pool -- 55) Root WebApplicationContext: initialization started 
11:53:24,176 INFO [org.springframework.web.context.support.XmlWebApplicationContext] (ServerService Thread Pool -- 55) Refreshing Root WebApplicationContext: startup date [Fri Nov 24 11:53:24 BRST 2017]; root of context hierarchy 
11:53:24,217 INFO [org.springframework.beans.factory.xml.XmlBeanDefinitionReader] (ServerService Thread Pool -- 55) Loading XML bean definitions from "/content/spring-web-wildfly-0.0.1-SNAPSHOT.war/WEB-INF/classes/META-INF/spring/context.xml" 
11:53:24,456 INFO [org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor] (ServerService Thread Pool -- 55) JSR-330 'javax.inject.Inject' annotation found and supported for autowiring 
11:53:24,463 INFO [org.springframework.beans.factory.support.DefaultListableBeanFactory] (ServerService Thread Pool -- 55) Pre-instantiating singletons in org.s[email protected]17ac5835: defining beans [sayHiImpl,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.ConfigurationClassPostProcessor.importAwareProcessor]; root of factory hierarchy 
11:53:24,482 INFO [org.springframework.web.context.ContextLoader] (ServerService Thread Pool -- 55) Root WebApplicationContext: initialization completed in 365 ms 
11:53:24,565 INFO [org.jboss.as.server] (ServerService Thread Pool -- 28) JBAS015859: Deployed "spring-web-wildfly-0.0.1-SNAPSHOT.war" (runtime-name : "spring-web-wildfly-0.0.1-SNAPSHOT.war") 
関連する問題