1

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.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)
   ...

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?

4

2 回答 2

1

java2ParentDelegation=false. Read here for more details.

Java EE class loading details: Java EE class loading standard

于 2011-01-25T00:44:19.850 回答
0

jboss-web.xml 属于您的应用程序的 WEB-INF 目录,而不是 META-INF。您的 xml 文件看起来不错,我将其与已部署到 Jboss-4.x 的 WAR 进行了比较

于 2011-01-25T00:50:41.237 回答