ESB Services/Processes current state - Forum - Technology Partner - Progress Community

ESB Services/Processes current state

 Forum

ESB Services/Processes current state

  • Hi there,

    I'm trying to find current state of all services/processes from a ESB container. I've try this in two ways

    1) ContainerConfig test = new ContainerConfig();

    IContainerRuntimeAPI ContainerRuntimeAPI = ( (ESBAPI) test.api).getContainerRuntimeAPI( "dev_BPEL", "dev_BPEL");

    ESBArtifactInfo[] ESBInfoArray = ContainerRuntimeAPI.getArtifacts();

    and I get this error :

    com.sonicsw.esb.mgmtapi.ESBAPIException: com.sonicsw.mf.jmx.client.CommunicationException: Failed invoke

    at com.sonicsw.esb.mgmtapi.runtime.impl.EsbContainerRuntimeAPI.getArtifacts(EsbContainerRuntimeAPI.java:52)

    at com.alcatel.struts.ESB.action.ContainerManagementAction.execute(ContainerManagementAction.java:93)

    at org.apache.struts.chain.commands.servlet.ExecuteAction.execute(ExecuteAction.java:58)

    at org.apache.struts.chain.commands.AbstractExecuteAction.execute(AbstractExecuteAction.java:67)

    at org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)

    at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)

    at org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304)

    at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)

    at org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)

    at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)

    at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)

    at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)

    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)

    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)

    at org.displaytag.filter.ResponseOverrideFilter.doFilter(ResponseOverrideFilter.java:125)

    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213)

    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)

    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)

    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)

    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)

    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)

    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)

    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)

    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)

    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)

    at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)

    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)

    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)

    at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)

    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)

    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)

    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)

    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)

    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)

    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)

    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)

    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)

    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)

    at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)

    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:594)

    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)

    at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)

    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)

    at java.lang.Thread.run(Thread.java:619)

    Caused by: com.sonicsw.mf.jmx.client.CommunicationException: Failed invoke

    at com.sonicsw.mf.jmx.client.JMSConnectorClient.invoke(Unknown Source)

    at com.sonicsw.mf.jmx.client.JMSConnectorClient.invoke(Unknown Source)

    at com.sonicsw.esb.mgmtapi.impl.DSConfigSPIImpl.invoke(DSConfigSPIImpl.java:208)

    at com.sonicsw.esb.mgmtapi.runtime.impl.EsbContainerRuntimeAPI.invokeLifecycleMethod(EsbContainerRuntimeAPI.java:160)

    at com.sonicsw.esb.mgmtapi.runtime.impl.EsbContainerRuntimeAPI.invokeMethod(EsbContainerRuntimeAPI.java:146)

    at com.sonicsw.esb.mgmtapi.runtime.impl.EsbContainerRuntimeAPI.getArtifacts(EsbContainerRuntimeAPI.java:48)

    ... 44 more

    in second case the code is:

    IContainerRuntimeAPI ContainerRuntimeAPI = ( (ESBAPI) test.api).getContainerRuntimeAPI( "dev_BPEL", "dev_BPEL");

    ESBArtifactInfo ESBInfo = ContainerRuntimeAPI.getServiceInfo("dev_PEL");

    ESBInfo.getCurrentState();

    and errors I get :

    com.sonicsw.esb.mgmtapi.ESBAPIException: javax.management.RuntimeOperationsException: RuntimeException thrown by the invoke method of the Dynamic MBean

    at com.sonicsw.esb.mgmtapi.runtime.impl.EsbContainerRuntimeAPI.getServiceInfo(EsbContainerRuntimeAPI.java:64)

    at com.alcatel.struts.ESB.action.ContainerManagementAction.execute(ContainerManagementAction.java:94)

    at org.apache.struts.chain.commands.servlet.ExecuteAction.execute(ExecuteAction.java:58)

    at org.apache.struts.chain.commands.AbstractExecuteAction.execute(AbstractExecuteAction.java:67)

    at org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)

    at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)

    at org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304)

    at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)

    at org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)

    at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)

    at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)

    at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)

    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)

    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)

    at org.displaytag.filter.ResponseOverrideFilter.doFilter(ResponseOverrideFilter.java:125)

    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213)

    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)

    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)

    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)

    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)

    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)

    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)

    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)

    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)

    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)

    at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)

    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)

    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)

    at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)

    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)

    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)

    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)

    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)

    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)

    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)

    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)

    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)

    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)

    at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)

    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:594)

    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)

    at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)

    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)

    at java.lang.Thread.run(Thread.java:619)

    Caused by: javax.management.RuntimeOperationsException: RuntimeException thrown by the invoke method of the Dynamic MBean

    at com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke(DynamicMetaDataImpl.java:235)

    at com.sun.jmx.mbeanserver.MetaDataImpl.invoke(MetaDataImpl.java:228)

    at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:822)

    at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:792)

    at sun.reflect.GeneratedMethodAccessor30.invoke(Unknown Source)

    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java)

    at java.lang.reflect.Method.invoke(Method.java)

    at com.sonicsw.mf.framework.agent.ContainerImpl$ExternalRequestHandler.invoke(Unknown Source)

    at com.sonicsw.mf.framework.agent.ContainerImpl$ExternalRequestHandler.invoke(Unknown Source)

    at com.sonicsw.mf.framework.agent.ContainerImpl$ExternalRequestHandler.invoke(Unknown Source)

    at com.sonicsw.mf.framework.agent.JMSConnectorServer$RequestHandlerDelegate.onMessage(Unknown Source)

    at com.sonicsw.mf.framework.agent.JMSConnectorServer$2.run(Unknown Source)

    at com.sonicsw.mf.framework.agent.TaskScheduler$ExecutionThread.run(Unknown Source)

    Caused by: java.lang.IllegalArgumentException: ESB service dev_PEL is not deployed in this container

    at com.sonicsw.xqimpl.service.ContainerLifeCycleManager.getServiceInfo(ContainerLifeCycleManager.java:215)

    at com.sonicsw.xqimpl.service.XQContainer.invokeLifecycleMethod(XQContainer.java:1234)

    at sun.reflect.GeneratedMethodAccessor31.invoke(Unknown Source)

    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java)

    at java.lang.reflect.Method.invoke(Method.java)

    at com.sonicsw.mf.framework.agent.AbstractMBean.internalInvoke(Unknown Source)

    at com.sonicsw.mf.framework.agent.AbstractMBean.internalInvoke(Unknown Source)

    at com.sonicsw.mf.framework.agent.ComponentMBean.internalInvoke(Unknown Source)

    at com.sonicsw.mf.framework.agent.AbstractMBean.invoke(Unknown Source)

    at com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke(DynamicMetaDataImpl.java:221)

    ... 12 more

    Thanks,

    Claudia Dutu

  • To use the ESBRuntime API you must ensure that the MF container which you are querying is active - since the implementation of the API actually queries the container for status of it's "insides"

    To do that you can use com.sonicsw.mf.mgmtapi.runtime.IAgentProxy which is part of the MF api.

    You can see a sample of this in MQ7.6\samples\Management\runtimeAPI\javaProxy\Shutdown.java

    In the meantime, to just check your ESB code - you can manually assure that the container is running.

  • The second exception has a caused by:

    Caused by: java.lang.IllegalArgumentException: ESB service dev_PEL is not

    deployed in this container

    at

    com.sonicsw.xqimpl.service.ContainerLifeCycleManager.getServiceInfo(Contai

    nerLifeCycleManager.java:215)

    at

    com.sonicsw.xqimpl.service.XQContainer.invokeLifecycleMethod(XQContainer.j

    ava:1234)

    So it looks like the component name or container name is not correct. Can you post the code that sets your "test" variable?

  • I see. Your "test" variable is an instance of com.sonicsw.esb.mgmtapi.runtime. So, dev_BPEL is both the name of the MF container and the name of the ESB container? Is the ESB container started? It looks like "dev_PEL" is a typo (in the second case)?

  • One more thing. In the calls to the mgmt API, I think you need the full path to the MF container and the ESB container, as shown in the Sonic Management Console. For instance, "/Containers/dev_BPEL" and "/ESB Containers/dev_BPEL"

  • I'm sure that MF container is running because I can see this in Sonic Management Console , and I've allready implemented Launch, Restart and Stop for this and it's working.

    ESB Container in this case it's running too.

    I have inspired from the sample you've mentioned Shutdown.java

    For services I can't use com.sonicsw.mf.mgmtapi.runtime.IAgentProxy and I'm trying to use com.sonicsw.esb.mgmtapi.runtime.IContainerRuntimeAPI. And I don't know what is wrong.

  • You were right dev_PEL wasn't correct name of ESB service, LoanApproval is, and it's deployed in this container but I've got the same error

  • I think that is ok how I've tried to use

    IContainerRuntimeAPI ContainerRuntimeAPI = ( (ESBAPI) test.api).getContainerRuntimeAPI("dev_BPEL" , "dev_BPEL");

    because canonical name that I obtain if I watch ContainerRuntimeAPI is Domain1.dev_BPEL:ID=dev_BPEL otherwise Domain1./Containers/dev_BPEL:ID=/ESB Containers/dev_BPEL

    Do you have another idea ?

  • Hmm. I just tried the following code, with no exceptions. I had the mgmt broker running, and the VerificationContainer running. It returned one artifact, the VerificationService.

    ESBAPI api = (new ESBAPIFactoryImpl()).createConfigAPI("Domain1", "pcdavila:2506", "Administrator", "Administrator");

    IContainerRuntimeAPI ContainerRuntimeAPI = api.getContainerRuntimeAPI( "VerificationContainer", "VerificationContainer");

    ESBArtifactInfo[] ESBInfoArray = ContainerRuntimeAPI.getArtifacts();

    api.dispose();

  • I've tried your code with VerificationContainer running

    ESBAPI api = (new ESBAPIFactoryImpl()).createConfigAPI("Domain1", "tcp://localhost:2506", "Administrator", "Administrator");

    IContainerRuntimeAPI ContainerRuntimeAPI = api.getContainerRuntimeAPI( "VerificationContainer", "VerificationContainer");

    ESBArtifactInfo[] ESBInfoArray = ContainerRuntimeAPI.getArtifacts();

    api.dispose();

    and the error is the same javax.servlet.ServletException: com.sonicsw.mf.jmx.client.CommunicationException: Failed invoke

    When VerificationContainer was not running the error I had was javax.servlet.ServletException: com.sonicsw.mf.comm.InvokeTimeoutException: Domain1.VerificationContainer:ID=VerificationContainer - invoke()

    Please tell me what jars do you use. Maybe I missing something.

  • I use, from the MQ7.6\lib area, mgmt_client.jar, mgmt_config.jar and broker.jar. From the ESB7.6\lib area, xq_config.jar. I see you're getting a servlet exception; I'm not running this code as a servlet but as a standalone program. Have you tried it that way?

  • Hi,

    First of all , I want to tank you for your replies.

    I have tried to run this code as a servlet but as a standalone program. But I've got the same error

  • Hmm. Now I'm stumped. It's just weird that you have been able to implement other functionality using this API and this particular one is failing. I'm not sure what else to look at.