[mule-user] SocketException Software caused connection abort socket write error

81 views
Skip to first unread message

JackyMule

unread,
Jul 23, 2008, 11:37:20 AM7/23/08
to us...@mule.codehaus.org

Hello Friends,

I am using Mule2.0. I am using remote dispatcher to get mule services.
I have two mule clients. They are exchanging messages via Mule server.
Setup is working fine, both clients are exchanging messages successfully.

But i am getting following SocketException at server side at regular
interval.

2008-07-23 16:27:03 BST [connector.tcp.0.receiver.5] ERROR Caught exception
in Exception Strategy: Software caused connection abort: socket write error
java.net.SocketException: Software caused connection abort: socket write
error
at java.net.SocketOutputStream.socketWrite0(Native Method)
at java.net.SocketOutputStream.socketWrite(Unknown Source)
at java.net.SocketOutputStream.write(Unknown Source)
at java.io.BufferedOutputStream.flushBuffer(Unknown Source)
at java.io.BufferedOutputStream.flush(Unknown Source)
at java.io.DataOutputStream.flush(Unknown Source)
at
org.mule.transport.tcp.protocols.LengthProtocol.writeByteArray(LengthProtocol.java:96)
at
org.mule.transport.tcp.protocols.AbstractByteProtocol.write(AbstractByteProtocol.java:81)
at
org.mule.transport.tcp.protocols.AbstractByteProtocol.write(AbstractByteProtocol.java:77)
at
org.mule.transport.tcp.protocols.SafeProtocol.write(SafeProtocol.java:56)
at
org.mule.transport.tcp.TcpMessageReceiver$TcpWorker.handleResults(TcpMessageReceiver.java:390)
at
org.mule.transport.AbstractReceiverWorker.doRun(AbstractReceiverWorker.java:132)
at
org.mule.transport.AbstractReceiverResourceWorker.doRun(AbstractReceiverResourceWorker.java:51)
at
org.mule.transport.AbstractReceiverWorker.run(AbstractReceiverWorker.java:62)
at org.mule.work.WorkerContext.run(WorkerContext.java:310)
at
edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1061)
at
edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:575)
at java.lang.Thread.run(Unknown Source)


My mule server config file looks like

<mule>
<client:remote-dispatcher-agent>
<client:remote-endpoint address="tcp://localhost:60504"
synchronous="true" />
</client:remote-dispatcher-agent>

<vm:connector name="asyncVm" queueEvents="true" />

<jms:activemq-connector name="jmsConnector"
brokerURL="tcp://localhost:61616" specification="1.1"
persistentDelivery="false"/>

<endpoint name="jmsCaafConfiguration"
address="jms://topic:caaf.configuration" synchronous="false"/>

<endpoint name="jmsFseHeartbeat"
address="jms://topic:caaf.fse.heartbeat" synchronous="false"/>


<model name="EventBridge">

<service name="caafConfiguration">
<inbound>
<inbound-endpoint ref="jmsCaafConfiguration"/>
</inbound>
<bridge-component />
<outbound>
<outbound-pass-through-router>
<vm:outbound-endpoint path="vmCaafConfiguration"
connector-ref="asyncVm" />
</outbound-pass-through-router>
</outbound>
</service>

<service name="consumerUMO">
<inbound>
<inbound-endpoint ref="jmsFseHeartbeat" />

</inbound>
<bridge-component />
<outbound>
<multicasting-router>
<vm:outbound-endpoint path="vmMuleEvents" connector-ref="asyncVm" />
</multicasting-router>
</outbound>
</service>

</model>
</mule>


Any one help in this regard. How can i get rid of this exception?
Please share your opinion.

regards,
Jacky


--
View this message in context: http://www.nabble.com/SocketException-Software-caused-connection-abort-socket-write-error-tp18613613p18613613.html
Sent from the Mule - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


JackyMule

