On Jul 16, 2009, at 5:03 AM, Fredrik Jonson wrote:
> Hi again,
>
> I haven't given up on my little project to replace the old and not
> so solid
> ActiveMQ 4.1.2 in geronimo 2.1.4 with ActiveMQ 5.2.0. Not yet anyway.
>
> Right now I've replaced activem-broker and geronimo-activemq-ra with
> two custom
> packages. And with these packages installed I can start geronimo
> just fine. I'm
> using a modified Geronimo 2.1.4 Jetty 6 JavaEE.
>
> Unfortunately when I try to deploy an ear that contains MDB:s I get
> an odd
> class cast exception:
>
> 2009-07-16 13:46:56,854 ERROR [GBeanInstanceState] Error while
> starting;
> GBean is now in the FAILED state: abstractName="com.example/custom-
> server-ear/
> 1.0.1-SNAPSHOT/ear?J2EEApplication=com.example/custom-server-
> ear/
> 1.0.1-SNAPSHOT/ear,JCAResource=jms-resources,ResourceAdapter=
> jms-resources,ResourceAdapterModule=jms-resources,j2eeType=
> JCAResourceAdapter,name=jms-resources"
> java.lang.ClassCastException:
> org.apache.activemq.ra.ActiveMQResourceAdapter cannot be cast to
> javax.resource.spi.ResourceAdapter
> at
> org
> .apache
> .geronimo
> .connector.ResourceAdapterWrapper.<init>(ResourceAdapterWrapper.java:
> 79)
> at
> org
> .apache
> .geronimo
> .connector
> .ResourceAdapterWrapperGBean.<init>(ResourceAdapterWrapperGBean.java:
> 51)
> at
> sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
> at
> sun
> .reflect
> .NativeConstructorAccessorImpl
> .newInstance(NativeConstructorAccessorImpl.java:39)
> at
> sun
> .reflect
> .DelegatingConstructorAccessorImpl
> .newInstance(DelegatingConstructorAccessorImpl.java:27)
> at java.lang.reflect.Constructor.newInstance(Constructor.java:
> 513)
> at
> org
> .apache
> .geronimo
> .gbean.runtime.GBeanInstance.createInstance(GBeanInstance.java:948)
> at
> org
> .apache
> .geronimo
> .gbean
> .runtime.GBeanInstanceState.attemptFullStart(GBeanInstanceState.java:
> 268)
> at
> org
> .apache
> .geronimo
> .gbean.runtime.GBeanInstanceState.start(GBeanInstanceState.java:102)
> at
> org
> .apache
> .geronimo
> .gbean
> .runtime.GBeanInstanceState.startRecursive(GBeanInstanceState.java:
> 124)
> at
> org
> .apache
> .geronimo
> .gbean.runtime.GBeanInstance.startRecursive(GBeanInstance.java:555)
> at
> org
> .apache
> .geronimo
> .kernel.basic.BasicKernel.startRecursiveGBean(BasicKernel.java:379)
> at
> org
> .apache
> .geronimo
> .kernel
> .config
> .ConfigurationUtil.startConfigurationGBeans(ConfigurationUtil.java:
> 456)
> at
> org
> .apache
> .geronimo
> .kernel
> .config
> .KernelConfigurationManager.start(KernelConfigurationManager.java:188)
> at
> org
> .apache
> .geronimo
> .kernel
> .config
> .SimpleConfigurationManager
> .startConfiguration(SimpleConfigurationManager.java:563)
> at sun.reflect.GeneratedMethodAccessor21.invoke(Unknown Source)
> at
> sun
> .reflect
> .DelegatingMethodAccessorImpl
> .invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at
> org
> .apache
> .geronimo
> .gbean
> .runtime.ReflectionMethodInvoker.invoke(ReflectionMethodInvoker.java:
> 34)
> at
> org
> .apache
> .geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:124)
> at
> org
> .apache
> .geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:832)
> at
> org.apache.geronimo.gbean.runtime.RawInvoker.invoke(RawInvoker.java:
> 57)
> at
> org
> .apache
> .geronimo
> .kernel.basic.RawOperationInvoker.invoke(RawOperationInvoker.java:35)
> at
> org
> .apache
> .geronimo
> .kernel
> .basic.ProxyMethodInterceptor.intercept(ProxyMethodInterceptor.java:
> 96)
> at org.apache.geronimo.gbean.GBeanLifecycle$$EnhancerByCGLIB$
> $8e753450.startConfiguration(<generated>)
> at
> org
> .apache
> .geronimo.system.main.EmbeddedDaemon.doStartup(EmbeddedDaemon.java:
> 162)
> at
> org
> .apache
> .geronimo.system.main.EmbeddedDaemon.execute(EmbeddedDaemon.java:79)
> at
> org
> .apache
> .geronimo
> .kernel
> .util
> .MainConfigurationBootstrapper
> .main(MainConfigurationBootstrapper.java:45)
> at
> org.apache.geronimo.cli.AbstractCLI.executeMain(AbstractCLI.java:67)
> at
> org.apache.geronimo.cli.daemon.DaemonCLI.main(DaemonCLI.java:30)
>
> Does anyone have a hunch what might be happening here?
My guess would be that
- you are using the amq 5.2 rar as supplied by amq, which contains
waaaay too much stuff including the j2ca spec jar
- the classloader for the rar does not have the jee-specs plugin as a
parent (or, rather, ancestor)
So the rar is loading the javax.resource classes in its own
classloader and openejb is trying to load them in the jee-specs
classloader.
Can I ask why you aren't using 2.2-SNAPSHOT and/or porting our amq 5.x
integration back to 2.1.x? AMQ 5.2 did have some tck issues in
geronimo which is why we are using 5.3-SNAPSHOT and hoping for a
imminent 5.3 release.
thanks
david jencks
>
> --
> Fredrik Jonson
>