Skip Menu |

This queue is for tickets about the jmx4perl CPAN distribution.

Report information
The Basics
Id: 61107
Status: resolved
Priority: 0/
Queue: jmx4perl

People
Owner: roland [...] cpan.org
Requestors: MRO [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.71
Fixed in: (no value)



Subject: j4p-osgi-bundle throws ClassCastException in Activator.start()
When deploying j4p-osgi-bundle on ServiceMix a ClassCastException is thrown from Activator.start() (see stacktrace.txt). I have tried both latest stable and development versions. Versions: Apache ServiceMix 4.2.0-fuse-01-00 jmx4perl 0.71 & 0.72_1
Subject: stacktrace.txt
11:53:08,065 | ERROR | 858791439955.tmp | webconsole | ? ? | Cannot install or update bundle from /tmp/install2584526858791439955.tmp org.osgi.framework.BundleException: Exception in org.jmx4perl.osgi.bundle.Activator.start() of bundle org.jmx4perl.osgi.bundle. at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:806) at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:755) at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:352) at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:280) at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:272) at org.apache.felix.webconsole.internal.core.InstallHelper.doRun(InstallHelper.java:65) at org.apache.felix.webconsole.internal.core.BaseUpdateInstallHelper.doRun(BaseUpdateInstallHelper.java:79) at org.apache.felix.webconsole.internal.core.BaseUpdateInstallHelper.run(BaseUpdateInstallHelper.java:112) Caused by: java.lang.ClassCastException: org.ops4j.pax.web.service.jetty.internal.ServerControllerFactoryImpl cannot be cast to org.ops4j.pax.web.service.spi.ServerControllerFactory at org.ops4j.pax.web.service.internal.Activator.createServerController(Activator.java:111) at org.ops4j.pax.web.service.internal.Activator.start(Activator.java:69) at org.ops4j.pax.web.service.jetty.internal.CompositeActivator.start(CompositeActivator.java:46) at org.jmx4perl.osgi.bundle.Activator.start(Activator.java:57) at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:783) at java.security.AccessController.doPrivileged(Native Method) at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:774) ... 7 more
Hi,

the point is, that j4p-osgi is the proper bundle to use for service-mix, not j4p-osgi-bundle.

The difference is, that j4p-osgi is the 'naked' OSGi bundle with a dependency on an OSGi HTTP-Service, 
whereas j4p-osgi-bundle ist an 'all-in-one' bundle, including (and hiding) an HTTP-Service 
on its own. (this naming scheme is borrowed from pax-web, where there also different bundles
for different circumstances available).

When possible, j4p-osgi.jar should be used (which also fits better the OSGi philosophy). 
j4p-osgi-bundle.jar is only provided for simple setup if no OSGi HTTP-Service (like pax-web)
is not available out of the box.

As it turns out, servicemix 4 already comes with all dependencies setup (which also causes
these problems when using the bundles, although I consider this a bug in the OSGi container
itself since it *should* work theoretically since all internals are encapsulated the OSGi way) 

I tested the j4p-osgi.jar with servicemix 4.2.0 and it works fine for me.
You can find it in agent/modules/j4p-osgi or you can download it directly from 
http://labs.consol.de/maven/repository/org/jmx4perl/j4p-osgi/0.71.0/j4p-osgi-0.71.0.jar

Please let me know, whether this bundle works for you, too.

ciao ...
...roland

BTW, after installing j4p-osgi.jar, 
the URl for accessing the agent is 

http://localhost:8181/j4p

when using the default servicemix configuration.
(Try 'j4psh http://localhost:8181/j4p' for exploring the JMX space)
Using j4p-osgi works! For reference, I'm using the FUSE distribution of ServiceMix 4.2.