Friday, December 24, 2010

WPS - Event sequencing for MQ activation spec in WPS7

From WPS7, IBM retired old listener port concept and replaced it with new MQ Activation Spec.

However, if the MQ activationSpec is not set up correctly in Cluster environment, the Event sequencing may not work.

In cluster environment, you have to create MQ Activation spec on each server level in the cluster, and assure only one MQ Activation Spec running.

Before going through the following steps, an ifix IZ86196 must be applied to make event sequencing work. please ask IBM for this ifix matched to your WAS version.

here is the examples how to set up MQ Activation Spec for event sequencing

(1) assume you have one cluster with two application servers (server1 and server2)

(2) go to administrative console, and then go to Resources->JMS->Activation Specifications

(3) create the MQ Activation Spec on eache server scope.

(4) after creating the MQ Activation Spec, go to created Activation Spec Custom properties, add the following property:

WAS_EndpointInitalState

and set it as true on server1 scope and set it as false on server2 scope.

(5) change another property maxPoolSize as 1 on both servers

(6) also go to Activation spec's advanced properties, and set the maximum server sessions as 1 on both servers

(7) restart the server.

after restarting the server, the activation spec will be only running on one server, which assure the event squencing working

following jython script will let you change the stop or start MQ activation spec on another server

import sys

if len(sys.argv)<2:
print "Usage:changeASStatus.jy ASName ServerName action"
sys.exit()

if len(sys.argv)>1:
ASName=sys.argv[0]
serverName=sys.argv[1]

if len(sys.argv)>2:
Action=sys.argv[2]
else:
Action=""

print "--------------------------------------------------"
id=AdminControl.queryNames('type=J2CMessageEndpoint,ActivationSpec='+ASName+','+'process='+serverName+',*')

status=AdminControl.invoke(id,'getStatus')

print ASName+"'s current status:"+status
print "note: 1 (Active), 2 (Inactive), 3 (Stopped)"
print "-------------------------------------------------------"

if Action=="start":

print "starting the ActivationSpec "+ASName
try:
AdminControl.invoke(id,'resume')
print "ActivationSpec "+ASName+" started on server:"+serverName
except:
print "ActivationSpec "+ASNAme+" could not be started on server:"+serverName,sys.exc_info()[1]

if Action=="stop":

print "stopping the ActivationSpec "+ASName
try:
AdminControl.invoke(id,'pause')
print "ActivationSpec "+ASName+" stopped on server:"+serverName
except:
print "ActivationSpec "+ASNAme+" could not be stopped on server:"+serverName,sys.exc_info()[1]

if Action=="":
print ""

 

Wednesday, December 22, 2010

WPS - SCA trace causes the SCA module NullPointerException

Noticed that transaction rollback in the SystemOut.log, like:
[11/29/10 21:42:53:499 EST] 0000006a Recovery      I com.ibm.wbiserver.
management.FailedEventManagerMBean resubmitFailedEvents(List)
CWRCV0033I: The following number of failed events was resubmitted
successfully: "1".
[11/29/10 21:42:54:426 EST] 00000036 MA_IBISSTARSD I begin
createOutb_Bpi_Msg_Stars: msg_id=1400010275, orderid=2010-11-29 16:48:
56.455674
[11/29/10 21:42:55:699 EST] 00000036 ESWorkBean E com.ibm.wbiserver.
sequencing.work.ESWorkBean processMessageInBifurcatedSession
CWRES0016E: The message with msgId=8FD53ADC8A049ECB_6000087 and the
transaction will be rolled back. The exception is Fail to invoke [sca.
component.java.impl.Component1Impl3.public void sca.component.java.impl.
Component1Impl3.createOutb_Bpi_Msg_Stars(commonj.sdo.DataObject)] for
component [{MA_IBISSTARSDb}StarsBGtoBO].
[11/29/10 21:42:56:331 EST] 00000036 LocalExceptio E CNTR0020E: EJB
threw an unexpected (non-declared) exception during invocation of
method "processMessageInBifurcatedSession" on bean "BeanId
(persistentLkMgr#persistentLkMgrEJB.jar#ESWork, null)". Exception data:
com.ibm.wbiserver.sequencing.exceptions.SequencingRuntimeException:
CWRES0015E: The message with msgId=8FD53ADC8A049ECB_6000087 failed
during processing. The error is Fail to invoke [sca.component.java.impl.
Component1Impl3.public void sca.component.java.impl.Component1Impl3.
createOutb_Bpi_Msg_Stars(commonj.sdo.DataObject)] for component
[{MA_IBISSTARSDb}StarsBGtoBO].
at com.ibm.wbiserver.sequencing.work.ESWorkBean.processMessage
(ESWorkBean.java:177)
at com.ibm.wbiserver.sequencing.work.ESWorkBean.
processMessageInBifurcatedSession(ESWorkBean.java:101)
at com.ibm.wbiserver.sequencing.work.
EJSLocalStatelessESWork_ddc8f6c2.processMessageInBifurcatedSession
(Unknown Source)
at com.ibm.wbiserver.sequencing.work.EsWorkImpl.run(EsWorkImpl.
java:235)
at com.ibm.ws.asynchbeans.J2EEContext$RunProxy.run(J2EEContext.
java:268)
at java.security.AccessController.doPrivileged(AccessController.
java:224)
at javax.security.auth.Subject.doAs(Subject.java:495)
at com.ibm.websphere.security.auth.WSSubject.doAs(WSSubject.
java:131)
at com.ibm.websphere.security.auth.WSSubject.doAs(WSSubject.
java:89)
at com.ibm.ws.asynchbeans.J2EEContext$DoAsProxy.run(J2EEContext.
java:335)
at java.security.AccessController.doPrivileged(AccessController.
java:251)
at com.ibm.ws.asynchbeans.J2EEContext.run(J2EEContext.java:777)
at com.ibm.ws.asynchbeans.WorkWithExecutionContextImpl.go
(WorkWithExecutionContextImpl.java:222)
at com.ibm.ws.asynchbeans.ABWorkItemImpl.run(ABWorkItemImpl.
java:159)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1550)
Caused by: com.ibm.websphere.sca.ServiceRuntimeException: Fail to
invoke [sca.component.java.impl.Component1Impl3.public void sca.
component.java.impl.Component1Impl3.createOutb_Bpi_Msg_Stars(commonj.
sdo.DataObject)] for component [{MA_IBISSTARSDb}StarsBGtoBO]: caused
by: java.lang.NullPointerException
at com.ibm.ws.sca.internal.java.handler.
JavaImplementationHandler.invokeSync(JavaImplementationHandler.java:473)
at com.ibm.ws.sca.internal.java.handler.
JavaImplementationHandler.processMessage(JavaImplementationHandler.java:
306)

