Sunday, August 22, 2010

WebLogic 11g and MQ 7.... when the game gets tough...

(see also a previous post...http://www.javamonamour.org/2010/08/weblogic-integration-with-mq-series.html)


I am following the instructions

http://ibswings.blogspot.com/2008/02/integrating-mq-broker-6-with-bea.html


and I get


Aug 22, 2010 2:26:30 PM CEST Debug EjbDeployment BEA-000000 [EJBModule] activate() on module : EJBModule(MQReceiver) : activating module
Aug 22, 2010 2:26:30 PM CEST Debug EjbDeployment BEA-000000 [MessageDrivenBeanInfoImpl] Calling JMS MDB helper with providerURL=null
Aug 22, 2010 2:26:30 PM CEST Debug JMSCDS BEA-000000 getSubject: before looking up jms/WLReceiverQueue providerIRL = null isLocal = true
Aug 22, 2010 2:26:30 PM CEST Debug JMSCDS BEA-000000 Successfully created the initial context for the JNDIName jms/WLReceiverQueue
Aug 22, 2010 2:26:33 PM CEST Warning EJB BEA-010061 The Message-Driven EJB: TestMDB is unable to connect to the JMS destination: jms/WLReceiverQueue. The Error was:



 javax.jms.JMSException: JMSCS0006: An internal problem occurred. Diagnostic information for service was written to '/Oracle/Middleware/user_projects/domains/OSBDomainBasic/FFDC/JMSCC0004.FDC'. Please terminate the application as the product is in an inconsistent internal state.
        at com.ibm.msg.client.commonservices.trace.Trace.ffst(Trace.java:1386)
        at com.ibm.msg.client.jms.admin.JmsDestinationImpl.readObject(JmsDestinationImpl.java:638)
        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 java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:974)
        at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1849)
        at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
        at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
        at weblogic.rmi.extensions.server.CBVInputStream.readObject(CBVInputStream.java:64)
        at weblogic.jndi.internal.JNDIHelper.copyObject(JNDIHelper.java:28)
        at weblogic.jndi.WLSJNDIEnvironmentImpl.copyObject(WLSJNDIEnvironmentImpl.java:77)
        at weblogic.jndi.internal.WLEventContextImpl.copyObject(WLEventContextImpl.java:383)
        at weblogic.jndi.internal.WLEventContextImpl.lookup(WLEventContextImpl.java:255)
        at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:393)
        at javax.naming.InitialContext.lookup(InitialContext.java:392)
        at weblogic.jms.common.CDS$2.run(CDS.java:503)
        at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
        at weblogic.jms.common.CrossDomainSecurityManager.runAs(CrossDomainSecurityManager.java:130)
        at weblogic.jms.common.CDS.lookupDestination(CDS.java:497)
        at weblogic.jms.common.CDS.getDDMembershipInformation(CDS.java:276)
        at weblogic.ejb.container.deployer.MessageDrivenBeanInfoImpl.createMDManagers(MessageDrivenBeanInfoImpl.java:1455)
        at weblogic.ejb.container.deployer.MessageDrivenBeanInfoImpl.activate(MessageDrivenBeanInfoImpl.java:1252)
        at weblogic.ejb.container.deployer.EJBDeployer.activate(EJBDeployer.java:1320)
        at weblogic.ejb.container.deployer.EJBModule.activate(EJBModule.java:493)
        at weblogic.application.internal.flow.ModuleListenerInvoker.activate(ModuleListenerInvoker.java:227)
        at weblogic.application.internal.flow.DeploymentCallbackFlow$2.next(DeploymentCallbackFlow.java:531)
        at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:41)
        at weblogic.application.internal.flow.DeploymentCallbackFlow.activate(DeploymentCallbackFlow.java:165)
        at weblogic.application.internal.flow.DeploymentCallbackFlow.activate(DeploymentCallbackFlow.java:157)
        at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:1267)
        at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:41)
        at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:409)
        at weblogic.application.internal.EarDeployment.activate(EarDeployment.java:58)
        at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:161)
        at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:79)
        at weblogic.deploy.internal.targetserver.BasicDeployment.activate(BasicDeployment.java:184)
        at weblogic.deploy.internal.targetserver.BasicDeployment.activateFromServerLifecycle(BasicDeployment.java:361)
        at weblogic.management.deploy.internal.DeploymentAdapter$1.doActivate(DeploymentAdapter.java:51)



