1 Reply Latest reply on Nov 12, 2012 11:37 AM by nigel-robbins

    java.lang.NullPointerException with factory.createQueueConnection

    nigel-robbins

      Hi,

       

      Our system works fine but after a period of time (e.g. a few days) we are getting a java.lang.NullPointerException on calling factory.createQueueConnection.

       

      Here is an extract of the code:

      Hashtable<String,String> env = new Hashtable<String,String>();

      env.put("java.naming.factory.initial","org.jnp.interfaces.NamingContextFactory");

      env.put("java.naming.factory.url.pkgs","org.jboss.naming:org.jnp.interfaces");

      env.put("java.naming.provider.url",aHost+":1099");

      InitialContext ctx = new InitialContext(env);

      QueueConnectionFactory factory = (QueueConnectionFactory) ctx.lookup("ConnectionFactory");

      connection = factory.createQueueConnection();

       

      The stack trace is at the bottom.

       

      One thing we've noticed in wrapper.log on the server we are sending the message to, around the same time of the NullPointerException, the following is logged:

      INFO   | wrapper  | 2012/11/08 13:10:54 | User logged out.  Ignored.

      STATUS | wrapper  | 2012/11/08 13:10:55 | Machine is shutting down.

      INFO   | jvm 1    | 2012/11/08 13:10:57 | 13:10:57,416 INFO  [ServerImpl] Runtime shutdown hook called, forceHalt: true

      INFO   | jvm 1    | 2012/11/08 13:10:57 | 13:10:57,447 INFO  [ConnectionFactory] org.jboss.jms.server.connectionfactory.ConnectionFactory@109eb46 undeployed

      INFO   | jvm 1    | 2012/11/08 13:10:57 | 13:10:57,447 INFO  [ConnectionFactory] org.jboss.jms.server.connectionfactory.ConnectionFactory@1807b9a undeployed

      INFO   | jvm 1    | 2012/11/08 13:10:57 | 13:10:57,447 INFO  [ConnectionFactory] org.jboss.jms.server.connectionfactory.ConnectionFactory@3bbf83 undeployed

      INFO   | jvm 1    | 2012/11/08 13:10:57 | 13:10:57,447 INFO  [TomcatDeployment] undeploy, ctxPath=/web-console

      INFO   | jvm 1    | 2012/11/08 13:10:57 | 13:10:57,729 INFO  [QueueService] Queue[queue/POCQueue] stopped

      INFO   | jvm 1    | 2012/11/08 13:10:57 | 13:10:57,729 INFO  [QueueService] Queue[queue/EARQueue] stopped

      INFO   | jvm 1    | 2012/11/08 13:10:57 | 13:10:57,729 INFO  [QueueService] Queue[/queue/ExpiryQueue] stopped

      INFO   | jvm 1    | 2012/11/08 13:10:57 | 13:10:57,729 INFO  [QueueService] Queue[/queue/DLQ] stopped

      INFO   | jvm 1    | 2012/11/08 13:10:58 | 13:10:57,979 INFO  [EJBContainer] STOPPED EJB: com.wallstreetsystems.MSG_Server.TESTMessaging ejbName: TESTMessaging

      INFO   | jvm 1    | 2012/11/08 13:10:58 | 13:10:58,025 INFO  [ConnectionFactoryBindingService] Unbound ConnectionManager 'jboss.jca:service=ConnectionFactoryBinding,name=JmsXA' from JNDI name 'java:JmsXA'

      INFO   | jvm 1    | 2012/11/08 13:10:58 | 13:10:58,166 INFO  [ServerPeer] JMS ServerPeer[0] stopped

      INFO   | jvm 1    | 2012/11/08 13:10:58 | 13:10:58,182 INFO  [TomcatDeployment] undeploy, ctxPath=/invoker

      INFO   | jvm 1    | 2012/11/08 13:10:58 | 13:10:58,604 INFO  [TomcatDeployment] undeploy, ctxPath=/jbossws

      INFO   | jvm 1    | 2012/11/08 13:10:58 | 13:10:58,604 INFO  [TomcatDeployment] undeploy, ctxPath=/

      INFO   | jvm 1    | 2012/11/08 13:10:58 | 13:10:58,604 INFO  [TomcatDeployment] undeploy, ctxPath=/jmx-console

      INFO   | jvm 1    | 2012/11/08 13:10:58 | 13:10:58,604 INFO  [TomcatDeployment] undeploy, ctxPath=/guiBuilder

      INFO   | jvm 1    | 2012/11/08 13:10:58 | 13:10:58,619 INFO  [StandardService] Stopping service jboss.web

      INFO   | jvm 1    | 2012/11/08 13:10:58 | 13:10:58,619 INFO  [Http11Protocol] Stopping Coyote HTTP/1.1 on http-0.0.0.0-8080

      INFO   | jvm 1    | 2012/11/08 13:10:58 | 13:10:58,854 INFO  [MailService] Mail service 'java:/Mail' removed from JNDI

      INFO   | jvm 1    | 2012/11/08 13:10:59 | 13:10:59,010 INFO  [ConnectionFactoryBindingService] Unbound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=DefaultDS' from JNDI name 'java:DefaultDS'

      STATUS | wrapper  | 2012/11/08 13:11:33 | --> Wrapper Started as Service

      WARN   | wrapper  | 2012/11/08 13:11:36 | ------------------------------------------------------------------------

      WARN   | wrapper  | 2012/11/08 13:11:36 | The JVM is being launched with a debugger enabled and could possibly be

      WARN   | wrapper  | 2012/11/08 13:11:36 | suspended.  To avoid unwanted shutdowns, timeouts will be disabled,

      WARN   | wrapper  | 2012/11/08 13:11:36 | removing the ability to detect and restart frozen JVMs.

      WARN   | wrapper  | 2012/11/08 13:11:36 | ------------------------------------------------------------------------

      STATUS | wrapper  | 2012/11/08 13:11:36 | Launching a JVM...

       

      Any thoughts on why it's crashing on calling factory.createQueueConnection and why the JVM is restarting on the remote host ?

       

      Note that both systems are on Windows and have the following setting in service.bat:

      set JAVA_OPTS=-Xrs

       

      Thanks !

       

      Stack trace:

       

      2012-11-08 09:25:53,252 ERROR [STDERR] (http-0.0.0.0-18080-9)                at org.jboss.remoting.Client.addConnectionListener(Client.java:465)

      2012-11-08 09:25:53,252 ERROR [STDERR] (http-0.0.0.0-18080-9)                at org.jboss.jms.client.remoting.JMSRemotingConnection.addConnectionListener(JMSRemotingConnection.java:502)

      2012-11-08 09:25:53,252 ERROR [STDERR] (http-0.0.0.0-18080-9)                at org.jboss.jms.client.container.StateCreationAspect.handleCreateConnectionDelegate(StateCreationAspect.java:101)

      2012-11-08 09:25:53,252 ERROR [STDERR] (http-0.0.0.0-18080-9)                at org.jboss.aop.advice.org.jboss.jms.client.container.StateCreationAspect_z_handleCreateConnectionDelegate_12944434.invoke(StateCreationAspect_z_handleCreateConnectionDelegate_12944434.java)

      2012-11-08 09:25:53,268 ERROR [STDERR] (http-0.0.0.0-18080-9)                at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

      2012-11-08 09:25:53,268 ERROR [STDERR] (http-0.0.0.0-18080-9)                at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate.createConnectionDelegate(ClientConnectionFactoryDelegate.java)

      2012-11-08 09:25:53,268 ERROR [STDERR] (http-0.0.0.0-18080-9)                at org.jboss.jms.client.JBossConnectionFactory.createConnectionInternal(JBossConnectionFactory.java:205)

      2012-11-08 09:25:53,268 ERROR [STDERR] (http-0.0.0.0-18080-9)                at org.jboss.jms.client.JBossConnectionFactory.createQueueConnection(JBossConnectionFactory.java:101)

      2012-11-08 09:25:53,268 ERROR [STDERR] (http-0.0.0.0-18080-9)                at org.jboss.jms.client.JBossConnectionFactory.createQueueConnection(JBossConnectionFactory.java:95)

      2012-11-08 09:25:53,268 ERROR [STDERR] (http-0.0.0.0-18080-9)                at com.wss.turnover.JTSProcessRecord.sendGUIMessages(Unknown Source)

      2012-11-08 09:25:53,268 ERROR [STDERR] (http-0.0.0.0-18080-9)                at org.apache.jsp.jsp.JTSTurnoverProcess_jsp._jspService(JTSTurnoverProcess_jsp.java:286)

      2012-11-08 09:25:53,268 ERROR [STDERR] (http-0.0.0.0-18080-9)                at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)

      2012-11-08 09:25:53,268 ERROR [STDERR] (http-0.0.0.0-18080-9)                at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

      2012-11-08 09:25:53,284 ERROR [STDERR] (http-0.0.0.0-18080-9)                at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369)

      2012-11-08 09:25:53,284 ERROR [STDERR] (http-0.0.0.0-18080-9)                at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:322)

      2012-11-08 09:25:53,284 ERROR [STDERR] (http-0.0.0.0-18080-9)                at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:249)

      2012-11-08 09:25:53,284 ERROR [STDERR] (http-0.0.0.0-18080-9)                at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

      2012-11-08 09:25:53,284 ERROR [STDERR] (http-0.0.0.0-18080-9)                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

      2012-11-08 09:25:53,284 ERROR [STDERR] (http-0.0.0.0-18080-9)                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

      2012-11-08 09:25:53,284 ERROR [STDERR] (http-0.0.0.0-18080-9)                at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

      2012-11-08 09:25:53,284 ERROR [STDERR] (http-0.0.0.0-18080-9)                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

      2012-11-08 09:25:53,284 ERROR [STDERR] (http-0.0.0.0-18080-9)                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

      2012-11-08 09:25:53,284 ERROR [STDERR] (http-0.0.0.0-18080-9)                at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)

      2012-11-08 09:25:53,299 ERROR [STDERR] (http-0.0.0.0-18080-9)                at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)

      2012-11-08 09:25:53,299 ERROR [STDERR] (http-0.0.0.0-18080-9)                at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:183)

      2012-11-08 09:25:53,299 ERROR [STDERR] (http-0.0.0.0-18080-9)                at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:95)

      2012-11-08 09:25:53,299 ERROR [STDERR] (http-0.0.0.0-18080-9)                at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)

      2012-11-08 09:25:53,299 ERROR [STDERR] (http-0.0.0.0-18080-9)                at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)

      2012-11-08 09:25:53,299 ERROR [STDERR] (http-0.0.0.0-18080-9)                at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)

      2012-11-08 09:25:53,299 ERROR [STDERR] (http-0.0.0.0-18080-9)                at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

      2012-11-08 09:25:53,299 ERROR [STDERR] (http-0.0.0.0-18080-9)                at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)

      2012-11-08 09:25:53,299 ERROR [STDERR] (http-0.0.0.0-18080-9)                at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

      2012-11-08 09:25:53,299 ERROR [STDERR] (http-0.0.0.0-18080-9)                at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)

      2012-11-08 09:25:53,299 ERROR [STDERR] (http-0.0.0.0-18080-9)                at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)

      2012-11-08 09:25:53,299 ERROR [STDERR] (http-0.0.0.0-18080-9)                at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)

      2012-11-08 09:25:53,315 ERROR [STDERR] (http-0.0.0.0-18080-9)                at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)

      2012-11-08 09:25:53,315 ERROR [STDERR] (http-0.0.0.0-18080-9)                at java.lang.Thread.run(Thread.java:619)