本文介绍了JBoss中的类加载顺序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道JBoss服务器的默认行为(在我的案例中为4.2.3.GA)是在父级优先模式或父级最后一种模式下加载类.如果我怀疑它在父后模式下可以正常工作(例如,首先尝试从应用程序的WEB-INF/lib加载类,并且只有在未找到它们的情况下才进入server \ lib),如何配置它才能在相反,首先尝试从外部加载类,然后仅在应用程序内部查找.

I'd like to know if the default behavior of JBoss server (4.2.3.GA in my case) is loading the classes in parent-first or parent-last mode.And in case it work as I suspect in parent-last mode (i.e. first trying to load classes from the application's WEB-INF/lib and only if they are not found go to server\lib), how can I configure it to work in the opposite- first trying to load classes from outside and only looking inside the application afterwards.

推荐答案

听起来您需要设置

java2ParentDelegation={false|true}

jboss-app.xmljboss-web.xml中的

.有关更多信息,请参见本文.

这篇关于JBoss中的类加载顺序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-11 07:41