I also get
Exception in thread "Thread-39" java.lang.NoClassDefFoundError: com/ibm/mq/internal/MQCommonServices
 at com.ibm.mq.MQSESSION.getJmqiEnv(MQSESSION.java:134)
 at com.ibm.mq.MQQueueManagerFactory.(MQQueueManagerFactory.java:85)
 at com.ibm.mq.MQQueueManagerFactory.getInstance(MQQueueManagerFactory.java:112)
 at com.ibm.mq.MQQueueManager.(MQQueueManager.java:147)
 at com.bea.wli.sb.transports.mq.MQResiduePurgeThread.run(MQResiduePurgeThread.java:83)


which seems to be addressed here:
http://www.ibm.com/developerworks/forums/thread.jspa?threadID=236529
In this post it mentions some extra JARs for JNDI support, like mqcontext.jar....let's keep an eye on this.... this http://www-01.ibm.com/support/docview.wss?uid=swg24004684 is the support pack...


I target WLEventContextImpl and I find this:

===============================================
Found: WLEventContextImpl
Class: weblogic.jndi.internal.WLEventContextImpl
Package: weblogic.jndi.internal
Library Name: wlfullclient.jar
Library Path: /Oracle/Middleware/wlserver_10.3/server/lib/wlfullclient.jar
===============================================

===============================================
Found: WLEventContextImpl
Class: weblogic.jndi.internal.WLEventContextImpl
Package: weblogic.jndi.internal
Library Name: weblogic.jar
Library Path: /Oracle/Middleware/wlserver_10.3/server/lib/weblogic.jar
===============================================

===============================================
Found: WLEventContextImpl
Class: weblogic.jndi.internal.WLEventContextImpl
Package: weblogic.jndi.internal
Library Name: wlthint3client.jar
Library Path: /Oracle/Middleware/wlserver_10.3/server/lib/wlthint3client.jar




I get the one in weblogic.jar, decompile the weblogic.jndi.internal.WLEventContextImpl class, and find that there is no debug statement in it.... I add some sysout in the lookup and copyObject methods to find out which class is causing the error, and copy the modified weblogic.jar back...

my patched class file is in /home/osb/workspacePVPreMaven/WLPatchForMQ/bin/weblogic/jndi/internal/WLEventContextImpl.class

I run these commands to copy the 3 jars in a temp directory and patch them:

cp /home/osb/workspacePVPreMaven/WLPatchForMQ/bin/weblogic/jndi/internal/WLEventContextImpl.class ./weblogic/jndi/internal/WLEventContextImpl.class

cp /Oracle/Middleware/wlserver_10.3/server/lib/weblogic.jar .
cp /Oracle/Middleware/wlserver_10.3/server/lib/wlfullclient.jar .
cp /Oracle/Middleware/wlserver_10.3/server/lib/wlthint3client.jar .
cp wlfullclient.jar wlfullclient.jar.ORI
cp weblogic.jar weblogic.jar.ORI
cp wlthint3client.jar wlthint3client.jar.ORI


jar uvf weblogic.jar weblogic/jndi/internal/WLEventContextImpl.class
cp weblogic.jar /Oracle/Middleware/wlserver_10.3/server/lib/weblogic.jar

jar uvf wlfullclient.jar weblogic/jndi/internal/WLEventContextImpl.class
cp wlfullclient.jar /Oracle/Middleware/wlserver_10.3/server/lib/wlfullclient.jar

jar uvf wlthint3client.jar weblogic/jndi/internal/WLEventContextImpl.class
cp wlthint3client.jar /Oracle/Middleware/wlserver_10.3/server/lib/wlthint3client.jar



and to restore the files:

cp weblogic.jar.ORI /Oracle/Middleware/wlserver_10.3/server/lib/weblogic.jar
cp wlfullclient.jar.ORI /Oracle/Middleware/wlserver_10.3/server/lib/wlfullclient.jar
cp wlthint3client.jar.ORI /Oracle/Middleware/wlserver_10.3/server/lib/wlthint3client.jar


Unfortunately the patch WORKS and traces the calls to JNDI lookups, but the decompilation must have messed it up because itcannot find a queue and the WLS crashes.

With some terror I discover that connector.jar delivered with MQ 7 dates back to 2001 (JDK 1.3) and providerutil.jar dates back to 2000 (JDK 1.2).

Enabling EJB, JMS, JNDI, ClassLoader flags doesn't help. Most likely the remote JMS destination deserialization fails.



Jan-2011: interesting post here http://weblogic-wonders.com/weblogic/2010/11/24/weblogic-foreign-jms-server-configuration-with-mq-series/

No comments: