zoukankan      html  css  js  c++  java
  • Class loading problem regarding ear's lib directory

    I have an ear artifact like this:

    asepdemo-ear-1.1.0-SNAPSHOT.ear

    - lib

      - aseplib-commons-1.4.4-SNAPSHOT.jar (contains class AsepException)

      - ...

    - aseplib-server-1.4.4-SNAPSHOT.jar

    - ...

    It seems that my subdeployment aseplib-server does not have access to the libs in the lib directory:

    11:09:42,683 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-3) MSC00001: Failed to start service jboss.deployment.subunit."asepdemo-ear-1.1.0-SNAPSHOT.ear"."asepli

    b-server-1.4.4-SNAPSHOT.jar".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.subunit."asepdemo-ear-1.1.0-SNAPSHOT.ear"."aseplib-server-1.4.4-SN

    APSHOT.jar".POST_MODULE: Failed to process phase POST_MODULE of subdeployment "aseplib-server-1.4.4-SNAPSHOT.jar" of deployment "asepdemo-ear-1.1.0-SNAPSHOT.ear"

            at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:121)

            at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1765)

            at org.jboss.msc.service.ServiceControllerImpl$ClearTCCLTask.run(ServiceControllerImpl.java:2291)

            at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_21]

            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_21]

            at java.lang.Thread.run(Thread.java:619) [:1.6.0_21]

    Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: java.lang.ClassNotFoundException:

                                    de.xy.platform.errorhandling.AsepException

                             from [Module "deployment.asepdemo-ear-1.1.0-SNAPSHOT.ear.aseplib-server-1.4.4-SNAPSHOT.jar:main" from Service Module Loader]

            at org.jboss.as.ejb3.deployment.EjbJarDescription.prepareApplicationExceptions(EjbJarDescription.java:155)

            at org.jboss.as.ejb3.deployment.EjbJarDescription.prepareEjbJarConfiguration(EjbJarDescription.java:144)

            at org.jboss.as.ejb3.deployment.EjbJarDescription.createEjbJarConfiguration(EjbJarDescription.java:132)

            at org.jboss.as.ejb3.deployment.processors.EjbJarConfigurationProcessor.deploy(EjbJarConfigurationProcessor.java:46)

            at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:115)

            ... 5 more

    Is there any configuration needed?

    I already added

    <jboss-deployment-structure>

      <!-- Make sub deployments isolated by default, so they cannot see each others classes without a Class-Path entry -->

      <ear-subdeployments-isolated>false</ear-subdeployments-isolated>

    </jboss-deployment-structure>

    正确答案:

    So the problem was not really related to class loading. If you have an ejb-jar.xml like

           <application-exception>

                <exception-class>

                  de.xyz.platform.errorhandling.AsepException

                </exception-class>

                <rollback>true</rollback>

            </application-exception>

    dear JBoss is not even capable of triming away white spaces, but it tries to load "

             de.xyz.platform.errorhandling.AsepException

    " class.

  • 相关阅读:
    lua 学习
    IOS表情存入MYSQL数据库失败
    C# string数组转int数组
    打开端口
    win10下设置IIS、安装php7.2
    NET Core 应用程序 IIS 运行报错 502.3-Gateway
    微信小程序(一)--简单的介绍
    C#socket通信
    使用VScode 的插件
    Vue学习笔记:Slot
  • 原文地址:https://www.cnblogs.com/duanxz/p/2876271.html
Copyright © 2011-2022 走看看