开发者

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

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.

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.SAXPar开发者_运维百科serFactory
    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)
   ...

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. Read here for more details.

Java EE class loading details: Java EE class loading standard


jboss-web.xml belongs in your app's WEB-INF directory, not META-INF. your xml file looks right, I compared it to WAR i have deploye to Jboss-4.x

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