3 Replies Latest reply on Apr 12, 2002 8:47 AM by tsmets

    EntityBean jboss.xml problem

    tsmets

      OK
      Up to now I have managed to deply SessionBeans on JBoss 2.4.4.
      I am now working for a while with Entity beans. I took the code from the book "Mastering EJB" (Publ. by WILEY).
      The code deploy OK without a JBoss.xml but is (of course not callable as the JNDI is not started then!).

      Now when I add to my jar the jboss.xml here below (which look OK to me), I get the following error :

      [INFO,J2eeDeployer] install EJB module TestBMP.jar
      [INFO,ContainerFactory] Deploying:file:/C:/cygwin/opt/jboss/tmp/deploy/Default/TestBMP.jar
      [ERROR,XmlFileLoader] failed to load jboss.xml. There could be a syntax error.
      [ERROR,ContainerFactory] InternalError
      java.lang.NullPointerException
      at org.jboss.metadata.ConfigurationMetaData.importJbossXml(ConfigurationMetaData.java:204)
      at org.jboss.metadata.ApplicationMetaData.importJbossXml(ApplicationMetaData.java:342)
      at org.jboss.metadata.XmlFileLoader.load(XmlFileLoader.java:186)
      at org.jboss.ejb.ContainerFactory.deploy(ContainerFactory.java:436)
      at org.jboss.ejb.ContainerFactory.deploy(ContainerFactory.java:369)
      at org.jboss.ejb.ContainerFactory.deploy(ContainerFactory.java:306)
      at java.lang.reflect.Method.invoke(Native Method)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
      at org.jboss.deployment.J2eeDeployer.startModules(J2eeDeployer.java:487)
      at org.jboss.deployment.J2eeDeployer.startApplication(J2eeDeployer.java:459)
      at org.jboss.deployment.J2eeDeployer.deploy(J2eeDeployer.java:190)
      at java.lang.reflect.Method.invoke(Native Method)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
      at org.jboss.deployment.AutoDeployer.deploy(AutoDeployer.java:395)
      at org.jboss.deployment.AutoDeployer.run(AutoDeployer.java:233)
      at java.lang.Thread.run(Thread.java:484)
      [ERROR,J2eeDeployer] Starting TestBMP.jar failed!
      [ERROR,Default] org.jboss.deployment.DeploymentException: Could not deploy file:/C:/cygwin/opt/jboss/tmp/deploy/Default/
      TestBMP.jar, Cause: java.lang.NullPointerException


      Could someone tell me what the problem is ?

      jboss.xml & ejb-jar.xml are here under !

      Tx,

      Thomas,

      ====== jboss.xml =========================
      <?xml version="1.0"?>

      <enterprise-beans>

      <ejb-name>Account</ejb-name>
      <jndi-name>account/AccountHome</jndi-name>
      <configuration-name>LRU Configuration</configuration-name>

      </enterprise-beans>
      <container-configurations>
      <container-configuration>
      <container-name>LRU Configuration</container-name>
      <instance-cache>org.jboss.ejb.plugins.EntitySessionInstanceCache</instance-cache>
      <container-cache-conf>
      <cache-policy>org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy</cache-policy>
      <cache-policy-conf>
      <min-capacity>5</min-capacity>
      <max-capacity>200</max-capacity>
      <overager-period>300</overager-period>
      <max-bean-age>600</max-bean-age>
      <resizer-period>400</resizer-period>
      <max-cache-miss-period>60</max-cache-miss-period>
      <min-cache-miss-period>1</min-cache-miss-period>
      <cache-load-factor>0.75</cache-load-factor>
      </cache-policy-conf>
      </container-cache-conf>
      </container-configuration>
      </container-configurations>

      ====== jboss.xml =========================



      []b====== ejb-jar.xml =========================
      <?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'>

      <ejb-jar>
      <enterprise-beans>

      <ejb-name>Account</ejb-name>
      com.kls.account.AccountHome
      com.kls.account.Account
      <local-home>com.kls.account.AccountLocalHome</local-home>
      com.kls.account.AccountLocal
      <ejb-class>com.kls.account.AccountBean</ejb-class>
      <persistence-type>Bean</persistence-type>
      <prim-key-class>com.kls.account.AccountPK</prim-key-class>
      False

      <!--
      <resource-ref>
      <res-ref-name>jdbc/ejbPool</res-ref-name>
      <res-type>javax.sql.DataSource</res-type>
      <res-auth>Container</res-auth>
      </resource-ref>
      -->

      </enterprise-beans>

      <assembly-descriptor>
      <container-transaction>

      <ejb-name>Account</ejb-name>
      <method-intf>Local</method-intf>
      <method-name>*</method-name>


      <ejb-name>Account</ejb-name>
      <method-intf>Remote</method-intf>
      <method-name>*</method-name>

      <trans-attribute>Required</trans-attribute>
      </container-transaction>
      </assembly-descriptor>
      </ejb-jar>

      ====== ejb-jar.xml =========================

        • 1. Re: EntityBean jboss.xml problem
          annegret

          Maybe the problem is

          <instance-cache>org.jboss.ejb.plugins.EntitySessionInstanceCache</instance-cache>

          as far as I can see it must be "EntityInstanceCache" instead of "EntitySessionInstanceCache".

          Another point:
          Your LRU Configuration is not a complete container-configuration. If You do not have a complete configuration named "LRU Configuration" in jboss\conf\default\standardjboss.xml jboss may miss some configuration parts and therefore throws a NullPointerException.

          • 2. Re: EntityBean jboss.xml problem
            maratd

            You must use the existing configuration names in the <configuration-name>. See standardjboss.xml.

            • 3. Re: EntityBean jboss.xml problem
              tsmets

              Tx guys
              Apparently my problem was much more simple (it works now, at least). The ANT script generating the jars would create a ./WEB-INF directory & copy in it all my XML's there !

              I copy-pasted from a servlet project !

              Sorry for the posting !

              Thomas,

              ---
              "Since the draft release of the Human Genome, we're all Open Source!"