I'm new to Spring JMS and i m using it for a IBM MQ. I was given a jndi object of TopicConnectionFactory and follow the example from ibm-developworkers to config like this:
after configed, in my JMSReceiver, i use JMSTemplate in this way:HTML Code:<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE beans PUBLIC "-//Spring//DTD Bean//EN" "http://www.springframework.org/dtd/spring-beans.dtd"> <!-- Application Context --> <beans> <!-- JNDI Environment Template --> <bean id="jndiTemplate" class="org.springframework.jndi.JndiTemplate"> <property name="environment"> <props> <prop key="java.naming.factory.initial"> com.ibm.mq.jms.context.WMQInitialContextFactory </prop> <prop key="java.naming.provider.url"> 192.168.1.21:9827/SYSTEM.DEF.SVRCONN </prop> <prop key="java.naming.security.authentication"> simple </prop> <prop key="java.naming.security.principal"> cn=xx,ou=users,ou=handler,dc=eca,dc=com </prop> <prop key="java.naming.security.credentials"> hallo </prop> <prop key="java.naming.referral">throw</prop> </props> </property> </bean> <!-- JMS Queue Connection Factory --> <bean id="internalJmsQueueConnectionFactory" class="org.springframework.jndi.JndiObjectFactoryBean"> <property name="jndiTemplate"> <ref bean="jndiTemplate" /> </property> <property name="jndiName"> <value>TCF.COMMON</value> </property> </bean> <!-- Spring JMS Queue Connection Factory --> <bean id="jmsQueueConnectionFactory" class="org.springframework.jms.connection.SingleConnectionFactory"> <property name="targetConnectionFactory"> <ref bean="internalJmsQueueConnectionFactory" /> </property> </bean> <!-- JMS Destination Resolver --> <bean id="jmsDestinationResolver" class="org.springframework.jms.support.destination.JndiDestinationResolver"> <property name="jndiTemplate"> <ref bean="jndiTemplate" /> </property> <property name="cache"> <value>true</value> </property> </bean> <!-- JMS Queue Template --> <bean id="jmsQueueTemplate" class="org.springframework.jms.core.JmsTemplate"> <property name="connectionFactory"> <ref bean="internalJmsQueueConnectionFactory" /> </property> <!-- for topic is true --> <property name="pubSubDomain"> <value>true</value> </property> <property name="destinationResolver"> <ref bean="jmsDestinationResolver" /> </property> <property name="defaultDestinationName" value="topic_core" /> <property name="receiveTimeout"> <value>20000</value> </property> </bean> <bean id="jmsSender" class="JMSSender"> <property name="jmsTemplate"> <ref bean="jmsQueueTemplate" /> </property> </bean> <bean id="jmsReceiver" class="JMSReceiver"> <property name="jmsTemplate"> <ref bean="jmsQueueTemplate" /> </property> </bean> </beans>
and it throws a Error:HTML Code:public void sendMessage(final String text){ jmsTemplate.send(new MessageCreator(){ public Message createMessage(Session session) throws JMSException { return session.createTextMessage(text); }}); }
java.lang.AbstractMethodError: com.ibm.mq.jms.MQTopicConnectionFactory.createConn ection()Ljavax/jms/Connection;
i dont know if the AbstractMethodError is the default behavior of TopicConnectionFactory,or just for MQTopicConnectionFactory?
And could someone give me some advise of how to config a TopicConnectionFactory by Spring JMS? Thanks so much~![]()


Reply With Quote
it doesnt effect....... i use the jms.jar from spring 2.0 m1,it should be a 