unread,
Jul 24, 2008, 5:26:40 PM7/24/08
to us...@mule.codehaus.org

Hello Friends, Any one has solution for the SocketException issue. I posted
detail description of my scenario in my previous post. Kindly help me in
resolving this issue. I left nothing to try from my side to resolve that
problem. I am just optimistic about this forum.

Thanks in advance

JackyMule

--
View this message in context: http://www.nabble.com/SocketException-Software-caused-connection-abort-socket-write-error-tp18613613p18640913.html

Andrew Perepelytsya

unread,
Jul 24, 2008, 5:48:53 PM7/24/08
to us...@mule.codehaus.org
Your config is not runnable OOTB, and it's not known how you send the message. Try posting those bits.

Andrew

JackyMule

unread,
Jul 25, 2008, 3:52:58 AM7/25/08
to us...@mule.codehaus.org

Hello Andrew,

I am posting code of publisher client & consumer client.

PublisherClient.java
--------------------------------
public static void main(String args[])
{
MuleClient client = new MuleClient();
RemoteDispatcher dispatcher =
client.getRemoteDispatcher("tcp://localhost:60504");
while (true)
{
dispatcher.dispatchRemote("vm://vmCaafConfiguration", i + "
Sending Dummy External Event ", null);
Thread.sleep(1000);
}
}

ConsumerClient.java
------------------------------
public static int run() throws Exception
{
MuleClient client = new MuleClient();
RemoteDispatcher dispatcher =
client.getRemoteDispatcher("tcp://localhost:60504");
MuleMessage muleMessage = null;

while (true)
{
muleMessage = dispatcher.receiveRemote("vm://vmMuleEvents",
1000);
if (muleMessage != null)
{
System.out.println(muleMessage.getPayloadAsString());
}
}
}

I have already posted mule server config file in my earlier post.
I have following question for you.
What do you mean by "your config is not runnable" message is not clear to
me? How to make it runnable?


Thanks in advance.

JackyMule

--
View this message in context: http://www.nabble.com/SocketException-Software-caused-connection-abort-socket-write-error-tp18613613p18646922.html

PawanModi

unread,
Jul 25, 2008, 11:22:00 AM7/25/08
to us...@mule.codehaus.org

Hello Andrew,

Sorry for the config file posted in my first post. Here is my working config
file. kindly have a look.

<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns="http://www.mulesource.org/schema/mule/core/2.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:spring="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:stdio="http://www.mulesource.org/schema/mule/stdio/2.0"
xmlns:vm="http://www.mulesource.org/schema/mule/vm/2.0"
xmlns:ejb="http://www.mulesource.org/schema/mule/ejb/2.0"
xmlns:jms="http://www.mulesource.org/schema/mule/jms/2.0"
xmlns:client="http://www.mulesource.org/schema/mule/client/2.0"
xmlns:tcp="http://www.mulesource.org/schema/mule/tcp/2.0"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-2.5.xsd
http://www.mulesource.org/schema/mule/core/2.0
http://www.mulesource.org/schema/mule/core/2.0/mule.xsd
http://www.mulesource.org/schema/mule/vm/2.0
http://www.mulesource.org/schema/mule/vm/2.0/mule-vm.xsd
http://www.mulesource.org/schema/mule/ejb/2.0
http://www.mulesource.org/schema/mule/ejb/2.0/mule-ejb.xsd
http://www.mulesource.org/schema/mule/stdio/2.0
http://www.mulesource.org/schema/mule/stdio/2.0/mule-stdio.xsd
http://www.mulesource.org/schema/mule/jms/2.0
http://www.mulesource.org/schema/mule/jms/2.0/mule-jms.xsd
http://www.mulesource.org/schema/mule/client/2.0
http://www.mulesource.org/schema/mule/client/2.0/mule-client.xsd
http://www.mulesource.org/schema/mule/tcp/2.0
http://www.mulesource.org/schema/mule/tcp/2.0/mule-tcp.xsd">

<client:remote-dispatcher-agent>
<client:remote-endpoint address="tcp://localhost:60504"
synchronous="true" />
</client:remote-dispatcher-agent>


<vm:connector name="asyncVm" queueEvents="true" />

<jms:connector name="jmsConnector" connectionFactory-ref="openMQ"
createMultipleTransactedReceivers="false"
numberOfConcurrentTransactedReceivers="1" specification="1.1">
<spring:property name="jmsSupport" ref="jndiJmsSupport" />
</jms:connector>


<spring:beans>
<spring:bean name="jndiJmsSupport"
class="org.mule.transport.jms.Jms102bSupport">
<spring:constructor-arg ref="jmsConnector" />
</spring:bean>

<spring:bean name="context"
class="javax.naming.InitialContext">
<spring:constructor-arg type="java.util.Hashtable">
<spring:props>
<spring:prop
key="java.naming.factory.initial">com.sun.jndi.fscontext.RefFSContextFactory</spring:prop>
<spring:prop
key="java.naming.provider.url">file:///C:/pawan/openMQ/mq</spring:prop>
</spring:props>
</spring:constructor-arg>
</spring:bean>
<spring:bean name="openMQ"
class="org.springframework.jndi.JndiObjectFactoryBean">
<spring:property name="jndiName"
value="MyTopicConnectionFactory" />
<spring:property name="jndiEnvironment">
<spring:props>
<spring:prop
key="java.naming.factory.initial">com.sun.jndi.fscontext.RefFSContextFactory</spring:prop>
<spring:prop
key="specifications">1.1</spring:prop>
<spring:prop
key="java.naming.provider.url">file:///C:/Temp</spring:prop>
</spring:props>
</spring:property>
</spring:bean>
</spring:beans>

<endpoint name="jmsCaafConfiguration"
address="jms://topic:caaf_configuration" synchronous="false"
connector-ref="jmsConnector"/>

<model name="EventBridge">
<service name="publisherUMO">
<inbound>
<vm:inbound-endpoint path="publisherVM" connector-ref="asyncVm" />


</inbound>
<bridge-component />
<outbound>
<multicasting-router>

<outbound-endpoint ref="jmsCaafConfiguration" />
</multicasting-router>


</outbound>
</service>
<service name="consumerUMO">
<inbound>

<inbound-endpoint ref="jmsCaafConfiguration" />
</inbound>
<bridge-component />
<outbound>

<multicasting-router>
<vm:outbound-endpoint path="vmMuleEvents" connector-ref="asyncVm" />
</multicasting-router>
</outbound>
</service>
</model>
</mule>


I hope this time my config file is more clearer to you. I am consistently
getting SocketException at mule server. This error coming only if i run
client & mule server as seperate program. I am using mule server services
using remote dispatcher. You can see my publisher & consumer in my previous
post.
Kindly share your views / solution with me.

Thanks in advance.

Pawan Modi

--
View this message in context: http://www.nabble.com/SocketException-Software-caused-connection-abort-socket-write-error-tp18613613p18653810.html

JackyMule

unread,
Jul 28, 2008, 5:49:26 AM7/28/08
to us...@mule.codehaus.org

Hello Friends,

Any one has the solution for the problem of SocketException?
I have searched this forum for the solution of this problem but not able to
find any solution the same.
I have described my problem & exception in the earlier posts of this thread.

Please reply to this thread if you are aware of the solution.

Thanks & regards,
Pawan Modi

--
View this message in context: http://www.nabble.com/SocketException-Software-caused-connection-abort-socket-write-error-tp18613613p18687118.html

PawanModi

unread,
Aug 1, 2008, 1:43:37 AM8/1/08
to us...@mule.codehaus.org

Hello,

If any one is aware of the solution of SocketException then please help me.
I have been struggling with SocketException. I just want to supress it.

Can any one help? Please visit my earlier posts in the same threads for more
information.

Thanks & regards,
Pawan Modi

--
View this message in context: http://www.nabble.com/SocketException-Software-caused-connection-abort-socket-write-error-tp18613613p18768555.html

PawanModi

unread,
Dec 3, 2008, 5:53:36 AM12/3/08
to us...@mule.codehaus.org

Hello Mule Community,

Any one has the solution of the problem described in this thread.
I migrated to Mule2.1.1 but i am still get following errors at mule server
console.

2008-12-03 16:18:50 GMT+05:30 [connector.tcp.0.receiver.5] ERROR Caught


exception in Exception Strategy: Software caused connection abort: socket
write error
java.net.SocketException: Software caused connection abort: socket write
error
at java.net.SocketOutputStream.socketWrite0(Native Method)
at java.net.SocketOutputStream.socketWrite(Unknown Source)
at java.net.SocketOutputStream.write(Unknown Source)
at java.io.BufferedOutputStream.flushBuffer(Unknown Source)
at java.io.BufferedOutputStream.flush(Unknown Source)
at java.io.DataOutputStream.flush(Unknown Source)
at
org.mule.transport.tcp.protocols.LengthProtocol.writeByteArray(LengthProtocol.java:96)
at

org.mule.transport.tcp.protocols.AbstractByteProtocol.write(AbstractByteProtocol.java:93)
at
org.mule.transport.tcp.protocols.AbstractByteProtocol.write(AbstractByteProtocol.java:79)
at
org.mule.transport.tcp.protocols.SafeProtocol.write(SafeProtocol.java:56)
at
org.mule.transport.tcp.TcpMessageReceiver$TcpWorker.handleResults(TcpMessageReceiver.java:405)


at
org.mule.transport.AbstractReceiverWorker.doRun(AbstractReceiverWorker.java:132)
at
org.mule.transport.AbstractReceiverResourceWorker.doRun(AbstractReceiverResourceWorker.java:51)
at
org.mule.transport.AbstractReceiverWorker.run(AbstractReceiverWorker.java:62)
at org.mule.work.WorkerContext.run(WorkerContext.java:310)
at
edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1061)
at
edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:575)
at java.lang.Thread.run(Unknown Source)


