3 Replies Latest reply on Mar 25, 2004 10:09 AM by maaaah

    Classcastexception using xalan2.4.1 and xercesImpl-2.2.1.jar

    ceptona123

      Dear all,

      I am using Jboss 3.2.3 to deploy my application framework.ear and use my own distribution of Xerces(2.2.1) and Xalan (2.4.1).
      Since i want to force Jboss to first load jars of the EAR I have put the jboss-app.xml in META-INF as follows:

      <jboss-app>
      <loader-repository>frameworkdomain:LoaderRepository=framework.ear</loader-repository>
      </jboss-app>

      When now starting JBOSS, the following classcastexception is thrown during deployment of my entitybeans.

      [EntityContainer] Starting failed
      org.jboss.deployment.DeploymentException: org.apache.xerces.jaxp.DocumentBuilder
      FactoryImpl; - nested throwable: (java.lang.ClassCastException: org.apache.xerce
      s.jaxp.DocumentBuilderFactoryImpl)
      at org.jboss.metadata.XmlFileLoader.getDocument(XmlFileLoader.java:316)
      at org.jboss.metadata.XmlFileLoader.getDocument(XmlFileLoader.java:247)
      at org.jboss.metadata.XmlFileLoader.getDocumentFromURL(XmlFileLoader.jav
      a:219)
      at org.jboss.metadata.XmlFileLoader.getDocument(XmlFileLoader.java:203)
      at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCXmlFileLoader.load(JDBCXm
      lFileLoader.java:64)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.loadJDBCEntityMetaDat
      a(JDBCStoreManager.java:706)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.initStoreManager(JDBC
      StoreManager.java:409)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.start(JDBCStoreManage
      r.java:357)
      at org.jboss.ejb.plugins.CMPPersistenceManager.start(CMPPersistenceManag
      er.java:152)
      at org.jboss.ejb.EntityContainer.startService(EntityContainer.java:342)
      at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:1
      92)
      at java.lang.reflect.Method.invoke(Native Method)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
      nDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceControl
      ler.java:976)
      at $Proxy14.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.java:394)
      at java.lang.reflect.Method.invoke(Native Method)


      Apparently there is still a conflict in classloading with other JAXP libs shipped with JBOSS:
      JBOSS_HOME/lib/xercesImpl.jar and JBOSS_HOME/server/default/lib/xalan.jar

      Apparently the application is not shielded of from the jboss system environement.
      Is there anyone who experienced a similar issues ?

      Thanks in advance for your feedback!!

      Best regards
      Pascal