You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by smilingsky <ya...@gmail.com> on 2007/07/06 00:53:27 UTC
JMS Binding Problem
Hello all,
I'm still a newbie to Servicemix. I am trying to make the JMS component work
and have a JMS client send message to it. But I always get the following
errors when I execute my JMS client:
--------------------------------------------------------------------
Exception in thread "main" java.lang.NoSuchMethodError:
org.apache.activemq.command.ConnectionInfo.isClientMaster()Z
at
org.apache.activemq.openwire.v2.ConnectionInfoMarshaller.tightMarshal1(ConnectionInfoMarshaller.java:107)
at
org.apache.activemq.openwire.OpenWireFormat.marshal(OpenWireFormat.java:234)
at
org.apache.activemq.transport.tcp.TcpTransport.oneway(TcpTransport.java:124)
at
org.apache.activemq.transport.InactivityMonitor.oneway(InactivityMonitor.java:141)
at
org.apache.activemq.transport.TransportFilter.oneway(TransportFilter.java:78)
at
org.apache.activemq.transport.WireFormatNegotiator.oneway(WireFormatNegotiator.java:77)
at
org.apache.activemq.transport.MutexTransport.oneway(MutexTransport.java:44)
at
org.apache.activemq.transport.ResponseCorrelator.asyncRequest(ResponseCorrelator.java:68)
at
org.apache.activemq.transport.ResponseCorrelator.request(ResponseCorrelator.java:73)
at
org.apache.activemq.ActiveMQConnection.syncSendPacket(ActiveMQConnection.java:1131)
at
org.apache.activemq.ActiveMQConnection.ensureConnectionInfoSent(ActiveMQConnection.java:1219)
at
org.apache.activemq.ActiveMQConnection.createSession(ActiveMQConnection.java:272)
at com.abacus.rtdemo.rtdemoclient.JMSClient.main(JMSClient.java:46)
Exception in thread "ActiveMQ Transport: tcp://localhost/127.0.0.1:61616"
java.lang.AbstractMethodError:
org.apache.activemq.openwire.v2.BrokerInfoMarshaller.tightUnmarshal(Lorg/apache/activemq/openwire/OpenWireFormat;Ljava/lang/Object;Ljava/io/DataInputStream;Lorg/apache/activemq/openwire/BooleanStream;)V
at
org.apache.activemq.openwire.OpenWireFormat.doUnmarshal(OpenWireFormat.java:350)
at
org.apache.activemq.openwire.OpenWireFormat.unmarshal(OpenWireFormat.java:276)
at
org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:142)
at java.lang.Thread.run(Thread.java:619)
--------------------------------------------------------------------
I installed the Servicemix-JMS component and deploy the following
configuration:
--------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:sm="http://servicemix.apache.org/config/1.0"
xmlns:jms="http://servicemix.apache.org/jms/1.0"
xmlns:rtdemo="http://rtdemo.abacus.com/rtdemo">
<!-- JMS POLLER - CONSUMER -->
<jms:endpoint service="rtdemo:MyConsumer" endpoint="MyConsumer"
targetService="rtdemo:MyProvider" targetEndpoint="MyProvider"
role="consumer" defaultMep="http://www.w3.org/2004/08/wsdl/in-out"
destinationStyle="topic"
jmsProviderDestinationName="demo.org.servicemix.source"
connectionFactory="#connectionFactory" />
<!-- JMS SENDER - PROVIDER -->
<jms:endpoint service="rtdemo:MyProvider" endpoint="myProvider"
role="provider" defaultMep="http://www.w3.org/2004/08/wsdl/in-out"
destinationStyle="topic"
jmsProviderDestinationName="demo.org.servicemix.result"
connectionFactory="#connectionFactory" />
<!-- FACTORY BEAN -->
<bean id="connectionFactory"
class="org.apache.activemq.ActiveMQConnectionFactory">
<property name="brokerURL" value="tcp://localhost:61616" />
</bean>
</beans>
--------------------------------------------------------------------
Then my JMS client code is like:
ActiveMQConnectionFactory factory = new
ActiveMQConnectionFactory("tcp://localhost:61616");
ActiveMQTopic pubTopic = new ActiveMQTopic("demo.org.servicemix.source");
ActiveMQTopic subTopic = new ActiveMQTopic("demo.org.servicemix.result");
Connection connection = factory.createConnection();
//here is where the exception is raised
Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
...
It seems the connection cannot be set up. Could any of you give me some
hints on how to solve the problem? Thanks a lot!!
--
View this message in context: http://www.nabble.com/JMS-Binding-Problem-tf4032760s12049.html#a11456056
Sent from the ServiceMix - User mailing list archive at Nabble.com.
Re: JMS Binding Problem
Posted by smilingsky <ya...@gmail.com>.
Thank you both so much!! It turns out to be ActiveMQ dependency problem. My
previous MVN dependency that causes problem is:
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>apache-activemq</artifactId>
<version>4.1.1</version>
</dependency>
After I change to
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-core</artifactId>
<version>4.1.1</version>
</dependency>
It works fine now. I don't know why apache-activemq doesn't work though.
Thank you!!
bsnyder wrote:
>
> On 7/5/07, smilingsky <ya...@gmail.com> wrote:
>>
>> Thanks a lot for your reply. But it still gives me the same error message
>> when it executes "connection.start()". The connection is like:
>>
>> ActiveMQConnection
>> {id=ID:LAF-PC12880-1648-1183679501304-1:0,clientId=null,started=false}
>>
>> Any possible other reasons? Thank you very much!!
>
> Since I don't have your complete code, I can't really look much
> further. I suggest comparing your code to this simple JMS producer
> that is part of the ActiveMQ distribution:
>
> http://svn.apache.org/viewvc/activemq/trunk/assembly/src/release/example/src/ProducerTool.java?view=markup
>
> Also, against what version of ActiveMQ are you building? And what jars
> are you including in the classpath?
>
> Bruce
> --
> perl -e 'print
> unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
> );'
>
> Apache Geronimo - http://geronimo.apache.org/
> Apache ActiveMQ - http://activemq.org/
> Apache ServiceMix - http://servicemix.org/
> Castor - http://castor.org/
>
>
--
View this message in context: http://www.nabble.com/JMS-Binding-Problem-tf4032760s12049.html#a11459061
Sent from the ServiceMix - User mailing list archive at Nabble.com.
Re: JMS Binding Problem
Posted by Bruce Snyder <br...@gmail.com>.
On 7/5/07, smilingsky <ya...@gmail.com> wrote:
>
> Thanks a lot for your reply. But it still gives me the same error message
> when it executes "connection.start()". The connection is like:
>
> ActiveMQConnection
> {id=ID:LAF-PC12880-1648-1183679501304-1:0,clientId=null,started=false}
>
> Any possible other reasons? Thank you very much!!
Since I don't have your complete code, I can't really look much
further. I suggest comparing your code to this simple JMS producer
that is part of the ActiveMQ distribution:
http://svn.apache.org/viewvc/activemq/trunk/assembly/src/release/example/src/ProducerTool.java?view=markup
Also, against what version of ActiveMQ are you building? And what jars
are you including in the classpath?
Bruce
--
perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'
Apache Geronimo - http://geronimo.apache.org/
Apache ActiveMQ - http://activemq.org/
Apache ServiceMix - http://servicemix.org/
Castor - http://castor.org/
Re: JMS Binding Problem
Posted by smilingsky <ya...@gmail.com>.
Thanks a lot for your reply. But it still gives me the same error message
when it executes "connection.start()". The connection is like:
ActiveMQConnection
{id=ID:LAF-PC12880-1648-1183679501304-1:0,clientId=null,started=false}
Any possible other reasons? Thank you very much!!
bsnyder wrote:
>
> On 7/5/07, smilingsky <ya...@gmail.com> wrote:
>
> ...
>> Then my JMS client code is like:
>>
>> ActiveMQConnectionFactory factory = new
>> ActiveMQConnectionFactory("tcp://localhost:61616");
>> ActiveMQTopic pubTopic = new ActiveMQTopic("demo.org.servicemix.source");
>> ActiveMQTopic subTopic = new ActiveMQTopic("demo.org.servicemix.result");
>>
>> Connection connection = factory.createConnection();
>> //here is where the exception is raised
>> Session session = connection.createSession(false,
>> Session.AUTO_ACKNOWLEDGE);
>> ...
>>
>> It seems the connection cannot be set up. Could any of you give me some
>> hints on how to solve the problem? Thanks a lot!!
>
> The configuration for the servicemix-jms component looks good but it
> appears that you forgot to call the connection.start() method to
> actually establish a connection. Try this instead:
>
> ...
> Connection connection = factory.createConnection();
> connection.start();
> Session session = connection.createSession(false,
> Session.AUTO_ACKNOWLEDGE);
> ...
>
> Bruce
> --
> perl -e 'print
> unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
> );'
>
> Apache Geronimo - http://geronimo.apache.org/
> Apache ActiveMQ - http://activemq.org/
> Apache ServiceMix - http://servicemix.org/
> Castor - http://castor.org/
>
>
--
View this message in context: http://www.nabble.com/JMS-Binding-Problem-tf4032760s12049.html#a11456699
Sent from the ServiceMix - User mailing list archive at Nabble.com.
Re: JMS Binding Problem
Posted by Bruce Snyder <br...@gmail.com>.
On 7/5/07, smilingsky <ya...@gmail.com> wrote:
...
> Then my JMS client code is like:
>
> ActiveMQConnectionFactory factory = new
> ActiveMQConnectionFactory("tcp://localhost:61616");
> ActiveMQTopic pubTopic = new ActiveMQTopic("demo.org.servicemix.source");
> ActiveMQTopic subTopic = new ActiveMQTopic("demo.org.servicemix.result");
>
> Connection connection = factory.createConnection();
> //here is where the exception is raised
> Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
> ...
>
> It seems the connection cannot be set up. Could any of you give me some
> hints on how to solve the problem? Thanks a lot!!
The configuration for the servicemix-jms component looks good but it
appears that you forgot to call the connection.start() method to
actually establish a connection. Try this instead:
...
Connection connection = factory.createConnection();
connection.start();
Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
...
Bruce
--
perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'
Apache Geronimo - http://geronimo.apache.org/
Apache ActiveMQ - http://activemq.org/
Apache ServiceMix - http://servicemix.org/
Castor - http://castor.org/
Re: JMS Binding Problem
Posted by Adrian Co <ac...@exist.com>.
What version of ActiveMQ are you using as the JMS client?
I would suggest using the same version as SMX for now. Which I think is
the 4.1 branch...
smilingsky wrote:
> Hello all,
>
> I'm still a newbie to Servicemix. I am trying to make the JMS component work
> and have a JMS client send message to it. But I always get the following
> errors when I execute my JMS client:
>
> --------------------------------------------------------------------
> Exception in thread "main" java.lang.NoSuchMethodError:
> org.apache.activemq.command.ConnectionInfo.isClientMaster()Z
> at
> org.apache.activemq.openwire.v2.ConnectionInfoMarshaller.tightMarshal1(ConnectionInfoMarshaller.java:107)
> at
> org.apache.activemq.openwire.OpenWireFormat.marshal(OpenWireFormat.java:234)
> at
> org.apache.activemq.transport.tcp.TcpTransport.oneway(TcpTransport.java:124)
> at
> org.apache.activemq.transport.InactivityMonitor.oneway(InactivityMonitor.java:141)
> at
> org.apache.activemq.transport.TransportFilter.oneway(TransportFilter.java:78)
> at
> org.apache.activemq.transport.WireFormatNegotiator.oneway(WireFormatNegotiator.java:77)
> at
> org.apache.activemq.transport.MutexTransport.oneway(MutexTransport.java:44)
> at
> org.apache.activemq.transport.ResponseCorrelator.asyncRequest(ResponseCorrelator.java:68)
> at
> org.apache.activemq.transport.ResponseCorrelator.request(ResponseCorrelator.java:73)
> at
> org.apache.activemq.ActiveMQConnection.syncSendPacket(ActiveMQConnection.java:1131)
> at
> org.apache.activemq.ActiveMQConnection.ensureConnectionInfoSent(ActiveMQConnection.java:1219)
> at
> org.apache.activemq.ActiveMQConnection.createSession(ActiveMQConnection.java:272)
> at com.abacus.rtdemo.rtdemoclient.JMSClient.main(JMSClient.java:46)
> Exception in thread "ActiveMQ Transport: tcp://localhost/127.0.0.1:61616"
> java.lang.AbstractMethodError:
> org.apache.activemq.openwire.v2.BrokerInfoMarshaller.tightUnmarshal(Lorg/apache/activemq/openwire/OpenWireFormat;Ljava/lang/Object;Ljava/io/DataInputStream;Lorg/apache/activemq/openwire/BooleanStream;)V
> at
> org.apache.activemq.openwire.OpenWireFormat.doUnmarshal(OpenWireFormat.java:350)
> at
> org.apache.activemq.openwire.OpenWireFormat.unmarshal(OpenWireFormat.java:276)
> at
> org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:142)
> at java.lang.Thread.run(Thread.java:619)
> --------------------------------------------------------------------
>
> I installed the Servicemix-JMS component and deploy the following
> configuration:
> --------------------------------------------------------------------
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns:sm="http://servicemix.apache.org/config/1.0"
> xmlns:jms="http://servicemix.apache.org/jms/1.0"
> xmlns:rtdemo="http://rtdemo.abacus.com/rtdemo">
> <!-- JMS POLLER - CONSUMER -->
> <jms:endpoint service="rtdemo:MyConsumer" endpoint="MyConsumer"
> targetService="rtdemo:MyProvider" targetEndpoint="MyProvider"
> role="consumer" defaultMep="http://www.w3.org/2004/08/wsdl/in-out"
> destinationStyle="topic"
> jmsProviderDestinationName="demo.org.servicemix.source"
> connectionFactory="#connectionFactory" />
> <!-- JMS SENDER - PROVIDER -->
> <jms:endpoint service="rtdemo:MyProvider" endpoint="myProvider"
> role="provider" defaultMep="http://www.w3.org/2004/08/wsdl/in-out"
> destinationStyle="topic"
> jmsProviderDestinationName="demo.org.servicemix.result"
> connectionFactory="#connectionFactory" />
> <!-- FACTORY BEAN -->
> <bean id="connectionFactory"
> class="org.apache.activemq.ActiveMQConnectionFactory">
> <property name="brokerURL" value="tcp://localhost:61616" />
> </bean>
> </beans>
> --------------------------------------------------------------------
>
> Then my JMS client code is like:
>
> ActiveMQConnectionFactory factory = new
> ActiveMQConnectionFactory("tcp://localhost:61616");
> ActiveMQTopic pubTopic = new ActiveMQTopic("demo.org.servicemix.source");
> ActiveMQTopic subTopic = new ActiveMQTopic("demo.org.servicemix.result");
>
> Connection connection = factory.createConnection();
> //here is where the exception is raised
> Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
> ...
>
> It seems the connection cannot be set up. Could any of you give me some
> hints on how to solve the problem? Thanks a lot!!
>