Kindly help. I want to get rid of this exception.

Pawan Modi

--
View this message in context: http://www.nabble.com/SocketException-Software-caused-connection-abort-socket-write-error-tp18613613p20810699.html

Antoine Borg

unread,
Dec 5, 2008, 2:28:16 AM12/5/08
to us...@mule.codehaus.org
I've seen a number of your posts on this topic and am sorry to see that
you're still having problems.

I've just tried reading the history of this thread but am not sure if I
understand everything so correct me if I mis-read anything.

You have two Java apps that both use the MuleClient to communicate with one
another. One is called Publisher and the other is called Consumer. You
connect one with the other using the getRemoteDispatcher (). Once
connected, you want to be able to send messages along
vm://vmCaafConfiguration.

My first question would be why are using getRemoteDispatcher() in both your
Publisher and Consumer. Typically, you would use getRemoteDispatcher() to
connect a MuleClient to a Mule Server NOT to another MuleClient so I think
that this may be part of the SocketException here. Also, you do not seem to
have a Mule Server anywhere. I know this was raised in a separate post but
cannot remember what your reasons for this are.

From the look of your sample code below, your Publisher could be nothing
more than a Mule Server with a service that has a Quartz inbound endpoint
and a VM outbound endpoint. The consumer can then be another service (in the
same Mule Server ) with a VM inbound endpoint and an outbound STDIO
endpoint.

