2 Replies Latest reply on Jun 26, 2012 8:32 AM by Carsten Maneg

    JBoss 7.1.1 - NullPointer in JDBCEJBQLCompiler.visit(...)

    Carsten Maneg Newbie

      Hello all,

       

      we get a NPE when deploying an ear (EJB 2.x, etc).

      NPE ist caused by

      org.jboss.as.cmp.jdbc.JDBCEJBQLCompiler.visit(JDBCEJBQLCompiler.java:588)

       

      The error message completely:

      10:23:22,312 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-7) MSC00001: Failed to start service jboss.deployment.subunit."MyCMP.ear"."my-persistence-4.3.0-SNAPSHOT.

      jar".component.Auftrag.jdbc.store-manager.START: org.jboss.msc.service.StartException in service jboss.deployment.subunit."MyCMP.ear"."my-persistence-4.3.0-SNAPSHOT.jar".c

      omponent.Auftrag.jdbc.store-manager.START: JBAS010785: Failed start store manager

              at org.jboss.as.cmp.jdbc.JdbcStoreManagerStartService.start(JdbcStoreManagerStartService.java:46)

              at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

              at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

              at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_31]

              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_31]

              at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_31]

      Caused by: java.lang.RuntimeException: JBAS018810: Error compiling EJB-QL statement for EJB 'Auftrag': select object(o) from Auftrag as o where o.aufid = ?1

              at org.jboss.as.cmp.jdbc.JDBCEJBQLQuery.<init>(JDBCEJBQLQuery.java:58)

              at org.jboss.as.cmp.jdbc.JDBCCommandFactory.createEJBQLQuery(JDBCCommandFactory.java:63)

              at org.jboss.as.cmp.jdbc.JDBCQueryManager.start(JDBCQueryManager.java:223)

              at org.jboss.as.cmp.jdbc.JDBCStoreManager.startStoreManager(JDBCStoreManager.java:239)

              at org.jboss.as.cmp.jdbc.JdbcStoreManagerStartService.start(JdbcStoreManagerStartService.java:44)

              ... 5 more

      Caused by: java.lang.NullPointerException

              at org.jboss.as.cmp.jdbc.JDBCEJBQLCompiler.visit(JDBCEJBQLCompiler.java:588)

              at org.jboss.as.cmp.ejbql.ASTEJBQL.jjtAccept(ASTEJBQL.java:39)

              at org.jboss.as.cmp.jdbc.JDBCEJBQLCompiler.compileEJBQL(JDBCEJBQLCompiler.java:167)

              at org.jboss.as.cmp.jdbc.JDBCEJBQLQuery.<init>(JDBCEJBQLQuery.java:52)

              ... 9 more

       

       

       

      Snip of source (last row is 588):

              StringBuffer buf = (StringBuffer) data;

              if (selectManager.getMetaData().hasRowLocking()) {

                  JDBCFunctionMappingMetaData rowLockingTemplate = typeMapping.getRowLockingTemplate();

                  Object[] args = new Object[]{

                          select,

                          from,

                          where.length() == 0 ? null : where,

                          orderBy.length() == 0 ? null : orderBy

                  };

                  rowLockingTemplate.getFunctionSql(args, buf);

       

      Happens when <row-locking> is set to true in jbosscmp-jdbc.xml.

       

      <entity>

      <ejb-name>Auftrag</ejb-name>

           <datasource>java:/MyDatasourceName</datasource>

           <datasource-mapping>DB2</datasource-mapping>

           <create-table>false</create-table>

           <row-locking>true</row-locking>

           <table-name>auftrag1822</table-name>

      ....

       

      Is there any additional configuration necessary for row-locking?

      Well, analyzing a bit more, seems we dont need row-locking in this case.

      But anyway, this shouldn't cause an NPE right?

       

      Cheers

      Carsten