5 Replies Latest reply on Mar 6, 2003 9:38 AM by Charles

    JBoss throws NullPointerException when deploying ejb

    Charles Newbie

      Greetings -

      After days of great pain trying to build and deploy a simple test app (one each: jsp, servlet, entity bean (TWUserRole) and session bean (TWManageUserRole) I have a new problem - JBoss is throwing a NullPointerException when deploying my ejbs. Any suggestions? I cannot tell anything meaningful from the exception.

      2003-03-05 14:24:14,765 INFO [org.jboss.deployment.MainDeployer] Starting deployment of package: file:/C:/Frameworks/JBoss/jboss-3.0.4_tomcat-4.1.12/server/default/deploy/ejb-test.jar

      2003-03-05 14:24:14,953 INFO [org.jboss.ejb.EjbModule] Creating

      2003-03-05 14:24:14,968 INFO [org.jboss.ejb.EjbModule] Deploying TWUserRole

      2003-03-05 14:24:15,125 INFO [org.jboss.ejb.EjbModule] Deploying ManageTWUserRole

      2003-03-05 14:24:15,140 INFO [org.jboss.ejb.EjbModule] Deploying test/SequenceGenerator

      2003-03-05 14:24:15,203 INFO [org.jboss.ejb.EjbModule] Created

      2003-03-05 14:24:15,203 INFO [org.jboss.ejb.EjbModule] Starting

      2003-03-05 14:24:15,828 WARN [org.jboss.system.ServiceController] Problem starting service jboss.j2ee:jndiName=ejb/test/TWUserRoleHome,service=EJB

      java.lang.NullPointerException at org.jboss.ejb.plugins.cmp.jdbc.SQLUtil.fixTableName(SQLUtil.java:38)
      at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCEntityBridge.(JDBCEntityBridge.java:103)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.initStoreManager(JDBCStoreManager.java:397)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.start(JDBCStoreManager.java:339)

      at org.jboss.ejb.plugins.CMPPersistenceManager.start(CMPPersistenceManager.java:198)

      at org.jboss.ejb.EntityContainer.start(EntityContainer.java:376)

      at org.jboss.ejb.Container.invoke(Container.java:756)

      at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:1058)

      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)

      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)

      at $Proxy5.start(Unknown Source)

      at org.jboss.system.ServiceController.start(ServiceController.java:398)

      at java.lang.reflect.Method.invoke(Native Method)

      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)

      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)

      at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)

      at $Proxy16.start(Unknown Source)

      at org.jboss.ejb.EjbModule.startService(EjbModule.java:430)

      at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:165)

      at java.lang.reflect.Method.invoke(Native Method)

      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)

      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)

      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)

      at $Proxy5.start(Unknown Source)

      at org.jboss.system.ServiceController.start(ServiceController.java:398)

      at java.lang.reflect.Method.invoke(Native Method)

      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)

      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)

      at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)

      at $Proxy9.start(Unknown Source)

      at org.jboss.ejb.EJBDeployer.start(EJBDeployer.java:395)

      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:807)

      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:621)

      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:585)

      at java.lang.reflect.Method.invoke(Native Method)

      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)

      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)

      at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)

      at $Proxy4.deploy(Unknown Source)

      at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:435)

      at org.jboss.deployment.scanner.URLDeploymentScanner.scanDirectory(URLDeploymentScanner.java:656)

      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:507)

      at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:261)

      at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:165)

      at java.lang.reflect.Method.invoke(Native Method)

      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)

      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)

      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)

      at $Proxy0.start(Unknown Source)

      at org.jboss.system.ServiceController.start(ServiceController.java:398)

      at java.lang.reflect.Method.invoke(Native Method)

      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)

      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)

      at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)

      at $Proxy3.start(Unknown Source)

      at org.jboss.deployment.SARDeployer.start(SARDeployer.java:249)

      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:807)

      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:621)

      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:585)

      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:569)

      at java.lang.reflect.Method.invoke(Native Method)

      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.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:484)

      2003-03-05 14:24:16,000 INFO [org.jboss.ejb.EjbModule] Started

      2003-03-05 14:24:16,000 INFO [org.jboss.deployment.MainDeployer] Deployed package: file:/C:/Frameworks/JBoss/jboss-3.0.4_tomcat-4.1.12/server/default/deploy/ejb-test.jar

      2003-03-05 14:24:16,015 INFO [org.jboss.deployment.MainDeployer] Starting deployment of package: file:/C:/Frameworks/JBoss/jboss-3.0.4_tomcat-4.1.12/server/default/deploy/jmx-ejb-adaptor.jar

      2003-03-05 14:24:16,109 INFO [org.jboss.ejb.EjbModule] Creating

      2003-03-05 14:24:16,125 INFO [org.jboss.ejb.EjbModule] Deploying jmx/ejb/Adaptor

      2003-03-05 14:24:16,156 INFO [org.jboss.ejb.EjbModule] Created

      2003-03-05 14:24:16,156 INFO [org.jboss.ejb.EjbModule] Starting

      2003-03-05 14:24:16,203 INFO [org.jboss.ejb.EjbModule] Started

      2003-03-05 14:24:16,203 INFO [org.jboss.deployment.MainDeployer] Deployed package: file:/C:/Frameworks/JBoss/jboss-3.0.4_tomcat-4.1.12/server/default/deploy/jmx-ejb-adaptor.jar

      2003-03-05 14:24:16,203 INFO [org.jboss.deployment.MainDeployer] Starting deployment of package: file:/C:/Frameworks/JBoss/jboss-3.0.4_tomcat-4.1.12/server/default/deploy/jmx-console.war/

      2003-03-05 14:24:16,250 INFO [org.jboss.web.catalina.EmbeddedCatalinaService41] deploy, ctxPath=/jmx-console, warUrl=file:/C:/Frameworks/JBoss/jboss-3.0.4_tomcat-4.1.12/server/default/deploy/jmx-console.war/

      2003-03-05 14:24:16,265 INFO [org.jboss.web.localhost.Engine] WebappLoader[/jmx-console]: Deploying class repositories to work directory C:\Frameworks\JBoss\jboss-3.0.4_tomcat-4.1.12\tomcat-4.1.x\work\MainEngine\localhost\jmx-console

      2003-03-05 14:24:16,281 INFO [org.jboss.web.localhost.Engine] WebappLoader[/jmx-console]: Deploy class files /WEB-INF/classes to C:\Frameworks\JBoss\jboss-3.0.4_tomcat-4.1.12\server\default\deploy\jmx-console.war\WEB-INF\classes

      2003-03-05 14:24:16,421 INFO [org.jboss.web.localhost.Engine] ContextConfig[/jmx-console]: Added certificates -> request attribute Valve

      2003-03-05 14:24:16,593 INFO [org.jboss.web.catalina.EmbeddedCatalinaService41] Using Java2 parent classloader delegation: true

      2003-03-05 14:24:16,593 INFO [org.jboss.web.localhost.Engine] StandardManager[/jmx-console]: Seeding random number generator class java.security.SecureRandom

      2003-03-05 14:24:16,593 INFO [org.jboss.web.localhost.Engine] StandardManager[/jmx-console]: Seeding of random number generator has been completed

      2003-03-05 14:24:16,593 INFO [org.jboss.web.localhost.Engine] StandardWrapper[/jmx-console:default]: Loading container servlet default

      2003-03-05 14:24:16,593 INFO [org.jboss.web.localhost.Engine] StandardWrapper[/jmx-console:invoker]: Loading container servlet invoker

      2003-03-05 14:24:16,609 INFO [org.jboss.deployment.MainDeployer] Deployed package: file:/C:/Frameworks/JBoss/jboss-3.0.4_tomcat-4.1.12/server/default/deploy/jmx-console.war/

      2003-03-05 14:24:16,625 INFO [org.jboss.deployment.MainDeployer] Starting deployment of package: file:/C:/Frameworks/JBoss/jboss-3.0.4_tomcat-4.1.12/server/default/deploy/web-client.war

      2003-03-05 14:24:16,656 WARN [org.jboss.util.NestedThrowable] Duplicate throwable nesting of same base type: class org.jboss.deployment.DeploymentException is assignable from: class org.jboss.deployment.DeploymentException

      2003-03-05 14:24:16,671 INFO [org.jboss.web.catalina.EmbeddedCatalinaService41] deploy, ctxPath=/web-client, warUrl=file:/C:/Frameworks/JBoss/jboss-3.0.4_tomcat-4.1.12/server/default/tmp/deploy/server/default/deploy/web-client.war/94.web-client.war

      2003-03-05 14:24:16,687 INFO [org.jboss.web.localhost.Engine] WebappLoader[/web-client]: Deploying class repositories to work directory C:\Frameworks\JBoss\jboss-3.0.4_tomcat-4.1.12\tomcat-4.1.x\work\MainEngine\localhost\web-client

      2003-03-05 14:24:16,781 INFO [org.jboss.web.localhost.Engine] WebappLoader[/web-client]: Deploy class files /WEB-INF/classes to C:\Frameworks\JBoss\jboss-3.0.4_tomcat-4.1.12\tomcat-4.1.x\work\MainEngine\localhost\web-client\WEB-INF\classes

      2003-03-05 14:24:16,890 INFO [org.jboss.web.localhost.Engine] ContextConfig[/web-client]: Added certificates -> request attribute Valve

      2003-03-05 14:24:17,078 INFO [org.jboss.web.catalina.EmbeddedCatalinaService41] Using Java2 parent classloader delegation: true

      2003-03-05 14:24:17,078 INFO [org.jboss.web.localhost.Engine] StandardManager[/web-client]: Seeding random number generator class java.security.SecureRandom

      2003-03-05 14:24:17,078 INFO [org.jboss.web.localhost.Engine] StandardManager[/web-client]: Seeding of random number generator has been completed

      2003-03-05 14:24:17,093 INFO [org.jboss.web.localhost.Engine] StandardWrapper[/web-client:default]: Loading container servlet default

      2003-03-05 14:24:17,093 INFO [org.jboss.web.localhost.Engine] StandardWrapper[/web-client:invoker]: Loading container servlet invoker

      2003-03-05 14:24:17,109 INFO [org.jboss.deployment.MainDeployer] Deployed package: file:/C:/Frameworks/JBoss/jboss-3.0.4_tomcat-4.1.12/server/default/deploy/web-client.war

      2003-03-05 14:24:17,109 ERROR [org.jboss.deployment.scanner.URLDeploymentScanner] MBeanException: Exception in MBean operation '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/test/TWUserRoleHome,service=EJB
      state: FAILED
      I Depend On:
      Depends On Me: java.lang.NullPointerException]

      2003-03-05 14:24:17,140 INFO [org.jboss.deployment.scanner.URLDeploymentScanner] Started

      2003-03-05 14:24:17,140 INFO [org.jboss.deployment.MainDeployer] Deployed package: file:/C:/Frameworks/JBoss/jboss-3.0.4_tomcat-4.1.12/server/default/conf/jboss-service.xml

      2003-03-05 14:24:17,140 INFO [org.jboss.system.server.Server] JBoss (MX MicroKernel) [3.0.4 Date:200211021607] Started in 0m:13s:719ms

        • 1. Re: JBoss throws NullPointerException when deploying ejb
          Charles Newbie

          Greetings -

          I found the exact same exception in a posting to Datasource Configuration, but there were no replies. Posting dated from Sept. 22, '02. Hope someone in this group has an answer. Interestingly, the problem was with MySql, whereas I'm using DB2, although the exception is the same.

          Any suggestions?

          Thanks ...

          • 2. Re: JBoss throws NullPointerException when deploying ejb
            Raja Master

            Do you have a data-source configured in ur jbosscmp-jdbc.xml?
            I looked in the code based on ur stacktrace and this is where it breaks
            con = dataSource.getConnection();

            so it probably doesnt get the DataSource from ur Config file?

            Post the appropriate section of ur jbosscmp-jdbc.xml file.

            -Raj

            • 3. Re: JBoss throws NullPointerException when deploying ejb
              Charles Newbie

              Thanks - here's the info:

              Here's db2-service.xml, which I've placed in the deploy directory:

              java:/jdbc:/SAMPLE


              <config-property name="ConnectionURL" type="java.lang.String">jdbc:db2:SAMPLE</config-property>
              <config-property name="DriverClass" type="java.lang.String">COM.ibm.db2.jdbc.app.DB2Driver</config-property>

              And here's my entire jbosscmp-jdbc.xml file:

              <jbosscmp-jdbc>

              java:/jdbc:/SAMPLE
              <datasource-mapping>DB2</datasource-mapping>

              <enterprise-beans>

              <ejb-name>TWUserRole</ejb-name>
              <create-table>true</create-table>
              <remove-table>true</remove-table>
              <table-name>TWUSERROLE</table-name>
              <cmp-field>
              <field-name>id</field-name>
              <column-name>USERROLEID</column-name>
              </cmp-field>
              <cmp-field>
              <field-name>name</field-name>
              <column-name>NAME</column-name>
              </cmp-field>
              <cmp-field>
              <field-name>userId</field-name>
              <column-name>USER_USERID</column-name>
              </cmp-field>

              </enterprise-beans>
              <dependent-value-classes>
              </dependent-value-classes>
              </jbosscmp-jdbc>

              • 4. Re: JBoss throws NullPointerException when deploying ejb
                gernot Newbie

                Is this the whole db2-service file? There should be a lot more information. You can find service files in the jboss-3.0.4/docs/examples/jca dir. Just change the user, password and the database. You also have to copy the <application-policy> part to you login-config.xml file (server/default/conf dir). And dont't forget to copy the driver to your server/default/lib dir.

                c.u.
                gernot

                • 5. Re: JBoss throws NullPointerException when deploying ejb
                  Charles Newbie

                  Thanks for the responses on this. Problem is now solved - here's the info for the benefit of others with this problem.

                  First, the xml for db2-service.xml was an excerpt - I am using the entire file from the examples.

                  I made the following changes to my erroneous entries:

                  1. standardjbosscmp.xml
                  java:/DB2DS
                  <datasource-mapping>DB2</datasource-mapping>

                  2. db2-service.xml
                  DB2DS

                  3. .ant.properties
                  datasource.name=java:/DB2DS

                  Now I'm getting another problem related to a custom finder method, but I'll put up a new posting on that.

                  Cheers