tuscany-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antonio Mirarchi <antonio.mirar...@gmail.com>
Subject Re: Tuscany Java: How to Detect if component is running or not
Date Thu, 11 Jun 2009 20:48:19 GMT
2009/6/11 Simon Laws <simonslaws@googlemail.com>

> Hi Antonio
>
> I think you should get a ServiceUnavailableException returned through
> the reference used to call the service. Were you seeing some other
> behaviour in the case where you killed component B?
>
> Regards
>
> Simon
>
Thank for your answer, i'll try to exaplin with more details the example,
the component B send its selfreference  to component A the component use
this refererence (in code: (Bcomponent) selfrefB.getService()) to use the
methods of component B, the component A call a B-mthod doSomeCalc(), at this
point i kill the process of component B and the component A print something
like this:

/**************************************************/
  [java] INFO: Added Servlet mapping: http://icewolf:8100/AServiceComponent
     [java] - I/O exception
(org.apache.commons.httpclient.NoHttpResponseException) caught when
processing request: The server localhost failed to respond
     [java] - Retrying request
     [java] - Unable to sendViaPost to url[
http://localhost:8300/CServiceComponent]
     [java] java.net.ConnectException: Connection refused
     [java]     at java.net.PlainSocketImpl.socketConnect(Native Method)
     [java]     at
java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
     [java]     at
java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
     [java]     at
java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
     [java]     at
java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
     [java]     at java.net.Socket.connect(Socket.java:519)
     [java]     at java.net.Socket.connect(Socket.java:469)
     [java]     at java.net.Socket.<init>(Socket.java:366)
     [java]     at java.net.Socket.<init>(Socket.java:240)
     [java]     at
org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:80)
     [java] Exception in thread "main" org.osoa.sca.ServiceRuntimeException:
org.osoa.sca.ServiceRuntimeException: org.apache.axis2.AxisFault: Connection
refused
     [java]     at node.LaunchClient.main(LaunchClient.java:28)
     [java] Caused by: org.osoa.sca.ServiceRuntimeException:
org.apache.axis2.AxisFault: Connection refused
     [java]     at
org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:136)
     [java]     at
org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:287)
     [java]     at
org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:154)
     [java]     at $Proxy14.saluto(Unknown Source)
     [java]     at cloader.PaperinoImpl.execute(PaperinoImpl.java:37)
     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
     [java]     at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
     [java]     at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     [java]     at java.lang.reflect.Method.invoke(Method.java:597)
     [java]     at
org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:132)
     [java]     at
org.apache.tuscany.sca.core.databinding.wire.PassByValueInterceptor.invoke(PassByValueInterceptor.java:112)
     [java]     at
org.apache.tuscany.sca.binding.sca.impl.SCABindingInvoker.invoke(SCABindingInvoker.java:61)
     [java]     at
org.apache.tuscany.sca.core.databinding.wire.PassByValueInterceptor.invoke(PassByValueInterceptor.java:112)
     [java]     at
org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:287)
     [java]     at
org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:154)
     [java]     at $Proxy6.execute(Unknown Source)
     [java]     at node.LaunchClient.main(LaunchClient.java:24)
     [java] Caused by: org.apache.axis2.AxisFault: Connection refused
     [java]     at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
     [java]     at
org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:193)
     [java]     at
org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:75)
     [java]     at
org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:371)
     [java]     at
org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:209)
     [java]     at
org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:448)
     [java]     at
org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:401)
     [java]     at
org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:228)
     [java]     at
org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
     [java]     at
org.apache.tuscany.sca.binding.ws.axis2.Axis2BindingInvoker$1.run(Axis2BindingInvoker.java:170)
     [java]     at java.security.AccessController.doPrivileged(Native
Method)
     [java]     at
org.apache.tuscany.sca.binding.ws.axis2.Axis2BindingInvoker.invokeTarget(Axis2BindingInvoker.java:168)
     [java]     at
org.apache.tuscany.sca.binding.ws.axis2.Axis2BindingInvoker.invoke(Axis2BindingInvoker.java:122)
     [java]     at
org.apache.tuscany.sca.binding.sca.axis2.impl.Axis2SCABindingInvoker.invoke(Axis2SCABindingInvoker.java:98)
     [java]     at
org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:78)
     [java]     ... 16 more
     [java] Caused by: java.net.ConnectException: Connection refused
     [java]     at java.net.PlainSocketImpl.socketConnect(Native Method)
     [java]     at
java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
     [java]     at
java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
     [java]     at
java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
     [java]     at
java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
     [java]     at java.net.Socket.connect(Socket.java:519)
     [java]     at java.net.Socket.connect(Socket.java:469)
     [java]     at java.net.Socket.<init>(Socket.java:366)
     [java]     at java.net.Socket.<init>(Socket.java:240)
     [java]     at
org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:80)
     [java]     at
org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:122)
     [java]     at
org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:707)
     [java]     at
org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.open(MultiThreadedHttpConnectionManager.java:1361)
     [java]     at
org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:387)
     [java]     at
org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
     [java]     at
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
     [java]     at
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
     [java]     at
org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:542)
     [java]     at
org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:189)
     [java]     ... 29 more
     [java]     at
org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:122)
     [java]     at
org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:707)
     [java]     at
org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.open(MultiThreadedHttpConnectionManager.java:1361)
     [java]     at
org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:387)
     [java]     at
org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
     [java]     at
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
     [java]     at
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
     [java]     at
org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:542)
     [java]     at
org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:189)
     [java]     at
org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:75)
     [java]     at
org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:371)
     [java]     at
org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:209)
     [java]     at
org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:448)
     [java]     at
org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:401)
     [java]     at
org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:228)
     [java]     at
org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
     [java]     at
org.apache.tuscany.sca.binding.ws.axis2.Axis2BindingInvoker$1.run(Axis2BindingInvoker.java:170)
     [java]     at java.security.AccessController.doPrivileged(Native
Method)
     [java]     at
org.apache.tuscany.sca.binding.ws.axis2.Axis2BindingInvoker.invokeTarget(Axis2BindingInvoker.java:168)
     [java]     at
org.apache.tuscany.sca.binding.ws.axis2.Axis2BindingInvoker.invoke(Axis2BindingInvoker.java:122)
     [java]     at
org.apache.tuscany.sca.binding.sca.axis2.impl.Axis2SCABindingInvoker.invoke(Axis2SCABindingInvoker.java:98)
     [java]     at
org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:78)
     [java]     at
org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:287)
     [java]     at
org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:154)
     [java]     at $Proxy14.saluto(Unknown Source)
     [java]     at cloader.PaperinoImpl.execute(PaperinoImpl.java:37)
     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
     [java]     at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
     [java]     at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     [java]     at java.lang.reflect.Method.invoke(Method.java:597)
     [java]     at
org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:132)
     [java]     at
org.apache.tuscany.sca.core.databinding.wire.PassByValueInterceptor.invoke(PassByValueInterceptor.java:112)
     [java]     at
org.apache.tuscany.sca.binding.sca.impl.SCABindingInvoker.invoke(SCABindingInvoker.java:61)
     [java]     at
org.apache.tuscany.sca.core.databinding.wire.PassByValueInterceptor.invoke(PassByValueInterceptor.java:112)
     [java]     at
org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:287)
     [java]     at
org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:154)
     [java]     at $Proxy6.execute(Unknown Source)
     [java]     at node.LaunchClient.main(LaunchClient.java:24)
     [java] Java Result: 1
/************************************************************************/

My goal is to catch the right exception to re-launch  the component when it
fails or die for any reason.
Thanks a lot for your help.

Mime
View raw message