2 Replies Latest reply on Dec 1, 2003 9:45 AM by naumankhanca

    Deployment Problem NullPointerException

    naumankhanca Newbie

      Hi,
      I'm deploying a cmp bean in Jboss 3.2.1 and I made changes in standardjaws.xml and standardjbosscmp-jdbc.xml file but getting the NullPointerException. Does anyone has any idea,please let me know.
      Regards,
      Nauman

      Below is the traces of that exception

      03:56:47,597 INFO [MainDeployer] Starting deployment of package: file:/C:/jboss
      -3.2.1_tomcat-4.1.24/server/default/deploy/employee.jar
      03:56:48,338 INFO [EjbModule] Creating
      03:56:48,348 INFO [EjbModule] Deploying EmployeeBean
      03:56:48,528 INFO [EntityContainer] Creating
      03:56:48,538 INFO [EntityInstancePool] Creating
      03:56:48,538 INFO [EntityInstancePool] Created
      03:56:48,888 ERROR [EntityContainer] Initialization failed
      java.lang.NullPointerException
      at org.jboss.ejb.plugins.jaws.metadata.CMPFieldMetaData.getSQLType(CMPFi
      eldMetaData.java:152)
      at org.jboss.ejb.plugins.jaws.jdbc.JDBCInitCommand.(JDBCInitComman
      d.java:71)
      at org.jboss.ejb.plugins.jaws.jdbc.JDBCCommandFactory.createInitCommand(
      JDBCCommandFactory.java:240)
      at org.jboss.ejb.plugins.jaws.JAWSPersistenceManager.create(JAWSPersiste
      nceManager.java:106)
      at org.jboss.ejb.plugins.CMPPersistenceManager.create(CMPPersistenceMana
      ger.java:127)
      at org.jboss.ejb.EntityContainer.createService(EntityContainer.java:297)

      at org.jboss.system.ServiceMBeanSupport.create(ServiceMBeanSupport.java:
      158)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
      java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
      nDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceControl
      ler.java:966)
      at $Proxy11.create(Unknown Source)
      at org.jboss.system.ServiceController.create(ServiceController.java:310)

      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
      java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
      nDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
      at $Proxy41.create(Unknown Source)
      at org.jboss.ejb.EjbModule.createService(EjbModule.java:299)
      at org.jboss.system.ServiceMBeanSupport.create(ServiceMBeanSupport.java:
      158)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
      java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
      nDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceControl
      ler.java:966)
      at $Proxy11.create(Unknown Source)
      at org.jboss.system.ServiceController.create(ServiceController.java:310)

      at org.jboss.system.ServiceController.create(ServiceController.java:243)

      at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
      nDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
      at $Proxy19.create(Unknown Source)
      at org.jboss.ejb.EJBDeployer.create(EJBDeployer.java:519)
      at org.jboss.deployment.MainDeployer.create(MainDeployer.java:784)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:639)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:613)
      at sun.reflect.GeneratedMethodAccessor18.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
      nDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
      at $Proxy7.deploy(Unknown Source)
      at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymen
      tScanner.java:302)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentS
      canner.java:476)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
      doScan(AbstractDeploymentScanner.java:200)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
      loop(AbstractDeploymentScanner.java:211)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
      run(AbstractDeploymentScanner.java:190)
      03:56:49,039 WARN [ServiceController] Problem creating service jboss.j2ee:jndiN
      ame=ejb/EmployeeBean,service=EJB
      java.lang.NullPointerException
      at org.jboss.ejb.plugins.jaws.metadata.CMPFieldMetaData.getSQLType(CMPFi
      eldMetaData.java:152)
      at org.jboss.ejb.plugins.jaws.jdbc.JDBCInitCommand.(JDBCInitComman
      d.java:71)
      at org.jboss.ejb.plugins.jaws.jdbc.JDBCCommandFactory.createInitCommand(
      JDBCCommandFactory.java:240)
      at org.jboss.ejb.plugins.jaws.JAWSPersistenceManager.create(JAWSPersiste
      nceManager.java:106)
      at org.jboss.ejb.plugins.CMPPersistenceManager.create(CMPPersistenceMana
      ger.java:127)
      at org.jboss.ejb.EntityContainer.createService(EntityContainer.java:297)

      at org.jboss.system.ServiceMBeanSupport.create(ServiceMBeanSupport.java:
      158)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
      java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
      nDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceControl
      ler.java:966)
      at $Proxy11.create(Unknown Source)
      at org.jboss.system.ServiceController.create(ServiceController.java:310)

      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
      java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
      nDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
      at $Proxy41.create(Unknown Source)
      at org.jboss.ejb.EjbModule.createService(EjbModule.java:299)
      at org.jboss.system.ServiceMBeanSupport.create(ServiceMBeanSupport.java:
      158)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
      java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
      nDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceControl
      ler.java:966)
      at $Proxy11.create(Unknown Source)
      at org.jboss.system.ServiceController.create(ServiceController.java:310)

      at org.jboss.system.ServiceController.create(ServiceController.java:243)

      at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
      nDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
      at $Proxy19.create(Unknown Source)
      at org.jboss.ejb.EJBDeployer.create(EJBDeployer.java:519)
      at org.jboss.deployment.MainDeployer.create(MainDeployer.java:784)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:639)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:613)
      at sun.reflect.GeneratedMethodAccessor18.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
      nDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
      at $Proxy7.deploy(Unknown Source)
      at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymen
      tScanner.java:302)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentS
      canner.java:476)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
      doScan(AbstractDeploymentScanner.java:200)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
      loop(AbstractDeploymentScanner.java:211)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
      run(AbstractDeploymentScanner.java:190)
      03:56:49,179 INFO [EjbModule] Created
      03:56:49,189 INFO [EjbModule] Starting
      03:56:49,189 INFO [EjbModule] Started
      03:56:49,189 INFO [EJBDeployer] Deployed: file:/C:/jboss-3.2.1_tomcat-4.1.24/se
      rver/default/deploy/employee.jar
      03:56:49,209 INFO [MainDeployer] Deployed package: file:/C:/jboss-3.2.1_tomcat-
      4.1.24/server/default/deploy/employee.jar
      03:56:49,209 ERROR [URLDeploymentScanner] MBeanException: Exception in MBean ope
      ration 'checkIncompleteDeployments()'
      Cause: Incomplete Deployment listing:
      Packages waiting for a deployer:

      Incompletely deployed packages:

      MBeans waiting for classes:

      MBeans waiting for other MBeans:
      [ObjectName: jboss.j2ee:jndiName=ejb/EmployeeBean,service=EJB
      state: FAILED
      I Depend On:
      Depends On Me: java.lang.NullPointerException]

        • 1. Re: Deployment Problem NullPointerException
          Juha Lindfors Master

          Please submit a bug report on the NPE with the package you're trying to deploy to sourceforge bug tracker (and the changes you made to standardxxx files).

          -- Juha

          • 2. Re: Deployment Problem NullPointerException
            naumankhanca Newbie

            thanks to reply. and I did forward to sourceforge.net but still i believe might be i did some mistake that's why i'm putting my code here please check it
            package employee;

            import javax.ejb.*;
            import java.rmi.RemoteException;

            public class EmployeeBean implements EntityBean
            {
            public Integer id;
            public String firstname;
            public String lastname;
            public String email;
            public EntityContext context;

            public EmployeeBean()
            {
            }

            public Integer ejbCreate( String firstname, String lastname, String email )
            throws CreateException
            {
            this.firstname = firstname;
            this.lastname = lastname;
            this.email = email;

            return null;
            }

            public void ejbPostCreate( String firstname, String lastname, String email )
            throws CreateException
            {
            }

            public void says( String message )
            {
            System.out.println( "[" + firstname + " " + lastname +
            "(" + id + ") " + email + "] " + message );
            }

            /* private Integer getPK(){
            return new Integer((int) (Math.random()*42));
            }*/

            public void setEntityContext( EntityContext context )
            throws EJBException, RemoteException
            {
            this.context = context;
            }

            public void unsetEntityContext()
            throws EJBException, RemoteException
            {
            }

            public void ejbActivate()
            throws EJBException, RemoteException
            {
            }

            public void ejbLoad()
            throws EJBException, RemoteException
            {
            }

            public void ejbPassivate()
            throws EJBException, RemoteException
            {
            }

            public void ejbRemove()
            throws RemoveException, EJBException, RemoteException
            {
            }

            public void ejbStore()
            throws EJBException, RemoteException
            {
            }
            }

            =====ejb.jar======
            <?xml version="1.0"?>
            <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.1//EN"
            "http://java.sun.com/j2ee/dtds/ejb-jar_1_1.dtd">
            <ejb-jar>
            <enterprise-beans>

            <ejb-name>EmployeeBean</ejb-name>
            employee.EmployeeHome
            employee.Employee
            <ejb-class>employee.EmployeeBean</ejb-class>
            <persistence-type>Container</persistence-type>
            <prim-key-class>java.lang.Integer</prim-key-class>
            False
            <cmp-field>
            <field-name>id</field-name>
            </cmp-field>
            <cmp-field>
            <field-name>firstname</field-name>
            </cmp-field>
            <cmp-field>
            <field-name>lastname</field-name>
            </cmp-field>
            <cmp-field>
            <field-name>email</field-name>
            </cmp-field>
            <primkey-field>id</primkey-field>
            <resource-ref>
            <res-ref-name>jdbc/MySqlDS</res-ref-name>
            <res-type>javax.sql.DataSource</res-type>
            <res-auth>Container</res-auth>
            </resource-ref>
            <security-identity>
            <use-caller-identity></use-caller-identity>
            </security-identity>

            </enterprise-beans>
            <assembly-descriptor>
            <container-transaction>

            <ejb-name>EmployeeBean</ejb-name>
            <method-name>*</method-name>

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

            =======standardjboss-jdbc.xml (piece of code)
            <jbosscmp-jdbc>


            java:/MySqlDS
            <datasource-mapping>MY SQL</datasource-mapping>
            <create-table>true</create-table>
            <remove-table>false</remove-table>
            <read-only>false</read-only>
            <time-out>300</time-out>
            <pk-constraint>true</pk-constraint>
            <fk-constraint>false</fk-constraint>
            <row-locking>false</row-locking>
            <preferred-relation-mapping>foreign-key</preferred-relation-mapping>
            <read-ahead>
            on-load
            <page-size>1000</page-size>
            <eager-load-group>*</eager-load-group>
            </read-ahead>
            <list-cache-max>1000</list-cache-max>



            <enterprise-beans>

            <ejb-name>EmployeeBean</ejb-name>
            <table-name>employee_new</table-name>
            <cmp-field>
            <field-name>id</field-name>
            <column-name>id</column-name>
            </cmp-field>
            <cmp-field>
            <field-name>lastname</field-name>
            <column-name>last_name</column-name>
            </cmp-field>
            <cmp-field>
            <field-name>firstname</field-name>
            <column-name>first_name</column-name>
            </cmp-field>
            <cmp-field>
            <field-name>email</field-name>
            <column-name>email</column-name>
            </cmp-field>
            <unknown-pk>
            <unknown-pk-class>java.lang.Integer</unknown-pk-class>
            <field-name>id</field-name>
            <column-name>id</column-name>
            <jdbc-type>INTEGER</jdbc-type>
            <sql-type>INTEGER</sql-type>
            <auto-increment/>
            </unknown-pk>
            <entity-command name="mysql-get-generated-keys"/>

            </enterprise-beans>
            ======