3 Replies Latest reply on May 31, 2012 7:14 AM by jaikiran pai

    Jboss AS 7.1 & EJB2 : NullPointerException parsing 'jbosscmp-jdbc.xml' on JDBCAuditMetaData

    jsebfranck Newbie

      Hi,

       

      I have a NullPointerException during the EJB2 deployment on AS 7.1.1 Final :

       

      org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS010713: Failed to parse 'jbosscmp-jdbc.xml'

          at org.jboss.as.cmp.processors.CmpParsingProcessor.deploy(CmpParsingProcessor.java:91)

          at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]

          ... 5 more

      Caused by: java.lang.NullPointerException

          at org.jboss.as.cmp.jdbc.metadata.JDBCAuditMetaData.<init>(JDBCAuditMetaData.java:61)

          at org.jboss.as.cmp.jdbc.metadata.JDBCEntityMetaData.<init>(JDBCEntityMetaData.java:683)

          at org.jboss.as.cmp.jdbc.metadata.JDBCApplicationMetaData.<init>(JDBCApplicationMetaData.java:241)

          at org.jboss.as.cmp.jdbc.metadata.parser.JDBCMetaDataParser.parse(JDBCMetaDataParser.java:102)

          at org.jboss.as.cmp.processors.CmpParsingProcessor.deploy(CmpParsingProcessor.java:89)

          ... 6 more

       

      Please find below my three ejb configuration files : ejb-jar.xml, jbosscmp-jdbc.xml and jboss-ejb3.xml. Any idea of how I could resolve that?

       

      Thanks in advance !

       

      - ejb-jar.xml

       

      <?xml version="1.0" encoding="UTF-8"?>

       

      <!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>

      <entity>

      <description>Entity Bean mapping to the keyword table</description>

        <display-name>KeywordBusinessEjb</display-name>

        <ejb-name>KeywordBusinessEjb</ejb-name>

        <home>com.KeywordBusinessHome</home>

        <remote>com.KeywordBusiness</remote>

        <ejb-class>com.KeywordBusinessBean</ejb-class>

        <persistence-type>Container</persistence-type>

        <prim-key-class>java.lang.Long</prim-key-class>

        <reentrant>False</reentrant>

        <cmp-version>2.x</cmp-version>

        <abstract-schema-name>keyword</abstract-schema-name>

        <cmp-field><field-name>keywordId</field-name></cmp-field>

        <cmp-field><field-name>changeDateValue</field-name></cmp-field>

        <cmp-field><field-name>creationDateValue</field-name></cmp-field>

        <cmp-field><field-name>description</field-name></cmp-field>

        <cmp-field><field-name>rowVersion</field-name></cmp-field>

        <primkey-field>keywordId</primkey-field>

        <resource-ref>

      <res-ref-name>jdbc/database</res-ref-name>

      <res-type>javax.sql.DataSource</res-type>

      <res-auth>Container</res-auth>

        </resource-ref>

      </entity>

        </enterprise-beans>

        <assembly-descriptor>

          <container-transaction>

           <method>

           <ejb-name>KeywordBusinessEjb</ejb-name>

           <method-name>*</method-name>

           </method>

           <trans-attribute>Required</trans-attribute>

          </container-transaction>

        </assembly-descriptor>

      </ejb-jar>

       

      - jbosscmp-jdbc.xml

       

      <?xml version="1.0" encoding="UTF-8"?>

       

      <!DOCTYPE jbosscmp-jdbc PUBLIC  

         "-//JBoss//DTD JBOSSCMP-JDBC 3.2//EN"

         "http://www.jboss.org/j2ee/dtd/jbosscmp-jdbc_3_2.dtd">

       

      <jbosscmp-jdbc>

       

        <enterprise-beans>

          <entity>

            <ejb-name>KeywordBusinessEjb</ejb-name>

            <row-locking>false</row-locking>

            <table-name>keyword</table-name>    

            <cmp-field>

              <field-name>keywordId</field-name>

              <column-name>keyword_id</column-name>

            </cmp-field>

            <cmp-field>

              <field-name>changeDateValue</field-name>

              <column-name>change_date</column-name>

            </cmp-field>

            <cmp-field>

              <field-name>creationDateValue</field-name>

              <column-name>creation_date</column-name>

            </cmp-field>

            <cmp-field>

              <field-name>description</field-name>

              <column-name>description</column-name>

            </cmp-field>     

            <cmp-field>

              <field-name>rowVersion</field-name>

              <column-name>row_version</column-name>

            </cmp-field>

              <optimistic-locking>

                      <version-column/>

                      <field-name>rowVersion</field-name>

                      <column-name>row_version</column-name>

              </optimistic-locking>

            <audit>

              <created-time>

                <field-name>creationDateValue</field-name>

              </created-time>

              <updated-time>

                <field-name>changeDateValue</field-name>

              </updated-time>

            </audit>

          </entity>

        </enterprise-beans>

      </jbosscmp-jdbc>

       

      - jboss-ejb3.xml

       

      <?xml version="1.0"?>

      <jboss:ejb-jar xmlns:jboss="http://www.jboss.com/xml/ns/javaee"

                        xmlns="http://java.sun.com/xml/ns/javaee"

                        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

                        xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee http://www.jboss.org/j2ee/schema/jboss-ejb3-2_0.xsd

      http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_1.xsd"

                        version="3.1"

                        impl-version="2.0">

        <enterprise-beans>

          <entity>

              <ejb-name>KeywordBusinessEjb</ejb-name>

              <resource-ref>

                  <res-ref-name>jdbc/database</res-ref-name>

                  <jndi-name>java:/OracleDS</jndi-name>

              </resource-ref>

          </entity>   

         </enterprise-beans>

      </jboss:ejb-jar>