Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    javax.jms.IllegalStateException when trying to connect to jms with jboss

    Hi

    I'm using SmartClient 6.0 with the messaging module. When trying to connect to a topic deployed within the same jboss (4.2.1.GA) instance I get a IllegalStateException. Can you help me?

    Thanks
    Bruno

    Exception:
    Code:
    2007-12-13 14:10:02,948 INFO  [STDOUT] === 2007-12-13 14:10:02,948 [81-1] DEBUG JNDI - No configuration for JNDI context _container_ - assuming default initialContext
    2007-12-13 14:10:02,948 INFO  [STDOUT] === 2007-12-13 14:10:02,948 [81-1] DEBUG JNDI - Detected container context, using new InitialContext(env) lookup method
    2007-12-13 14:10:02,979 INFO  [STDOUT] === 2007-12-13 14:10:02,979 [81-1] ERROR MessagingServlet - MessagingServlet top-level exception
    javax.jms.IllegalStateException: This method is not applicable inside the application server. See the J2EE spec, e.g. J2EE1.4 Section 6.6
    	at org.jboss.resource.adapter.jms.JmsSessionFactoryImpl.setExceptionListener(JmsSessionFactoryImpl.java:223)
    	at com.isomorphic.messaging.JMSMessageDispatcher.reconnect(JMSMessageDispatcher.java:83)
    	at com.isomorphic.messaging.JMSMessageDispatcher.ensureConnected(JMSMessageDispatcher.java:94)
    	at com.isomorphic.messaging.JMSMessageDispatcher.subscribe(JMSMessageDispatcher.java:123)
    	at com.isomorphic.messaging.ISCMessageDispatcher.subscribe(ISCMessageDispatcher.java:149)
    	at com.isomorphic.messaging.MessagingConnectionHandler.registerSubscriber(MessagingConnectionHandler.java:247)
    	at com.isomorphic.messaging.MessagingConnectionHandler.process(MessagingConnectionHandler.java:112)
    	at com.isomorphic.messaging.MessagingServlet.doPost(MessagingServlet.java:63)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
    Configuration:
    Code:
    ---- javascript
    isc.Messaging.subscribe("LifestockMaintenanceNews", 
       function() {
          isc.say(data);
       }
    );
    ---- web.xml
    	<resource-ref>
    		<res-ref-name>jms/LifestockMaintenanceNews</res-ref-name>
    		<res-type>javax.jms.Destination</res-type>
    		<res-auth>Container</res-auth>
    	</resource-ref>
    	<resource-ref>
    		<res-ref-name>jms/ConnectionFactory</res-ref-name>
    		<res-type>javax.jms.ConnectionFactory</res-type>
    		<res-auth>Container</res-auth>
    		<res-sharing-scope>Shareable</res-sharing-scope>
    	</resource-ref>
    
    ---- jboss-web.xml
    	<resource-ref>
    		<res-ref-name>jms/LifestockMaintenanceNews</res-ref-name>
    		<jndi-name>topic/LifestockMaintenanceNews</jndi-name>
    	</resource-ref>
    	<resource-ref>
    		<res-ref-name>jms/ConnectionFactory</res-ref-name>
    		<res-type>javax.jms.ConnectionFactory</res-type>
    		<jndi-name>java:/JmsXA</jndi-name>
    	</resource-ref>
    
    --- server.properties
    # how often do we send keepalives to the client (ms)
    messaging.keepaliveInterval: 3000
    # how long the client waits after the keepaliveInterval before re-establishing
    # the connection (ms)
    messaging.keepaliveReestablishDelay: 1000
    # how long the client waits for the connect handshake to complete before
    # retrying
    messaging.connectTimeout: 4000
    # connection time to live - the maximum amount of time a persistent connection
    # is allowed to stay open before being re-established (ms)
    messaging.connectionTTL: 120000
    # total response size to pad out to in order to defeat intervening
    # bufferring by proxies (bytes)
    messaging.flushBufferSize: 8096
    # dispatcher to use for user registration/message queueing
    # com.isomorphic.messaging.LocalMessageDispatcher for simple one-jvm messaging
    # com.isomorphic.messaging.JMSMessageDispatcher for JMS-backed messaging
    messaging.dispatcherImplementer: com.isomorphic.messaging.JMSMessageDispatcher
    # jms configuration - for JMSMessageDispatcher only
    messaging.jms.context: _container_
    messaging.jms.jndiPrefix: jms
    messaging.jms.topicConnectionFactory: ConnectionFactory
    
    ---- service
    	<mbean code="org.jboss.mq.server.jmx.Topic" name="jboss.mq.destination:service=Topic,name=LifestockMaintenanceNews">
    		<depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
    		<attribute name="RedeliveryLimit">3</attribute>
    		<attribute name="RedeliveryDelay">2000</attribute>
    	</mbean>

    #2
    workaround?

    Hi

    I found that with the following configuration the J2EE spec violation is not complained. But I'm not sure if this is a good solution for a production environment.

    Regards, Bruno

    Code:
    jndi.messaging.java.naming.factory.initial: org.jnp.interfaces.NamingContextFactory
    jndi.messaging.java.naming.provider.url: jnp://localhost:1199/
    messaging.jms.context: messaging
    messaging.jms.jndiPrefix: 
    messaging.jms.topicConnectionFactory: ConnectionFactory

    Comment


      #3
      Hi brunostuder - this is a bug and has been fixed in our development code. It'll be in the next release of SmartClient (early next year). Thanks for the report and sorry about the trouble.

      Comment

      Working...
      X