如何告诉JBoss 4.2.3.GA首先在我的war文件lib目录中加载jar? [英] How do I tell JBoss 4.2.3.GA to load jars in my war file lib directory first?

查看:391
本文介绍了如何告诉JBoss 4.2.3.GA首先在我的war文件lib目录中加载jar?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我部署了一个web存档,该war引用了一个与$ JBOSS_HOME / server / default / lib中的jar文件冲突的jar文件。我可以手动删除有问题的罐子,但我更喜欢一种允许我在JBoss上指定罐子的解决方案。我甚至想告诉JBoss排除特定的罐子,如果可能的话。

I deploy a web archive and that war references a jar file that conflicts with those in $JBOSS_HOME/server/default/lib. I can go and remove the offending jars manually, but I'd prefer a solution that allows me to specify my jars over JBoss's. I would even like to just tell JBoss to exclude specific jars, if that's even possible.

我最接近的是在jboss-web.xml中添加一些内容我的战争的META-INF目录,但我显然没有在那里做某事。这就是我到目前为止:

The closest I've come was to add something in jboss-web.xml in my war's META-INF directory, but I'm clearly not doing something right there. This is what I have so far:

<?xml version="1.0" encoding="UTF-8"?>

<jboss-web>
  <class-loading java2ClassLoadingCompliance="false">
    <loader-repository>com.amce:archive=WHATEVER</loader-repository>
    <loader-repository-config>java2ParentDelegation=false</loader-repository-config>
  </class-loading>
</jboss-web>

如果出现以下错误,则会失败:

This fails spectacularly with errors like this:

ERROR [13]] Exception sending context initialized event to listener instance of class org.jboss.web.jsf.integration.config.JBossJSFConfigureListener
java.lang.ClassCastException: org.apache.xerces.jaxp.SAXParserFactoryImpl cannot be cast to javax.xml.parsers.SAXParserFactory
    at javax.xml.parsers.SAXParserFactory.newInstance(SAXParserFactory.java:128)
    at com.sun.faces.config.ConfigureListener$WebXmlProcessor.getConfiguredFactory(ConfigureListener.java:697)
    at com.sun.faces.config.ConfigureListener$WebXmlProcessor.scanForFacesServlet(ConfigureListener.java:669)
   ...

这个错误让我相信我只是错误地指定了jboss-web语法(某处有xml架构) )?但是,我甚至不确定自己是否正走在正确的道路上。无论如何我还是可以在不修改JBoss的情况下做到这一点吗?

That error leads me to believe I'm just specifying the jboss-web syntax incorrectly (is there an xml schema somewhere)? However I'm not even sure I'm heading down the right path. Is there anyway I can do this without modifying JBoss in anyway?

推荐答案

java2ParentDelegation = false 请阅读此处了解更多详情。

Java EE类加载详细信息: Java EE类加载标准

Java EE class loading details: Java EE class loading standard

这篇关于如何告诉JBoss 4.2.3.GA首先在我的war文件lib目录中加载jar?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