automatic shutdown on RuntimeException

Daniel Ritter daniel at moonx.de
Thu Dec 9 04:17:48 EST 2004


Hi,

i'm using the latest merlin snapshot.

One of my components tries to make a connection to a SAP system.
If there is no way to make a connection (e.g. network is down, cable is 
broken....whatever you want) the getClient method is throwing a 
RuntimeException.
This is the method:

  public JCO.Client getConnection() {
    JCO.Client client = null;
    try {
      client = JCO.getClient(poolId);
    } catch (RuntimeException e) {
      getLogger().error("getConnection failed", e);
    }
    return client;
  }

As you can see i catch the RuntimeException, but anyway merlin is 
shuting down after the execution of the catch block.
These are the referencing lines from the logfile:

ERROR   2004-12-09 10:02:01:047 [converter.sap-connectionpool] : 
getConnection failed
com.sap.mw.jco.JCO$Exception: (102) RFC_ERROR_COMMUNICATION: Connect to 
SAP gateway failed
Connect_PM  GWHOST=172.31.8.1, GWSERV=sapgw00, ASHOST=172.31.8.1, SYSNR=00

LOCATION    CPIC (TCP/IP) on local host
ERROR       partner not reached (host 172.31.8.1, service 3300)

TIME        Thu Dec 09 10:02:01 2004
RELEASE     640
COMPONENT   NI (network interface)
VERSION     37
RC          -10
MODULE      nixxi_r.cpp
LINE        8588
DETAIL      NiPConnect2
SYSTEM CALL SiPeekPendConn
ERRNO       10065
ERRNO TEXT  WSAEHOSTUNREACH: No route to host
COUNTER     1

    at com.sap.mw.jco.rfc.MiddlewareRFC$Client.nativeConnect(Native Method)
    at 
com.sap.mw.jco.rfc.MiddlewareRFC$Client.connect(MiddlewareRFC.java:1092)
    at com.sap.mw.jco.JCO$Client.connect(JCO.java:2983)
    at com.sap.mw.jco.JCO$Pool.initPool(JCO.java:4375)
    at com.sap.mw.jco.JCO$PoolManager.getClient(JCO.java:5717)
    at com.sap.mw.jco.JCO$PoolManager.getClient(JCO.java:5672)
    at com.sap.mw.jco.JCO.getClient(JCO.java:7905)
    at 
de.servit.converter.sap.connectionpool.ConnectionPoolImpl.getConnection(ConnectionPoolImpl.java:93)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at 
org.apache.avalon.activation.impl.ApplianceInvocationHandler.invoke(ApplianceInvocationHandler.java:129)
    at $Proxy7.getConnection(Unknown Source)
    at 
de.servit.converter.materialservice.MaterialServiceImpl.initialize(MaterialServiceImpl.java:54)
    at 
org.apache.avalon.framework.container.ContainerUtil.initialize(ContainerUtil.java:244)
    at 
org.apache.avalon.activation.impl.DefaultComponentFactory.incarnation(DefaultComponentFactory.java:402)
    at 
org.apache.avalon.activation.impl.DefaultComponentFactory.incarnate(DefaultComponentFactory.java:130)
    at 
org.apache.avalon.activation.impl.SingletonLifestyleManager.refreshReference(SingletonLifestyleManager.java:144)
    at 
org.apache.avalon.activation.impl.SingletonLifestyleManager.commission(SingletonLifestyleManager.java:60)
    at 
org.apache.avalon.activation.impl.DefaultAppliance.commission(DefaultAppliance.java:94)
    at 
org.apache.avalon.activation.impl.DefaultRuntime.commission(DefaultRuntime.java:86)
    at 
org.apache.avalon.composition.model.impl.DefaultSystemContext.commission(DefaultSystemContext.java:377)
    at 
org.apache.avalon.composition.model.impl.DefaultDeploymentModel.commission(DefaultDeploymentModel.java:122)
    at 
org.apache.avalon.composition.model.impl.DefaultComponentModel.commission(DefaultComponentModel.java:282)
    at 
org.apache.avalon.composition.model.impl.Commissioner.run(Commissioner.java:190)
    at java.lang.Thread.run(Thread.java:534)
INFO    2004-12-09 10:02:01:047 [converter.sap-connectionpool] : 1
INFO    2004-12-09 10:02:01:047 [converter.sap-connectionpool] : 2
DEBUG   2004-12-09 10:02:01:057 [kernel                   ] : state: 
initialized
DEBUG   2004-12-09 10:02:01:067 [converter.sap-connectionpool.proxy] : 
Finalizing proxy [3338151] (appliance:/converter/sap-connectionpool).
DEBUG   2004-12-09 10:02:01:067 [converter.sap-connectionpool.proxy] : 
Releasing component [3338151] (appliance:/converter/sap-connectionpool).
DEBUG   2004-12-09 10:02:01:328 [kernel                   ] : shutdown event
DEBUG   2004-12-09 10:02:01:328 [kernel                   ] : disposal


What can i do to make stop merlin shuting down after the exception occurs?

Thanks for your help in advance,

Daniel Ritter



More information about the support-dpml mailing list