HTH

A


Antoine Borg, Senior Consultant | Tel: +32 28 504 696
ricston Ltd., BP 2, 1180 Uccle, Brussels, BELGIUM
email: antoin...@ricston.com | blog: blog.ricston.com | web: ricston.com

PawanModi

unread,
Dec 10, 2008, 1:04:47 AM12/10/08
to us...@mule.codehaus.org

Hello Antoine,

Thanks for reply. But you have misunderstood my setup & scenario.
Please have a look to attached image. Image will give you quick view of my
setup.

http://www.nabble.com/file/p20929686/MuleSetup.gif

Reason for having this kind of setup is to make sure that only single entity
(mule server) is communicating to Jms Broker. All posts in this thread is
for this kind of setup.

Now can you guide me how can i get rid of that exception in this kind of
setup.

Thanks once again.

Pawan Modi

--
View this message in context: http://www.nabble.com/SocketException-Software-caused-connection-abort-socket-write-error-tp18613613p20929686.html

Antoine Borg

unread,
Dec 10, 2008, 6:54:01 AM12/10/08
to us...@mule.codehaus.org
Hello,

Thank you for the image - it was incredibly explanatory as I thought that
the consumer talks to the publisher NOT to a central Mule server.

Faced with this specification, I would create 3 Mule instances:

