Results 1 to 2 of 2

Thread: can't create connection to JBoss MQ

  1. #1
    Join Date
    Dec 2007
    Location
    Boston, MA
    Posts
    34

    Unhappy can't create connection to JBoss MQ

    I'm using Spring Jms from Spring2.5.6, My JBoss server is 4.2.3
    Here's the configure file
    Code:
    <bean id="jndiTemplate" class="org.springframework.jndi.JndiTemplate">
    	<property name="environment">
    		<props>
    			<prop key="java.naming.factory.initial">
    				org.jnp.interfaces.NamingContextFactory
            </prop>
    			<prop key="java.naming.provider.url">
    				jnp://localhost:1099
            </prop>
    			<prop key="java.naming.factory.url.pkgs">
    				org.jboss.naming:org.jnp.interfaces
            </prop>
    		</props>
    	</property>
    </bean>
    
    <!-- spring JMS definition -->
    <bean name="jmsConnectionFactory" class="org.springframework.jndi.JndiObjectFactoryBean">
    	<property name="jndiTemplate" ref="jndiTemplate"/>
    	<property name="jndiName" value="ConnectionFactory" />
    </bean>
    
    <bean id="jmsTransactionManager" class="org.springframework.jms.connection.JmsTransactionManager">
    	<property name="connectionFactory" ref="jmsConnectionFactory" />
    </bean>
    
    <!-- jms destination already defined in jboss -->
    <bean name="testDestination" class="org.springframework.jndi.JndiObjectFactoryBean">
    	<property name="jndiTemplate" ref="jndiTemplate"/>
    	<property name="jndiName" value="queue/testQueue" />
    </bean>
    
    <!-- jmsTemplate for client -->
    <bean name="jmsTemplate" class="org.springframework.jms.core.JmsTemplate">
    	<property name="connectionFactory" ref="jmsConnectionFactory" />
    	<property name="defaultDestination" ref="testDestination" />
    	<property name="receiveTimeout" value="1" />
    	<property name="messageConverter" ref="auditingMsgConverter" />
    </bean>
    My testing code failed on jmsTemplate.convertAndSend, the reason is can't open connection:
    java.lang.AbstractMethodError: org.jboss.mq.SpyConnectionFactory.createConnection ()Ljavax/jms/Connection;
    at org.springframework.jms.support.JmsAccessor.create Connection(JmsAccessor.java:184)
    at org.springframework.jms.core.JmsTemplate.execute(J msTemplate.java:461)
    at org.springframework.jms.core.JmsTemplate.send(JmsT emplate.java:539)
    at org.springframework.jms.core.JmsTemplate.convertAn dSend(JmsTemplate.java:617)
    ....
    The same JNDI context configuration worked when using Java JMS codes. Therefore I know JBoss is running well.

    Any suggestion? Thx

  2. #2
    Join Date
    Dec 2007
    Location
    Boston, MA
    Posts
    34

    Red face

    the reason is I used the old version of spring name space in my config file.
    change the xsd to ***-2.5.xsd solve the problem

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •