【问题标题】:Jboss 4.2 Class loading exceptionJboss 4.2 类加载异常
【发布时间】:2013-05-16 07:24:58
【问题描述】:

我在server/lib/sample.jar 中有一个罐子。

sample.jar 文件包含与应用程序相关的.class 文件

那么应该如何访问server/libapplication.war/web-inf/classes

jboss-web.xml

 <class-loading java2ClassLoadingCompliance="false">
        <loader-repository>
          com.example:loader=sample.jar
            <loader-repository-config>java2ParentDelegation=false</loader-repository-config>
        </loader-repository>
</class-loading >

在 application.war/web-inf/lib 中保存 sample.jar 得到异常是

2013-05-16 10:28:58,388 INFO  [STDOUT] [Mobee]- INFO 2013-05-16 10:28:58,388 [] LoadSystemDataCommand - ....................LoadSystemDataCommand.......................
2013-05-16 10:35:25,747 DEBUG [org.jboss.deployment.scanner.URLDeploymentScanner] Added url: file:/D:/Mobee Admin-ManamDB/.metadata/.plugins/org.jboss.ide.eclipse.as.core/JBoss_4.2_Runtime_1_Server1368615125350/deploy/
2013-05-16 10:36:02,472 DEBUG [org.jboss.resource.connectionmanager.IdleRemover] run: IdleRemover notifying pools, interval: 450000
2013-05-16 10:38:40,215 WARN  [com.arjuna.ats.arjuna.logging.arjLoggerI18N] [com.arjuna.ats.arjuna.coordinator.BasicAction_58] - Abort of action id 7f000001:e258:51948a81:33 invoked while multiple threads active within it.
2013-05-16 10:38:40,215 WARN  [com.arjuna.ats.arjuna.logging.arjLoggerI18N] [com.arjuna.ats.arjuna.coordinator.CheckedAction_2] - CheckedAction::check - atomic action 7f000001:e258:51948a81:33 aborting with 1 threads active!
2013-05-16 10:38:40,242 INFO  [STDOUT] [Mobee]-ERROR 2013-05-16 10:38:40,242 [] SystemStartupObserver - Error While Loading System Propertiesorg.hibernate.PersistentObjectException: detached entity passed to persist: com.manam.mobee.persist.entity.MobeeVariable

【问题讨论】:

  • 发布异常的完整堆栈跟踪..
  • 您应该始终使用 WEB-INF 而不是 web-inf
  • @Alpesh ya 请检查此链接中的堆栈跟踪textuploader.com/?p=6&id=yWSox

标签: java jboss classloader jboss-4.2.x


【解决方案1】:

请参考下面skaffman的回答

jboss-4-2-class-loading

看看 JBossClassLoadingUseCases。您的情况似乎是用例 4(即该类将从 server/lib 加载,而不是 WEB-INF/classes。

您似乎想要的是用例 3(即 WEB-INF/classes 优先于 server/lib),在这种情况下,您应该从 jboss-web.xml 中省略 java2ParentDelegation=true 配置选项(或将其设置为 false ,这是默认值)。

ClassLoading Configuration

其他值得评估的参考资料:

JBoss classloading problem

How do I tell JBoss 4.2.3.GA to load jars in my war file lib directory first?

JBoss classloading problem

【讨论】:

  • 是的,在 web-inf/lib 中保留一个 sample.jar 我得到了异常 .plz 检查上面的异常
  • 当我保存在 WEB-INF/classes 中时,相同的应用程序正在运行。但是保存在 lib/sample.jar 中它会引发异常。 stacktrace 是textuploader.com/?p=6&id=PGfpt 。由于加载菜单和菜单项需要一段时间才能在 WEB-INF/classes 中正常加载大约 2 分钟,当我放置 lib/sample.jar 时,在 20 分钟连接超时后抛出异常。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-04-19
  • 1970-01-01
相关资源
最近更新 更多