3 Replies Latest reply on Mar 5, 2002 8:20 PM by davidjencks

    XAPoolDataSource NullPointerException

    pwinstonr

      Hi,
      I'm trying to move my application from Jboss2.4.3_Tomcat3.2.3 to Jboss2.4.4_Tomcat4.0.1. Everything seemed to be working, but in specific areas of my application I'm getting this exception.

      java.lang.NullPointerException
      at org.jboss.pool.jdbc.xa.XAPoolDataSource.getConnection(Unknown Source)
      at com.intelitix.db.DatabaseAccess.connect(DatabaseAccess.java:241)
      at com.intelitix.db.DatabaseAccess.doUpdateQuery(DatabaseAccess.java:285)
      at com.intelitix.db.T_entitybenlvl_join.insert(T_entitybenlvl_join.java:715)
      at com.intelitix.entity.EntityBenefitLevel.updateEntityBenefitLevel(EntityBenefitLevel.java:68)
      at com.intelitix.donate.DonationDirector.updateEntityBenefitLevel(DonationDirector.java:337)
      at org.apache.jsp.genprocess_0005fctl$jsp._jspService(genprocess_0005fctl$jsp.java:785)
      at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:202)
      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382)


      Below is my jboss.jcml config

      oracle.jdbc.driver.OracleDriver



      OracleDB
      org.jboss.pool.jdbc.xa.wrapper.XADataSourceImpl

      jdbc:oracle:thin:@MYIPADDRESS:1521:test
      1200000
      test
      10
      test
      false
      true
      false
      false
      120000
      1800000
      false
      true
      1.0
      0



      This is code I'm using to access the Connection Pool

      DataSource ds = (DataSource)ctx.lookup("java:/OracleDB");

      Connection _con = ds.getConnection();

      Everything seems to be working fine except in a couple of places in my application. Looks like it just does not get the correct ObjectPool or something. Can anybody point out any obvious steps I need to do, for this to work. As a further info, this NullPointerException happens to occur in couple of areas in my application where there are no EJB's involved. So, I'm assuming its not cause of any configuration issues. Can anybody throw some light into it.

      If I set the "Blocking" attribute to true then the application just hangs. Setting the "Blocking" attribute to false got me this NullPointerException. If you think I need to post more information to give any diagnosis, let me know.

      Please Help,
      Winston.

        • 1. Re: XAPoolDataSource NullPointerException
          aleb

          I think I have a similar problem. This is from the output of Jboss when it starts:


          [INFO,JdbcProvider] Starting
          [INFO,JdbcProvider] Started
          [INFO,myDS] Starting
          [INFO,myDS] XA Connection pool myDS bound to java:/myDS
          [ERROR,myDS] Stopped
          java.lang.NullPointerException
          at org.jboss.pool.jdbc.xa.XAPoolDataSource.getConnection(Unknown Source)
          at org.jboss.jdbc.XADataSourceLoader.startService(XADataSourceLoader.java:412)
          at org.jboss.util.ServiceMBeanSupport.start(ServiceMBeanSupport.java:103)
          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.configuration.ConfigurationService$ServiceProxy.invoke(ConfigurationService.java:967)
          at $Proxy0.start(Unknown Source)
          at org.jboss.util.ServiceControl.start(ServiceControl.java:79)
          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.Main.(Main.java:208)
          at org.jboss.Main$1.run(Main.java:110)
          at java.security.AccessController.doPrivileged(Native Method)
          at org.jboss.Main.main(Main.java:106)
          [ERROR,ConfigurationService] Unexpected error
          java.lang.NullPointerException
          at org.jboss.pool.jdbc.xa.XAPoolDataSource.getConnection(Unknown Source)
          at org.jboss.jdbc.XADataSourceLoader.startService(XADataSourceLoader.java:412)
          at org.jboss.util.ServiceMBeanSupport.start(ServiceMBeanSupport.java:103)
          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.configuration.ConfigurationService$ServiceProxy.invoke(ConfigurationService.java:967)
          at $Proxy0.start(Unknown Source)
          at org.jboss.util.ServiceControl.start(ServiceControl.java:79)
          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.Main.(Main.java:208)
          at org.jboss.Main$1.run(Main.java:110)
          at java.security.AccessController.doPrivileged(Native Method)
          at org.jboss.Main.main(Main.java:106)
          [INFO,ServerDataCollector] Starting
          [INFO,ServerDataCollector] JBoss Management Service 'servercollector' bound to servercollector
          [INFO,ServerDataCollector] Started


          I configured jboss.jcml for MySQL:

          61
          62 <!-- ==================================================================== -->
          63 <!-- JDBC -->
          64 <!-- ==================================================================== -->
          65
          66
          67
          68
          69 org.gjt.mm.mysql.Driver
          70
          71
          72
          73 org.jboss.pool.jdbc.xa.wrapper.XADataSourceImpl
          74 myDS
          75 jdbc:mysql://localhost/my
          76 my
          77 my
          78


          I suppose the problem is with Minerva.. but I'm not sure.

          • 2. Re: XAPoolDataSource NullPointerException
            aleb

            The same configuration works on another computer.. (although it gives a segmentation fault at Webservice-starting)

            It's a little bit strange. The MySQL server is configured to allow connections only from localhost, and org.jboss.pool.jdbc.xa.XAPoolDataSource.getConnection() doesn't throw NullPointerException at

            [INFO,myDS] Starting
            [INFO,mDS] XA Connection pool ctkDS bound to java:/ctkDS
            [ERROR,ctkDS] Stopped

            when Jboss runs on the second computer.. Instead it gives that error when it runs on the first computer (where the mysql server runs).

            Please help!

            Alex

            • 3. Re: XAPoolDataSource NullPointerException
              davidjencks

              I'm not really sure what is going on with the npe, I suspect bad db confib, I try to stay away from that code, but I am sure you want blocking = true. Probably also blocking timeout = 10000 or so also.