users@genericjmsra.java.net

ClassCastException for ConnectionFactory when using GenericJMSRA with WMQ 6.0

From: Alex Sherwin <alex.sherwin_at_acadiasoft.com>
Date: Wed, 23 Apr 2008 17:19:09 -0400

All,

I can successfully configure WMQ and Sun AppServer/GlassFish to work
properly with GenericJMSRA for both listening (MDBs) and sending via the
standard JMS 1.1 API. Everything works properly with standard JMS 1.1
ConnectionFactory objects except MDBs. When WMQ is configured with a
javax.jms.ConnectionFactory object in its bindings, when an MDB attempts to
setup its listeners the following occurs:


[#|2008-04-23T17:12:08.864-0400|WARNING|sun-appserver9.1|javax.enterprise.sy
stem.stream.err|_ThreadID=24;_ThreadName=httpWorkerThread-8148-1;_RequestID=
0676d8cd-6983-4210-8ace-170c3efb1297;|
java.lang.ClassCastException: com.ibm.mq.jms.MQXAConnectionFactory cannot be
cast to javax.jms.XAQueueConnectionFactory
        at
com.sun.genericra.inbound.InboundJmsResourcePool.createXAConnection(InboundJ
msResourcePool.java:191)
        at
com.sun.genericra.inbound.InboundJmsResourcePool.initialize(InboundJmsResour
cePool.java:129)
        at
com.sun.genericra.inbound.EndpointConsumer.initialize(EndpointConsumer.java:
133)
        at
com.sun.genericra.inbound.EndpointConsumer.start(EndpointConsumer.java:126)
        at
com.sun.genericra.GenericJMSRA.endpointActivation(GenericJMSRA.java:215)
        at
com.sun.enterprise.connectors.inflow.ConnectorMessageBeanClient.setup(Connec
torMessageBeanClient.java:252)
        at
com.sun.ejb.containers.MessageBeanContainer.<init>(MessageBeanContainer.java
:209)
        at
com.sun.ejb.containers.ContainerFactoryImpl.createContainer(ContainerFactory
Impl.java:280)
        at
com.sun.enterprise.server.AbstractLoader.loadEjbs(AbstractLoader.java:536)
        at
com.sun.enterprise.server.ApplicationLoader.doLoad(ApplicationLoader.java:18
8)
        at
com.sun.enterprise.server.TomcatApplicationLoader.doLoad(TomcatApplicationLo
ader.java:126)
        at
com.sun.enterprise.server.AbstractLoader.load(AbstractLoader.java:244)
        at
com.sun.enterprise.server.ApplicationManager.applicationDeployed(Application
Manager.java:336)
        at
com.sun.enterprise.server.ApplicationManager.applicationDeployed(Application
Manager.java:210)
        at
com.sun.enterprise.server.ApplicationManager.applicationDeployed(Application
Manager.java:645)
        at
com.sun.enterprise.admin.event.AdminEventMulticaster.invokeApplicationDeploy
EventListener(AdminEventMulticaster.java:928)
        at
com.sun.enterprise.admin.event.AdminEventMulticaster.handleApplicationDeploy
Event(AdminEventMulticaster.java:912)
        at
com.sun.enterprise.admin.event.AdminEventMulticaster.processEvent(AdminEvent
Multicaster.java:461)
        at
com.sun.enterprise.admin.event.AdminEventMulticaster.multicastEvent(AdminEve
ntMulticaster.java:176)
        at
com.sun.enterprise.admin.server.core.DeploymentNotificationHelper.multicastE
vent(DeploymentNotificationHelper.java:308)
        at
com.sun.enterprise.deployment.phasing.DeploymentServiceUtils.multicastEvent(
DeploymentServiceUtils.java:226)
        at
com.sun.enterprise.deployment.phasing.ServerDeploymentTarget.sendStartEvent(
ServerDeploymentTarget.java:298)
        at
com.sun.enterprise.deployment.phasing.ApplicationStartPhase.runPhase(Applica
tionStartPhase.java:132)
        at
com.sun.enterprise.deployment.phasing.DeploymentPhase.executePhase(Deploymen
tPhase.java:108)
        at
com.sun.enterprise.deployment.phasing.PEDeploymentService.executePhases(PEDe
ploymentService.java:919)
        at
com.sun.enterprise.deployment.phasing.PEDeploymentService.start(PEDeployment
Service.java:591)
        at
com.sun.enterprise.deployment.phasing.PEDeploymentService.start(PEDeployment
Service.java:635)
        at
com.sun.enterprise.admin.mbeans.ApplicationsConfigMBean.start(ApplicationsCo
nfigMBean.java:744)
        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:597)
        at
com.sun.enterprise.admin.MBeanHelper.invokeOperationInBean(MBeanHelper.java:
375)
        at
com.sun.enterprise.admin.MBeanHelper.invokeOperationInBean(MBeanHelper.java:
358)
        at
com.sun.enterprise.admin.config.BaseConfigMBean.invoke(BaseConfigMBean.java:
464)
        at
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanSer
verInterceptor.java:836)
        at
com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761)
        at sun.reflect.GeneratedMethodAccessor14.invoke(Unknown Source)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at
com.sun.enterprise.admin.util.proxy.ProxyClass.invoke(ProxyClass.java:90)
        at $Proxy1.invoke(Unknown Source)
        at
com.sun.enterprise.admin.server.core.jmx.SunoneInterceptor.invoke(SunoneInte
rceptor.java:304)
        at
com.sun.enterprise.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.
java:174)
        at
com.sun.enterprise.admin.jmx.remote.server.callers.InvokeCaller.call(InvokeC
aller.java:69)
        at
com.sun.enterprise.admin.jmx.remote.server.MBeanServerRequestHandler.handle(
MBeanServerRequestHandler.java:155)
        at
com.sun.enterprise.admin.jmx.remote.server.servlet.RemoteJmxConnectorServlet
.processRequest(RemoteJmxConnectorServlet.java:122)
        at
com.sun.enterprise.admin.jmx.remote.server.servlet.RemoteJmxConnectorServlet
.doPost(RemoteJmxConnectorServlet.java:193)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:738)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
        at
org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFi
lterChain.java:411)


I've searched far and wide in all of the configuration files for both the
Sun AppServer's config of the GenericJMSRA resource adapter and deployment,
and everything I can see is set to javax.jms.ConnectionFactory, NOT
javax.jms.QueueConnectionFactory. The only way I can resolve this issue, is
to create a QueueConnectionFactory in the WMQ setup instead of a
ConnectionFactory. All of the appropriate WMQ libs/jars are included in the
classpath-suffic of the JVM with the properly classpath seperator for the OS
(RHEL4).

If anyone has a solution, that would be great!

___________________________

Alex Sherwin
alex.sherwin_at_acadiasoft.com