0 Replies Latest reply on Apr 20, 2004 6:39 PM by yuricake

    NullPointerException when trying to use ENTITY in xml

    yuricake Newbie

      I am using JBoss 3.0.8 (I know, very old, but at the moment there are various reasons for not upgrading)

      I have the following problem:

      I have a very large ejb-jar.xml because I need to include 6 entity beans in one deployment descriptor (finders that cross bean boundaries). It is a pain to manage, and I wanted to split it up so that it looks something like this:

      <?xml version="1.0"?>

      <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN"
      "http://java.sun.com/dtd/ejb-jar_2_0.dtd"
      [<!ENTITY eb SYSTEM "eb.xml"><!ENTITY eb0 SYSTEM "eb0.xml">
      ]>

      <ejb-jar>
      <enterprise-beans>
      &eb;
      &eb0;
      </enterprise-beans>
      </ejb-jar>


      When I try to deploy it, I get a NUllPointerException (I tried both the crimson jars that JBoss comes iwth, and I also tried replacing crimson with the latest xerces implementation). The jar file includes eb.xml and eb0.xml in the meta-inf directory. I am confident that I am replacing the XML parsers properly (the exceptions are different in both cases) so it seems as if JBoss (or the XML parser?) doesnt't know to go into the JAR file and take the included xml files.

      Crimson Exception:

      19:29:30,125 ERROR [XmlFileLoader] java.lang.NullPointerException:-1:10
      java.lang.NullPointerException
      at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:524)
      at org.apache.crimson.parser.Parser2.parse(Parser2.java:305)
      at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:433)

      at org.apache.crimson.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl
      .java:185)
      at org.jboss.metadata.XmlFileLoader.getDocument(XmlFileLoader.java:300)
      at org.jboss.metadata.XmlFileLoader.getDocument(XmlFileLoader.java:255)
      at org.jboss.metadata.XmlFileLoader.getDocumentFromURL(XmlFileLoader.jav
      a:227)
      at org.jboss.metadata.XmlFileLoader.load(XmlFileLoader.java:147)
      at org.jboss.ejb.EJBDeployer.create(EJBDeployer.java:321)
      at org.jboss.deployment.MainDeployer.create(MainDeployer.java:766)
      at org.jboss.deployment.MainDeployer.create(MainDeployer.java:758)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:626)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:591)
      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:517)
      at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
      at $Proxy3.deploy(Unknown Source)
      at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymen
      tScanner.java:435)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scanDirectory(URLDe
      ploymentScanner.java:656)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentS
      canner.java:507)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(A
      bstractDeploymentScanner.java:266)
      at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:1
      65)
      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:517)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceControl
      ler.java:1003)
      at $Proxy0.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.java:413)
      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:517)
      at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
      at $Proxy2.start(Unknown Source)
      at org.jboss.deployment.SARDeployer.start(SARDeployer.java:232)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:814)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:627)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:591)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:575)
      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:517)
      at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:324)
      at org.jboss.system.server.ServerImpl.start(ServerImpl.java:221)
      at org.jboss.Main.boot(Main.java:148)
      at org.jboss.Main$1.run(Main.java:381)
      at java.lang.Thread.run(Thread.java:479)


      Thanks,
      Yuri