Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sending message on wso2 socket, getting exception

I am trying to send a message over TCP in wso2 framework. I am getting this exception in log:

[2015-08-20 12:21:50,098] ERROR - TCPWorker Error while processing TCP request through the Axis2 engine
java.lang.NullPointerException
        at org.wso2.carbon.tenant.dispatcher.MultitenantDispatcher.findService(MultitenantDispatcher.java:47)
        at org.apache.axis2.engine.AbstractDispatcher.invoke(AbstractDispatcher.java:94)
        at org.apache.axis2.engine.Phase.invokeHandler(Phase.java:340)
        at org.apache.axis2.engine.Phase.invoke(Phase.java:313)
        at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:261)
        at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:167)
        at org.apache.axis2.transport.tcp.TCPWorker.run(TCPWorker.java:68)
        at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:745)

Following is the axis2 conf to start TCP:

<transportReceiver name="local" class="org.wso2.carbon.core.transports.local.CarbonLocalTransportReceiver"/>

<transportReceiver name="tcp" class="org.apache.axis2.transport.tcp.TCPTransportListener">
                <parameter name="transport.tcp.port">6060</parameter>
</transportReceiver>

And wso2.xml:

<definitions xmlns="http://ws.apache.org/ns/synapse">

    <sequence name="fault">
        <makefault>
            <code xmlns:tns="http://www.w3.org/2003/05/soap-envelope" value="tns:Receiver"/>
            <reason value="Mediation failed."/>
        </makefault>
        <send/>
    </sequence>


    <proxy xmlns="http://ws.apache.org/ns/synapse"
           name="TCPProxy"
           transports="https,http"
           statistics="disable"
           trace="disable"
           startOnLoad="true">
        <target>
            <inSequence>
                <log level="full"/>
            </inSequence>
            <outSequence>
                <send/>
            </outSequence>
        </target>
        <parameter name="transport.tcp.port">6060</parameter>
        <parameter name="transport.tcp.contentType">application/xml</parameter>
        <description/>
    </proxy>
</definitions>
like image 532
Raaghu Avatar asked Nov 10 '22 06:11

Raaghu


1 Answers

It sounds like no proxy service can be found in the ESB when a message is received on tcp port 6060.

I'm not used to tcp transport in WSO2 but I wonder if the "transports" attribute in you proxy definition should contain "tcp" instead of "https,http" :

<proxy xmlns="http://ws.apache.org/ns/synapse"
           name="TCPProxy"
           transports="tcp"
           statistics="disable"
           trace="disable"
           startOnLoad="true">
        <target>
            <inSequence>
                <log level="full"/>
            </inSequence>
            <outSequence>
                <send/>
            </outSequence>
        </target>
        <parameter name="transport.tcp.port">6060</parameter>
        <parameter name="transport.tcp.contentType">application/xml</parameter>
        <description/>
    </proxy>
like image 70
Jean-Michel Avatar answered Nov 14 '22 23:11

Jean-Michel