On Tue, Apr 15, 2008 at 8:32 PM, Altaf Muneer <[EMAIL PROTECTED]> wrote:
> Hi, > > I hava deployed a* Java SCA service* and I am trying to use the* JMS > binding* that tuscany provides. > I have used a small java program to post a message to an activemq queue. > I use the the JMS binding on the Java SCA service side to listen for > messages. > When I used an "*ObjectMessage*" to post the message to the queue it > worked > fine with tuscany's* 1.0.1 release*. > But when I migrated to the 1.1 release of tuscany I started getting > runtime > exceptions because the* 1.1 release* accepts only* XML messages*. > > I therefore used a "*TextMessage*" object and formatted an xml message > string and posted this to the queue. > > This calls the appropriate method. But after calling the method it throws > the following runtime exceptions. > > Exception while processing message:* > > java.lang.ClassCastException*:*org.apache.tuscany.sca.binding.jms.impl.JMSBindingException > * > > *java.lang.ClassCastException*:* > org.apache.tuscany.sca.binding.jms.impl.JMSBindingException* > at > > org.apache.tuscany.sca.binding.jms.provider.JMSMessageProcessorImpl.createXMLJMSMessage( > *JMSMessageProcessorImpl.java:140*) > > at > > org.apache.tuscany.sca.binding.jms.provider.JMSMessageProcessorImpl.insertPayloadIntoJMSMessage( > *JMSMessageProcessorImpl.java:85*) > > at > org.apache.tuscany.sca.binding.jms.provider.JMSBindingListener.sendReply(* > JMSBindingListener.java:125*) > at > > org.apache.tuscany.sca.binding.jms.provider.JMSBindingListener.sendFaultReply( > *JMSBindingListener.java:152*) > at > org.apache.tuscany.sca.binding.jms.provider.JMSBindingListener.onMessage(* > JMSBindingListener.java:65*) > at org.apache.activemq.ActiveMQMessageConsumer.dispatch(* > ActiveMQMessageConsumer.java:854*) > at org.apache.activemq.ActiveMQSessionExecutor.dispatch(* > ActiveMQSessionExecutor.java:99*) > at org.apache.activemq.ActiveMQSessionExecutor.iterate(* > ActiveMQSessionExecutor.java:166*) > at org.apache.activemq.thread.PooledTaskRunner.runTask(* > PooledTaskRunner.java:117*) > at org.apache.activemq.thread.PooledTaskRunner.access$100(* > PooledTaskRunner.java:26*) > at org.apache.activemq.thread.PooledTaskRunner$1.run(* > PooledTaskRunner.java:44*) > at > > edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask( > *ThreadPoolExecutor.java:665*) > > at > > edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run( > *ThreadPoolExecutor.java:690*) > at java.lang.Thread.run(Unknown Source) > > > It is a little strange because it throws an exception after calling the > right method. > > The xml message I sent had the following structure. > > <soapenv:Envelope > xmlns:q0="http://namespace1" > xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" > xmlns:xsd="http://www.w3.org/2001/XMLSchema" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> > <soapenv:Header> > </soapenv:Header> > <soapenv:Body> > <q0:methodname> > <q0:argname> > <q0:id>myId</q0:id> > <q0:name>myName</q0:name> > </q0:argname> > </q0:methodname> > </soapenv:Body> > </soapenv:Envelope> > > I am not sure what the problem here is. I think it might have to do with > the > message format. > > Also the method that is called does not have a return argument (that is it > has a void return type). Is that a problem? > > Is there a kindred soul who can help me here :) ? > Any help would be greatly appreciated. > > Cheers, > Altaf > There's two problems here, one is how to use other message types beside JMS Text messages containing XML, and the other is the ClassCastException you're seeing after the service method has been invoked when there's a void return type. I think the 2nd of those has been fixed in the trunk code and 1.2 release which is just about to become available. The other problem of how to use other message types is harder because the SCA specs only define how to do JMS text messages containing XML, and so far we haven't come up with a good flexible Tuscany specific way to provide that function. I shall have a go now at implementing something so its at least possible, but feel free to post any suggestions... ...ant
