PDA

View Full Version : Spring and OpenJMS?



micahcraig
Aug 23rd, 2004, 06:49 PM
I'm having no luck getting Spring talking to OpenJMS. I copied the simpleSend() method from the Spring documentation, got my ConnectionFactory and Queue from OpenJMS as described in their docs, but when I run, I get a NoSuchMethodError, thus:


java.lang.NoSuchMethodError: javax.jms.MessageProducer.send(Ljavax/jms/Message;IIJ)V
at org.springframework.jms.core.JmsTemplate102.doSend (JmsTemplate102.java:175)
at org.springframework.jms.core.JmsTemplate.doSend(Jm sTemplate.java:562)
at org.springframework.jms.core.JmsTemplate$2.doInJms (JmsTemplate.java:539)
at org.springframework.jms.core.JmsTemplate.execute(J msTemplate.java:504)
at org.springframework.jms.core.JmsTemplate.execute(J msTemplate.java:516)
at org.springframework.jms.core.JmsTemplate.send(JmsT emplate.java:537)
at com.myemployer.common.messaging.jms.spring.SpringJ MSChannel.sendMsg(SpringJMSChannel.java:48)
at com.myemployer.common.messaging.jms.spring.BasicTe stCase.testSimpleQueueSend(BasicTestCase.java:116)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at junit.framework.TestCase.runTest(TestCase.java:154 )
at junit.framework.TestCase.runBare(TestCase.java:127 )
at junit.framework.TestResult$1.protect(TestResult.ja va:106)
at junit.framework.TestResult.runProtected(TestResult .java:124)
at junit.framework.TestResult.run(TestResult.java:109 )
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:2 08)
at junit.framework.TestSuite.run(TestSuite.java:203)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRu nner.runTests(RemoteTestRunner.java:421)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRu nner.run(RemoteTestRunner.java:305)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRu nner.main(RemoteTestRunner.java:186)

My debugger tells me that the MessageProducer that send() is being called on is an org.exolab.jms.client.JmsQueueSender, which, according the Javadoc, should support send(). Do I need to do something with my ConnectionFactory or my Queue after I get them from my Context? Is there something else I'm missing, or some more complete sample code I could cheat from? Thanks,

-micah

Juergen Hoeller
Aug 24th, 2004, 12:42 AM
I assume you're working with Spring 1.1 RC1: JmsTemplate102 had a bug there, in that it just worked properly with a JMS 1.1 API jar on the classpath. Spring 1.1 RC2 should have fixed that issue.

Juergen

micahcraig
Aug 24th, 2004, 09:39 AM
I assume you're working with Spring 1.1 RC1: JmsTemplate102 had a bug there, in that it just worked properly with a JMS 1.1 API jar on the classpath. Spring 1.1 RC2 should have fixed that issue.
Yep, going up to RC2 took care of it. Sorry I neglected to check the release notes. Thanks for your help.

-micah