[jboss-user] [Messaging, JMS & JBossMQ] - Exception in thread

GunterR do-not-reply at jboss.com
Thu Nov 29 11:11:13 EST 2007


Hello,

I am using JBoss4.0.3SP1 with Java 1.5.0.0.12 on a Windows 2003 Server. I have created a topic on the server where the clients can subscribe to via http.

I have adapted the jboss-service.xml in deploy/jms/jbossmq-httpil.sar/META-INF as follows:
<?xml version="1.0" encoding="UTF-8"?>
  | <!DOCTYPE server>
  | <server>
  |     <mbean code="org.jboss.mq.il.http.HTTPServerILService"
  | 	 name="jboss.mq:service=InvocationLayer,type=HTTP">
  |     <depends optional-attribute-name="Invoker">jboss.mq:service=Invoker</depends>
  |     <depends>jboss.web:service=WebServer</depends>
  |     <attribute name="ConnectionFactoryJNDIRef">HTTPConnectionFactory</attribute>
  |     <attribute name="XAConnectionFactoryJNDIRef">HTTPXAConnectionFactory</attribute>
  |     <attribute name="PingPeriod">10000</attribute>
  |     <attribute name="TimeOut">60</attribute>
  |     <attribute name="RestInterval">0</attribute>
  |   </mbean>
  | </server>

In order to detect if a client did not unsubscribe, I have added a ClientMonitorInterceptor in the deploy/jms/jbossmq-service.xml
<?xml version="1.0" encoding="UTF-8"?>
  | 
  | <!-- $Id: jbossmq-service.xml,v 1.24.2.1 2005/06/01 05:56:44 starksm Exp $ -->
  | 
  | <server>
  | 
  |   <!-- ==================================================================== -->
  |   <!-- JBossMQ                                                              -->
  |   <!-- ==================================================================== -->
  | 
  | 
  |   <!-- ==================================================================== -->
  |   <!-- JBossMQ Interceptor chain configuration                              -->
  |   <!-- ==================================================================== -->
  |   <!-- To tune performance, you can have the Invoker skip over the TracingInterceptor -->
  |   <!-- and/or the SecurityManager, but then you loose the ability to trace and/or enforce security. -->
  |   <mbean code="org.jboss.mq.server.jmx.Invoker" name="jboss.mq:service=Invoker">
  |     <depends optional-attribute-name="NextInterceptor">jboss.mq:service=TracingInterceptor</depends>
  |     <depends>jboss:service=Naming</depends>
  |   </mbean>
  | 
  |   <mbean code="org.jboss.mq.server.jmx.InterceptorLoader" name="jboss.mq:service=TracingInterceptor">
  |     <attribute name="InterceptorClass">org.jboss.mq.server.TracingInterceptor</attribute>
  |     <depends optional-attribute-name="NextInterceptor">jboss.mq:service=SecurityManager</depends>
  |   </mbean>
  | 
  |   <mbean code="org.jboss.mq.security.SecurityManager" name="jboss.mq:service=SecurityManager">
  |     <attribute name="DefaultSecurityConfig">
  |       <security>
  |         <role name="guest" read="true" write="true" create="true"/>
  |       </security>
  |     </attribute>
  |     <attribute name="SecurityDomain">java:/jaas/jbossmq</attribute>
  |     <depends optional-attribute-name="NextInterceptor">jboss.mq:service=ClientMonitorInterceptor</depends>
  |   </mbean>
  | 
  |   <!--
  |      | The ClientMonitorInterceptor disconnects clients that have been idle for to long.
  |      | This interceptor is not enabled by default since the server might disconnect clients
  |      | when the it is under high load.
  |    -->
  |  
  |   <mbean code="org.jboss.mq.server.jmx.ClientMonitorInterceptor" name="jboss.mq:service=ClientMonitorInterceptor">
  |     <attribute name="ClientTimeout">80000</attribute>
  |     <depends optional-attribute-name="NextInterceptor">jboss.mq:service=DestinationManager</depends>
  |   </mbean>
  |  
  |   <!--
  |     | The ClientReconnectInterceptor is used to allow a client to connect to the server even
  |     | if it's clientID is allready being used by another client.  This interceptor will disconnect
  |     | the previously connected client to allow the new connection to succeed.  This is not enabled
  |     | by default since the JMS spec states that the 2nd client connecting to the server with the same
  |     | id should get an exception.
  |    -->
  |   <!--
  |   <mbean code="org.jboss.mq.server.jmx.InterceptorLoader" name="jboss.mq:service=ClientReconnectInterceptor">
  |     <attribute name="InterceptorClass">org.jboss.mq.server.ClientReconnectInterceptor</attribute>
  |     <depends optional-attribute-name="NextInterceptor">jboss.mq:service=DestinationManager</depends>
  |   </mbean>
  |   -->
  |   <!-- ==================================================================== -->
  |   <!-- System Destinations                                                  -->
  |   <!-- ==================================================================== -->
  | 
  |   <!-- Dead Letter Queue -->
  |   <mbean code="org.jboss.mq.server.jmx.Queue"
  | 	 name="jboss.mq.destination:service=Queue,name=DLQ">
  |     <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
  |     <depends optional-attribute-name="SecurityManager">jboss.mq:service=SecurityManager</depends>
  |   </mbean>
  | 
  | </server>
  | 

I tested this succesfully on our developing machine. I let the client crash and after a few seconds, the server noticed this and removed the subscription from the nondurable subscriptions list.
I made the same configuration on the customer's site and it worked well for two days. After that, I found the following exception in our server logs:

  | 2007-11-28 11:23:31,718 INFO  STDOUT                   : Exception in thread "ClientMonitor Service Thread" 
  | 2007-11-28 11:23:31,718 INFO  STDOUT                   : java.lang.NullPointerException
  | 2007-11-28 11:23:31,718 INFO  STDOUT                   : 	at org.jboss.mq.server.ClientMonitorInterceptor.disconnectInactiveClients(ClientMonitorInterceptor.java:55)
  | 2007-11-28 11:23:31,718 INFO  STDOUT                   : 	at org.jboss.mq.server.jmx.ClientMonitorInterceptor$1.run(ClientMonitorInterceptor.java:64)
  | 2007-11-28 11:23:31,718 INFO  STDOUT                   : 	at java.lang.Thread.run(Thread.java:595)
  | 
  | After this, inactive subscriptions aren't detected anymore on the server.
  | 
  | I searched the forums, jira bug list, faqs, but couldn't find anything pointing to this particular problem.
  | 
  | thanks in advance for anyone who can answer my question.
  | Gunter

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4108959#4108959

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4108959



More information about the jboss-user mailing list