4 Replies Latest reply on Dec 16, 2004 9:48 PM by lee_yuki2000

    Return null pointer exception when i get connection from the

    lee_yuki2000 Newbie

      Hi,
      I am using jboss-3.2.3 and oracle 9 database. My problem is sometimes i get null pointer exception when i get connection from the pool even though i have set the maximum pool size to 100. I think it is sufficient enough to handle the connections because there only 10 users connecting to the database simultaneously. The oracle-ds.xml setting is as follows:


      <local-tx-datasource>
      <jndi-name>ora</jndi-name>
      <connection-url>jdbc:oracle:thin:@(DESCRIPTION=(FAILOVER=on)(LOAD_BALANCE=on)
      (ADDRESS=(PROTOCOL=TCP)(HOST=10.10.10.1)(PORT=1521))
      (ADDRESS=(PROTOCOL=TCP)(HOST=10.10.10.2)(PORT=1521))
      (CONNECT_DATA=(SERVICE_NAME=oradb)))
      </connection-url>
      <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
      <user-name>x</user-name>
      xx
      <min-pool-size>50</min-pool-size>
      <max-pool-size>100</max-pool-size>
      <blocking-timeout-millis>1800000</blocking-timeout-millis>
      <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
      </local-tx-datasource>


      i am setting the minimum pool to 50 which mean it will have minimum of 50 connections in the pool even though there isn't any connection being used? Am i right? Should i set the minimum pool to 0?

      I am not sure why i get null pointer exception when i try to get connection even though i have set
      <blocking-timeout-millis>1800000</blocking-timeout-millis> which it suppose to wait for 30 minutes if the connections are all used up. Anyone know why? Pls help. Thanks alot

      yuki

        • 1. Re: Return null pointer exception when i get connection from
          Adrian Brock Master

          Moderated: Can't help without a stacktrace

          • 2. Re: Return null pointer exception when i get connection from
            lee_yuki2000 Newbie

            Hi adrian,
            The stacktrace is as below:

            004-12-09 22:45:01,546 ERROR [org.jboss.ejb.plugins.LogInterceptor] RuntimeException:
            java.lang.NullPointerException
            at sqlj.runtime.profile.ref.ProfileImpl.getConnectedProfile(ProfileImpl.java:170)
            at sqlj.runtime.ref.ProfileGroup$ConnectedGroup.getProfile(ProfileGroup.java:194)
            at sqlj.runtime.ref.ConnectionContextImpl.getConnectedProfile(ConnectionContextImpl.java:351)
            at sqlj.runtime.ExecutionContext.registerStatement(ExecutionContext.java:598)
            at com.scan.prisma.cams.sqlj.filter.FilterDomain.add(FilterDomain.java:1324)
            at com.scan.prisma.cams.ejb.session.filter.FilterManagerBean.addFilter(FilterManagerBean.java:142)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:324)
            at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:683)
            at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:185)
            at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:84)
            at org.jboss.ejb.plugins.AbstractTxInterceptorBMT.invokeNext(AbstractTxInterceptorBMT.java:144)
            at org.jboss.ejb.plugins.TxInterceptorBMT.invoke(TxInterceptorBMT.java:62)
            at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:72)
            at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:118)
            at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
            at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
            at org.jboss.ejb.StatelessSessionContainer.internalInvoke(StatelessSessionContainer.java:331)
            at org.jboss.ejb.Container.invoke(Container.java:700)
            at sun.reflect.GeneratedMethodAccessor55.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:324)
            at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
            at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
            at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:101)
            at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:90)
            at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:46)
            at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:45)
            at org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:100)
            at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:85)
            at $Proxy93.addFilter(Unknown Source)
            at com.scan.prisma.cams.business_logic.Filter.execute(Filter.java:72)
            at com.scan.prisma.cams.presentation.struts.action.FilterAction.doAdd(FilterAction.java:286)
            at com.scan.prisma.cams.presentation.struts.action.FilterAction.execute(FilterAction.java:97)
            at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:480)
            at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
            at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1420)
            at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:520)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
            at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
            at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
            at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
            at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
            at org.jboss.web.tomcat.security.JBossSecurityMgrRealm.invoke(JBossSecurityMgrRealm.java:220)
            at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
            at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
            at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
            at org.jboss.web.tomcat.tc4.statistics.ContainerStatsValve.invoke(ContainerStatsValve.java:76)
            at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
            at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
            at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
            at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2417)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
            at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
            at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
            at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
            at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
            at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:65)
            at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
            at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:577)
            at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
            at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
            at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
            at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
            at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
            at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
            at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:197)
            at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:781)
            at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:549)
            at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:605)
            at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:677)
            at java.lang.Thread.run(Thread.java:534)

            Thanks alot

            yuki

            • 3. Re: Return null pointer exception when i get connection from
              Adrian Brock Master

              There is no JBoss code in play here.

              It is either your app (com.scan.prisma.) or the sqlj code.

              04-12-09 22:45:01,546 ERROR [org.jboss.ejb.plugins.LogInterceptor] RuntimeException:
              java.lang.NullPointerException
              at sqlj.runtime.profile.ref.ProfileImpl.getConnectedProfile(ProfileImpl.java:170)
              at sqlj.runtime.ref.ProfileGroup$ConnectedGroup.getProfile(ProfileGroup.java:194)
              at sqlj.runtime.ref.ConnectionContextImpl.getConnectedProfile(ConnectionContextImpl.java:351)
              at sqlj.runtime.ExecutionContext.registerStatement(ExecutionContext.java:598)
              at com.scan.prisma.cams.sqlj.filter.FilterDomain.add(FilterDomain.java:1324)
              at com.scan.prisma.cams.ejb.session.filter.FilterManagerBean.addFilter(FilterManagerBean.java:142)