Ah yes this is what Im looking for.Previously I had <ws-handler> in my code which made it much easier.Now i will try ur code.Thank u.
Ah yes this is what Im looking for.Previously I had <ws-handler> in my code which made it much easier.Now i will try ur code.Thank u.
Hey Mark, I tried ur code but Im getting the same JMSException as mentioned in the beginning of this post which is: I can c the message being deleivered to the queue but when I open to c the message it gives me this JMS exception.Please help.Im really getting frustrated at this exception(please c for the exception at beginning of this post)
Code:<channel id="sendChannel"/> <ws:outbound-gateway id="WebServiceGateway" request-channel="sendChannel" reply-channel="WebServiceReceiveChannel" uri="http://localhost:8080/Trial1/companyservice"/> <publish-subscribe-channel id="WebServiceReceiveChannel"/> <jms:outbound-gateway id="jmsGateway" request-channel="WebServiceReceiveChannel" connection-factory="connectionFactory" jms-queue="HelloQueue"/> <beans:bean id="connectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory"> <beans:property name="brokerURL" value="tcp://localhost:61616" /> </beans:bean> <beans:bean id="HelloQueue" class="org.apache.activemq.command.ActiveMQQueue"> <beans:constructor-arg value="HelloQueueWorlds" index="0"/> </beans:bean>
Last edited by ashleyvijay; Nov 5th, 2008 at 12:26 PM.
Did you read Jonas reply above regarding that JMSException? It looks like a serialization issue and it's at the JMS level. I don't think it's related to Spring Integration - probably you need to make sure you have the right classes on both sides of the JMS communication.
Mark Fisher
Spring Integration Lead
SpringSource, a division of VMware
http://www.springsource.com
http://www.springsource.org/spring-integration
http://blog.springsource.com/main/author/markf
Well I have the SI GenericMessage class: org.springframework.integration.message.GenericMes sage on the classpath but still what is the problem??Please help.Im really going crazy with this Exception. If its still a serialization/deserialization please tell me how to solve it please...
Given the other problem that you were having (http://forum.springframework.org/showthread.php?t=63106), I would highly recommend verifying that you have only one version on the classpath and that it is the same version on both sides of the JMS communication.
This problem looks like something in your configuration/setup and is very likely not a Spring Integration issue. Based on the stack trace, everything is as-expected until the serialization. So, there's not really any assistance we can provide. You need to verify your setup.
Mark Fisher
Spring Integration Lead
SpringSource, a division of VMware
http://www.springsource.com
http://www.springsource.org/spring-integration
http://blog.springsource.com/main/author/markf
Hey,
For once, you should decide what you want to get propagated on the other side (i.e. to the consumer that's listening to your JMS Queue): SI's GenericMessages or payloads only. If the former is true, then include SI's jar on the end that receives the messages (otherwise you won't be able to deserialize them, of course).
However, if you're expecting to receive from the JMS queue only the payload inject a HeaderMappingMessageConverter that sets extractPayload to true. See the javadoc of said MessageConverter.
Hopefully this makes things clearer,
Marius
Last edited by mbogoevici; Nov 6th, 2008 at 06:16 PM. Reason: formatting, again
Marius Bogoevici,
Spring Integration Committer
Thank u so much Marius. I can understand what u r trying to say but Im not able to figure out what my code is doing right now cos I just copied from the samples to try.Dont know whether the below code is trying to sending Generic Messges or Payloads to the consumer/JMS Queue.I have included all the necessary SI RC1 jars alone in the classpath and more M6 version Please help me to figure out what am I missing in the code below:
SI.java
SI.XMLCode:package rc1; import java.util.Properties; import org.springframework.context.support.ClassPathXmlApplicationContext; import org.springframework.integration.core.MessagingException; import org.springframework.integration.message.MessageBuilder; import org.springframework.integration.ws.AbstractWebServiceOutboundGateway; public class SI { public static void main(String[] args)throws MessagingException { ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("si.xml",SI.class); // Compose the XML message according to the server's schema String requestXml = "<hr:CompanyRequest xmlns:hr=\"http://mycompany.com/hr/schemas\">" + "<hr:Company>"+ "<hr:CompanyName>TestRequest</hr:CompanyName>"+ "</hr:Company>"+ "</hr:CompanyRequest>"; I have no clue whts being done after this:sending generic msg or payload to JMSQueue // Create the Message object // In this case the service expects a SoapAction header org.springframework.integration.core.Message<String> message = MessageBuilder.withPayload(requestXml) .setHeader(AbstractWebServiceOutboundGateway.SOAP_ACTION_PROPERTY_KEY, "http://mycompany.com/hr/schemas") .build();[/COLOR] // Send the Message to the handler's input channel ((org.springframework.integration.core.MessageChannel) context.getBean("sendChannel")).send(message); } }
Code:<message-bus/> <channel id="sendChannel"/> <ws:outbound-gateway id="gateway" request-channel="sendChannel" reply-channel="receiveChannel" uri="http://localhost:8080/Trial1/companyservice"/> <jms:outbound-gateway request-channel="receiveChannel" connection-factory="connectionFactory" jms-queue="HelloQueue"/> <beans:bean id="connectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory"> <beans:property name="brokerURL" value="tcp://localhost:61616"/> </beans:bean> <beans:bean id="HelloQueue" class="org.apache.activemq.command.ActiveMQQueue"> <beans:constructor-arg value="RC1" /> </beans:bean>
Last edited by ashleyvijay; Nov 7th, 2008 at 04:57 AM.
Well, that's easy.
1) You're not sending anything to the JMS Queue, you're sending stuff to the web service, and the response from that is sent to the JMS Queue.
2) Because you're using the defaults, what gets serialized is a GenericMessage. Whether you want that to happen or not, I can't say, it's your application design.
3) Because wherever you're trying to read from the queue you don't have the SI jar, you can't deserialize the message.
4) If you don't want to send a GenericMessage to JMS, but only the payload, do the extractPayload trick as mentioned on this thread (by me).
I think you should be in a good shape now to finish what you're trying to achieve.
Marius Bogoevici,
Spring Integration Committer
Ah ok.Thank u so much! Finally u understood my problem.Thanks alot.I solved it!
Last edited by ashleyvijay; Nov 7th, 2008 at 08:57 AM.