- The Mule server that you currently run.
- One Mule server for client 1 (The publisher)
- One Mule server for client 2 (The consumer)

This is a very normal setup and I've worked like this a number of times. I
suppose that in your setup, you'd much rather keep your MuleClient embedded
inside Java code, right? Is there any reason why you cannot convert the
publisher and the consumer to a Mule instance? If you can eliminate the
MuleClient, you can avoid this error completely and still have all the
communication that you need.

HTH

A

Hello Antoine,

http://www.nabble.com/file/p20929686/MuleSetup.gif

Thanks once again.

Pawan Modi

> -socke t-write-error-tp18613613p20810699.html

PawanModi

unread,
Dec 11, 2008, 12:21:43 AM12/11/08
to us...@mule.codehaus.org

Hello Antoine,

Thanks for the understanding & specification. I don't like to have multiple
instances of mule server in my environment because if JMS broker restarts
then all instances of mule servers have to reestablish the connection. I
don't want this in my setup. My requirement is to provide single entity to
communicate with JMS broker.

I dont mind using multiple instances of mule server if only one server is
making connection towards JMS broker.

Your specification look possible & want to realize it little more.

Lets assume Mule server instance1 has connection with JMS broker & Mule
server instance2 & instance3 are publisher & consumer.

Now publisher instance will pass message to instance1 & instance1 pass it on
JMS broker.
Instance1 also listen for some topic so that if any data comes on topic to
pass it to consumer instance.

How instance2 & instance3 are going to make connection with instance1? Which
protocol?

please suggest.

Thanks & regards,
Pawan Modi

--
View this message in context: http://www.nabble.com/SocketException-Software-caused-connection-abort-socket-write-error-tp18613613p20949623.html

Antoine Borg

unread,
Dec 19, 2008, 5:22:50 AM12/19/08
to us...@mule.codehaus.org
Hi,

The protocol to use are entirely up to you - you can use web services, HTTP,
FTP, file, store the data in a database (JDBC) ... The list goes on. I'm
excluding JMS because that's a requirement for you and I'm excluding VM as
that's only available within the same JVM.

HTH

Hello Antoine,

please suggest.

>> t -socke t-write-error-tp18613613p20810699.html


>> Sent from the Mule - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>> http://xircles.codehaus.org/manage_email
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>> http://xircles.codehaus.org/manage_email
>>
>>
>>
>>
>
> --
> View this message in context:
> http://www.nabble.com/SocketException-Software-caused-connection-abort

> -socke t-write-error-tp18613613p20929686.html


> Sent from the Mule - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
> http://xircles.codehaus.org/manage_email
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
> http://xircles.codehaus.org/manage_email
>
>
>
>

--
View this message in context:
http://www.nabble.com/SocketException-Software-caused-connection-abort-socke
t-write-error-tp18613613p20949623.html

Reply all
Reply to author
Forward
0 new messages