JavaActionEvent failed: PxEnvironmentException: class cannot be found in classpath

Document ID : KB000075516
Last Modified Date : 19/04/2018
Show Technical Document Details
Question:
We are trying to execute a java file which is placed in a jar file by calling it from an action of a policy Xpress. We are getting the below error. Complete log for this task is attached to the case. Please let us know if the jar should be added to any configuration file/placed in a particular location. The jar is currently placed in the following locations /amp/apps/wsidm00/wsidm-c01/installedApps/wsidm-c01/iam_im.ear/user_console.war/WEB-INF/lib and /amp/apps/wsidm00/wsidm-c01/installedApps/wsidm-c01/iam_im.ear/custom/isim/ com.ca.identitymanager.policyxpress.exceptions.PxEnvironmentException: Class isim.com.ameriprise.isimtest.TestISIMWS cannot be found in classpath at com.ca.identitymanager.policyxpress.plugins.shared.JavaClassAction.execute(JavaClassAction.java:37) at com.ca.identitymanager.policyxpress.plugins.events.JavaActionEvent.execute(JavaActionEvent.java:50) at com.netegrity.ims.businessprocess.IMSEventController.executing(IMSEventController.java:265) at com.netegrity.ims.businessprocess.IMSController.executing(IMSController.java:58) at com.netegrity.ims.bootstrap.IMSMessageListener.processEventToNextSavePoint(IMSMessageListener.java:382) at com.netegrity.ims.bootstrap.IMSMessageListener.processToEndState(IMSMessageListener.java:205) at com.netegrity.ims.bootstrap.IMSMessageListener.onMessage(IMSMessageListener.java:167) at com.netegrity.ejb.message.subscriber.SubscriberMessageBean.onMessage(SubscriberMessageBean.java:71) at com.ibm.ejs.container.WASMessageEndpointHandler.invokeJMSMethod(WASMessageEndpointHandler.java:138) at com.ibm.ws.ejbcontainer.mdb.MessageEndpointHandler.invokeMdbMethod(MessageEndpointHandler.java:1146) at com.ibm.ws.ejbcontainer.mdb.MessageEndpointHandler.invoke(MessageEndpointHandler.java:844) at com.sun.proxy.$Proxy63.onMessage(Unknown Source) at com.ibm.ws.sib.api.jmsra.impl.JmsJcaEndpointInvokerImpl.invokeEndpoint(JmsJcaEndpointInvokerImpl.java:258) at com.ibm.ws.sib.ra.inbound.impl.SibRaDispatcher.dispatch(SibRaDispatcher.java:919) at com.ibm.ws.sib.ra.inbound.impl.SibRaSingleProcessListener$SibRaWork.run(SibRaSingleProcessListener.java:597) at com.ibm.ejs.j2c.work.WorkProxy.run(WorkProxy.java:669) at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1892) Caused by: java.lang.ClassNotFoundException: isim.com.ameriprise.isimtest.TestISIMWS at java.lang.Class.forNameImpl(Native Method) at java.lang.Class.forName(Class.java:256) at com.ca.identitymanager.policyxpress.plugins.shared.JavaClassAction.execute(JavaClassAction.java:35) ... 16 more [3/21/18 11:48:37:772 GMT] 000006c1 SystemOut O 11:48:37,772 ERROR [com.netegrity.ims.exception.EventExecuteStateException] Execution of event: JavaActionEvent failed. Exception encountered: PxEnvironmentException:Class isim.com.ameriprise.isimtest.TestISIMWS cannot be found in classpath Error from IDM user console: Failed to execute JavaActionEvent. ERROR MESSAGE: PxEnvironmentException:Class com.ameriprise.isimtest.TestISIMWS cannot be found in classpath
Answer:
To load a custom jar in the classpath is a bit difficult. The log snipet that you have given from WAS does not show the server preamble where the base classpath would be shown. There is nothing in our docs for adding a custom jar file to be accessed in policy express, so you would have to add the class to the WAS classpath then access it from the base WAS. We were able to call the java class file by updating the file location in application server's classpath.