[ 
https://issues.apache.org/jira/browse/ODE-895?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12973778#action_12973778
 ] 

Kurt Westerfeld commented on ODE-895:
-------------------------------------

There are actually multiple problems at work here.

First, there's a bug in Servicemix that has been fixed and documented here: 
https://issues.apache.org/activemq/browse/SM-2012, related to not registering 
MBeans at all for JBI components (not SUs, just components).   A later version 
of SMX 4 should have that fix.

Second, once that is fixed, the MBean name is altered slightly between SMX3 and 
SMX4 (use JConsole/VisualVM to find the MBean name actually registered).

Third, there is a classloader issue once you actually talk to the MBean related 
to the JPA classes not being able to find the ODE entities.   That last issue 
was "fixable" by the client setting a thread context class loader that points 
to it's own bundle, if that bundle does a "Require-Bundle" in its OSGi manifest 
to "odi-jbi-bundle."  That's obviously not ideal but it does work.

> Management MBean access broken (Rquest for an Management WS API for the JBI 
> distribution)
> -----------------------------------------------------------------------------------------
>
>                 Key: ODE-895
>                 URL: https://issues.apache.org/jira/browse/ODE-895
>             Project: ODE
>          Issue Type: New Feature
>          Components: Management API
>    Affects Versions: 1.3.4
>         Environment: ODE 1.3.4 as OSGi bundle in FUSE-ESB 4.3.0-fuse-02-00
>            Reporter: Antonio MarĂ­n
>
> I noticed recently that the old MBean usage is broken with latest stable 
> version of ODE. So accessing like in the jbi-karaf-commands is not supported:
> protected static String COMPONENT_NAME = 
> "org.apache.servicemix:Type=Component,Name=OdeBpelEngine,SubType=Management";
> protected static final String LIST_ALL_PROCESSES = "listAllProcesses";
> protected <T> T invoke(final String operationName, final Object[] params, 
> final String[] signature, Class<?> T, long timeoutInSeconds) throws Exception 
> {
>         ExecutorService executor = Executors.newSingleThreadExecutor();
>         Callable<T> callable = new Callable<T>() {
>             public T call() throws Exception {
>                 MBeanServer server = getMBeanServer();
>                 if (server != null) {
>                     return (T) server.invoke(new ObjectName(COMPONENT_NAME), 
> operationName, params, signature);
>                 }
>                 return null;
>             }
>         };
>         Future<T> future = executor.submit(callable);
>         executor.shutdown();
>         return future.get(timeoutInSeconds, TimeUnit.SECONDS);
>     }
>     protected List<TProcessInfo> getProcesses(long timeoutInSeconds) throws 
> Exception {
>         ProcessInfoListDocument result = invoke(LIST_ALL_PROCESSES, null, 
> null, ProcessInfoListDocument.class, timeoutInSeconds);
>         if (result != null) {
>             return result.getProcessInfoList().getProcessInfoList();
>         }
>         return null;
>     }
> is throwing:
> java.util.concurrent.ExecutionException: 
> javax.management.InstanceNotFoundException: 
> org.apache.servicemix:Type=Component,Name=OdeBpelEngine,SubType=Management
>         at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:232)
>         at java.util.concurrent.FutureTask.get(FutureTask.java:91)
>         at 
> net.geant.gembus.services.ode_manager.internal.OdeMBeanManager.invoke(OdeMBeanManager.java:91)
>         at 
> net.geant.gembus.services.ode_manager.internal.OdeMBeanManager.getProcesses(OdeMBeanManager.java:95)
>         at 
> net.geant.gembus.services.ode_manager.internal.OdeMBeanManager.listAllProcesses(OdeMBeanManager.java:104)
>         at 
> net.geant.gembus.services.ode_manager.OdeManagerImpl.ListAllProcesses(OdeManagerImpl.java:34)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> ...
> It would be desireable to have an input to the Management API on the JBI 
> distribution as a WS. I tryed to use the pmapi-sa.zip circulating around but 
> It's not working in my configuration.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to