<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">
<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>
                                <td>
                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="https://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>
                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px; -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
java.lang.NullPointerException with factory.createQueueConnection
</h3>
<span style="margin-bottom: 10px;">
created by <a href="https://community.jboss.org/people/nigel-robbins">Nigel Robbins</a> in <i>JBoss Messaging</i> - <a href="https://community.jboss.org/message/775766#775766">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">
<div class="jive-rendered-content"><p>Hi,</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>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.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Here is an extract of the code:</p><p>Hashtable<String,String> env = new Hashtable<String,String>();</p><p>env.put("java.naming.factory.initial","org.jnp.interfaces.NamingContextFactory");</p><p>env.put("java.naming.factory.url.pkgs","org.jboss.naming:org.jnp.interfaces");</p><p>env.put("java.naming.provider.url",aHost+":1099");</p><p>InitialContext ctx = new InitialContext(env);</p><p>QueueConnectionFactory factory = (QueueConnectionFactory) ctx.lookup("ConnectionFactory");</p><p>connection = factory.createQueueConnection();</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>The stack trace is at the bottom.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>One thing we've noticed is that in wrapper.log on the server we are sending the message to, around the same time of the NullPointerException, the following is logged:</p><p>WARN   | wrapper  | 2012/11/01 10:01:34 | ------------------------------------------------------------------------</p><p>WARN   | wrapper  | 2012/11/01 10:01:34 | Shutdown: Timed out waiting for the JVM to terminate.</p><p>WARN   | wrapper  | 2012/11/01 10:01:34 | The JVM was launched with debug options so this may be because the JVM</p><p>WARN   | wrapper  | 2012/11/01 10:01:34 | is currently suspended by a debugger.  Any future timeouts during this</p><p>WARN   | wrapper  | 2012/11/01 10:01:34 | JVM invocation will be silently ignored.</p><p>WARN   | wrapper  | 2012/11/01 10:01:34 | ------------------------------------------------------------------------</p><p>INFO   | wrapper  | 2012/11/01 10:08:43 | User logged out.  Ignored.</p><p>STATUS | wrapper  | 2012/11/01 10:08:45 | Machine is shutting down.</p><p>STATUS | wrapper  | 2012/11/01 10:09:24 | --> Wrapper Started as Service</p><p>WARN   | wrapper  | 2012/11/01 10:09:25 | ------------------------------------------------------------------------</p><p>WARN   | wrapper  | 2012/11/01 10:09:25 | The JVM is being launched with a debugger enabled and could possibly be</p><p>WARN   | wrapper  | 2012/11/01 10:09:25 | suspended.  To avoid unwanted shutdowns, timeouts will be disabled,</p><p>WARN   | wrapper  | 2012/11/01 10:09:25 | removing the ability to detect and restart frozen JVMs.</p><p>WARN   | wrapper  | 2012/11/01 10:09:25 | ------------------------------------------------------------------------</p><p>STATUS | wrapper  | 2012/11/01 10:09:25 | Launching a JVM...</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Any thoughts on why it's crashing on calling factory.createQueueConnection and why the JVM is restarting on the remote host ?</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Note that both systems are on Windows and have the following setting in service.bat:</p><p>set JAVA_OPTS=-Xrs</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Thanks !</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Stack trace:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>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)</p><p>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)</p><p>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)</p><p>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)</p><p>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)</p><p>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)</p><p>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)</p><p>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)</p><p>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)</p><p>2012-11-08 09:25:53,268 ERROR [STDERR] (http-0.0.0.0-18080-9)                at com.wss.turnover.JTSProcessRecord.sendGUIMessages(Unknown Source)</p><p>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)</p><p>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)</p><p>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)</p><p>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)</p><p>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)</p><p>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)</p><p>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)</p><p>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)</p><p>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)</p><p>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)</p><p>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)</p><p>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)</p><p>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)</p><p>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)</p><p>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)</p><p>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)</p><p>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)</p><p>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)</p><p>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)</p><p>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)</p><p>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)</p><p>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)</p><p>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)</p><p>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)</p><p>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)</p><p>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)</p><p>2012-11-08 09:25:53,315 ERROR [STDERR] (http-0.0.0.0-18080-9)                at java.lang.Thread.run(Thread.java:619)</p></div>
<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
<p style="margin: 0;">Reply to this message by <a href="https://community.jboss.org/message/775766#775766">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in JBoss Messaging at <a href="https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2042">Community</a></p>
</div></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>