-
1. Re: Deployment error
scottdawson Jun 2, 2009 9:38 AM (in response to ruperty)You need a non-gateway listener. The easy way to fix it is to enable the inVM listener on the service:
<service .... invmScope="GLOBAL">
or you can add a non-gateway listener -- see the webservice_producer quickstart for a socket example that uses a JMS ESB-aware (non-gateway) listener.
Regards,
Scott -
2. Re: Deployment error
ruperty Jun 2, 2009 10:45 AM (in response to ruperty)Thanks.
What I am trying to do is expose a socket server that an external system will connect to by tcpip and send a message, waiting for a reply. Don't I need a gateway for that?
I am using webservice_producer as a template. Isn't the JMS ESB-aware (non-gateway) listener only visible internally (and not tcpip) ?
Regards,
Rupert -
3. Re: Deployment error
scottdawson Jun 2, 2009 10:55 AM (in response to ruperty)Rupert,
You need to configure both: a gateway listener to receive the message from the external client and an ESB-aware listener to transport the message within the bus. Look at the "Services and Messages" chapter in the Programmer's Guide if it's still not clear.
Regards,
Scott -
4. Re: Deployment error
ruperty Jun 2, 2009 1:08 PM (in response to ruperty)Scott,
Ok, got a bit further. It seems to deploy successfully, a few things though,
There are no endpoints deployed in http://localhost:8080/jbossws/services
Testing with sendMessageToJBRListener sends a request and gets a response, but using an external tcpip test client I get this,
at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:173)
Caused by: java.io.StreamCorruptedException: invalid stream header: 68656C6C
at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:783)
is it expecting a particular envelope?
Where does the request go in the esb? Is it onto a queue and to access the message I need to write a jmslisteneraction class?<?xml version = "1.0" encoding = "UTF-8"?> <jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd" parameterReloadSecs="5"> <providers> <jms-provider name="JBossMQ" connection-factory="ConnectionFactory"> <jms-bus busid="socketserverEsbChannel"> <jms-message-filter dest-type="QUEUE" dest-name="queue/socketserver_esb"/> </jms-bus> </jms-provider> <jbr-provider name="JBR-Socket" protocol="socket" host="localhost"> <jbr-bus busid="Socket-1" port="8888" /> </jbr-provider> </providers> <services> <service category="MyServiceCategory" name="MySocketServer" description="Socket server"> <listeners> <jms-listener name="JMS-ESBListener" busidref="socketserverEsbChannel"/> <jbr-listener name="Socket-Gateway" busidref="Socket-1" is-gateway="true"/> </listeners> <actions mep="RequestResponse"> <action name="print-before" class="org.jboss.soa.esb.actions.SystemPrintln"> <property name="message" value="[Project_ss] BEFORE invoking jboss socket server endpoint"/> </action> <action name="print-after" class="org.jboss.soa.esb.actions.SystemPrintln"> <property name="message" value="[Project_ss] AFTER invoking jboss socket server endpoint"/> </action> </actions> </service> </services> </jbossesb>
Regards,
Rupert -
5. Re: Deployment error
scottdawson Jun 2, 2009 4:15 PM (in response to ruperty)There are no endpoints deployed in http://localhost:8080/jbossws/services
That's OK. That page displays web services and you haven't deployed a web service.
I don't know why you get the StreamCorruptedException.Where does the request go in the esb? Is it onto a queue and to access the message I need to write a jmslisteneraction class?
Your request is routed down the list of actions that you've specified. If you want to write some custom code to process the message, you can do that with your own action class. The helloworld quickstart has a good example of that. There are lots of other things you can do -- transform the message, route it to another service, etc. -
6. Re: Deployment error
ruperty Jun 3, 2009 6:38 AM (in response to ruperty)Scott,
Thanks.I don't know why you get the StreamCorruptedException.
Is there documentation somewhere which explains what the socket gateway is doing?
Regards,
Rupert