The transactions kept failling.

The root cause is the trace "SCA.*=all" caused this problem. After disabling the trace "SCA.*=all",
the transactions were going well.

IBM provided an ifix to solve this issue JR37651 to solve this issue.

WebSphere - Exported EAR (Enhance EAR) could not started after deployed on WPS7

On WPS7, an exported EAR file from one WebSphere environment could mot started after deployed on another WebSphere environment. When you start the deployed module, you may see the following error in the log:

[12/21/10 16:56:31:809 EST] 0000002c FfdcProvider  W com.ibm.ws.ffdc.impl.FfdcProvider logIncident FFDC1003I: FFDC Incident emitted
on /IBM2/wpsProfiles/tx1Node01/logs/ffdc/uat01Cell.AppTarget.tx1Node01.0_6a306a30_10.12.21_16.56.31.6896290038486030221913.txt com.i
bm.ws.metadata.bindings.EJBModuleHelper.processBindingsFile 199
[12/21/10 16:56:31:818 EST] 0000002c EJBModuleHelp E   CNTR0146E: The META-INF/ibm-ejb-jar-bnd.xml bindings file contained in the MA
_RSDChangeTicketEJB.jar module has a configuration error at line number: 5, column number: 131.
[12/21/10 16:56:34:348 EST] 0000002c FfdcProvider  W com.ibm.ws.ffdc.impl.FfdcProvider logIncident FFDC1003I: FFDC Incident emitted
on /IBM2/wpsProfiles/tx1Node01/logs/ffdc/uat01Cell.AppTarget.tx1Node01.0_6a306a30_10.12.21_16.56.31.8253759099213016881532.txt com.i
bm.ws.runtime.component.EJBContainerImpl.createMetaData 3439
[12/21/10 16:56:34:356 EST] 0000002c EJBContainerI E   WSVR0039E: Unable to start EJB jar, MA_RSDChangeTicketEJB.jar: CNTR0146E: The
META-INF/ibm-ejb-jar-bnd.xml bindings file contained in the MA_RSDChangeTicketEJB.jar module has a configuration error at line numb
er: 5, column number: 131.
[12/21/10 16:56:34:359 EST] 0000002c DeployedAppli W   WSVR0206E: Module, MA_RSDChangeTicketEJB.jar, of application, MA_RSDChangeTic
ketApp.ear/deployments/MA_RSDChangeTicketApp, failed to start

Solution:

IBM provided a workaround for this issue:

1) Open Export EAR using any compression software (Ex. 7-Zip)
2) Navigate to "META-INF" folder. (Ex. MA_RSDChangeTicketApp.ear\META-INF\)
3) Open "MANIFEST.MF"
4) Add following line in "MANIFEST.MF"
GeneratedVersion: 7.0.0.0
5) Save "MANIFEST.MF"

this workaround works.

IBM are working on the ifix to solve this issue. will let you know when I get it.

 

Tuesday, December 21, 2010

WebSphere-Get Runtime JVM heapsize

The following script can be used to get the current JVM HeapSize:

serverJVM=AdminControl.completeObjectName(’type=JVM,process=server1,*’)

serverJVMObj=AdminControl.makeObjectName(serverJVM)

perf=AdminControl.completeObjectName(’type=Perf,process=server1,*’)

perfObj=AdminControl.makeObjectName(perf)

jvmObj=AdminControl.invoke_jmx(perfObj,’getStatsObject’,[serverJVMObj,java.lang.Boolean('false')],['javax.management.ObjectName','java.lang.Boolean'])

currentHeapsize=jvmObj.getStatistic(’HeapSize’).getCurrent()
usedMemory=jvmObj.getStatistic(’UsedMemory’).getCount()
usage=float(usedMemory)/float(currentHeapsize)*100

print serverName+” –> “+str(currentHeapsize)+”K –> “+str(usedMemory)+”K –> “+”Usage:%.2f” % usage+”%”

This script will print current heap size and used memory of JVM.