Question

Unable to find Spring classes from Pega database

We are trying to set up shared library for Pega 7.2 in Websphere 8.x. We created the shared library with custom jars and have referenced the shared library in the classloader. We have updated the DSS with the shared library path. We are running into issues when trying to test application that uses the custom jar in the shared location. Its able to find the custom java class but failing to find a spring class which is in the pega database(pr_engineclasses). Below is the stack trace. Any thoughts on why it is not able to find the class from database?

com.pega.pegarules.pub.PRRuntimeError: PRRuntimeError

        at com.pega.pegarules.session.internal.mgmt.base.ThreadRunner.runActivitiesAlt(ThreadRunner.java:712)

        at com.pega.pegarules.session.internal.mgmt.PRThreadImpl.runActivitiesAlt(PRThreadImpl.java:466)

        at com.pega.pegarules.integration.engine.internal.services.ServiceAPI.runActivities(ServiceAPI.java:1896)

        at com.pega.pegarules.session.external.engineinterface.service.EngineAPI.processRequestInner(EngineAPI.java:390)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)

        at java.lang.reflect.Method.invoke(Method.java:611)

        at com.pega.pegarules.session.internal.PRSessionProviderImpl.performTargetActionWithLock(PRSessionProviderImpl.java:1277)

        at com.pega.pegarules.session.internal.PRSessionProviderImpl.doWithRequestorLocked(PRSessionProviderImpl.java:1015)

        at com.pega.pegarules.session.internal.PRSessionProviderImpl.doWithRequestorLocked(PRSessionProviderImpl.java:848)

        at com.pega.pegarules.session.external.engineinterface.service.EngineAPI.processRequest(EngineAPI.java:331)

        at com.pega.pegarules.integration.engine.internal.services.jms.JMSListener.handleRequest(JMSListener.java:1267)

        at com.pega.pegarules.integration.engine.internal.services.jms.JMSListener.runOnce(JMSListener.java:709)

        at com.pega.pegarules.integration.engine.internal.services.jms.JMSListenerServant.invoke(JMSListenerServant.java:112)

        at com.pega.pegarules.session.internal.engineinterface.etier.impl.EngineImpl._invokeEngine_privact(EngineImpl.java:327)

        at com.pega.pegarules.session.internal.engineinterface.etier.impl.EngineImpl.invokeEngine(EngineImpl.java:270)

        at com.pega.pegarules.session.internal.engineinterface.etier.ejb.EngineBean.invokeEngine(EngineBean.java:225)

        at sun.reflect.GeneratedMethodAccessor75.invoke(Unknown Source)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)

        at java.lang.reflect.Method.invoke(Method.java:611)

        at com.pega.pegarules.internal.bootstrap.PRBootstrap.invokeMethod(PRBootstrap.java:370)

        at com.pega.pegarules.internal.bootstrap.PRBootstrap.invokeMethodPropagatingThrowable(PRBootstrap.java:411)

        at com.pega.pegarules.boot.internal.extbridge.AppServerBridgeToPega.invokeMethodPropagatingThrowable(AppServerBridgeToPega.java:224)

        at com.pega.pegarules.boot.internal.extbridge.AppServerBridgeToPega.invokeMethodPropagatingException(AppServerBridgeToPega.java:246)

        at com.pega.pegarules.internal.etier.ejb.EngineBeanBoot.invokeEngine(EngineBeanBoot.java:168)

        at com.pega.pegarules.internal.etier.interfaces.EJSLocalStatelessEngineBMT_f2439d86.invokeEngine(Unknown Source)

        at com.pega.pegarules.session.internal.engineinterface.etier.mdb.PRJMSListener.callEngine(PRJMSListener.java:208)

        at com.pega.pegarules.session.internal.engineinterface.etier.mdb.PRJMSListener.onMessage(PRJMSListener.java:130)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)

        at java.lang.reflect.Method.invoke(Method.java:611)

        at com.pega.pegarules.internal.bootstrap.PRBootstrap.invokeMethod(PRBootstrap.java:370)

        at com.pega.pegarules.internal.bootstrap.PRBootstrap.invokeMethodPropagatingThrowable(PRBootstrap.java:411)

        at com.pega.pegarules.boot.internal.extbridge.AppServerBridgeToPega.invokeMethodPropagatingThrowable(AppServerBridgeToPega.java:224)

        at com.pega.pegarules.boot.internal.extbridge.AppServerBridgeToPega.invokeMethod(AppServerBridgeToPega.java:273)

        at com.pega.pegarules.internal.etier.mdb.PRJMSListenerBoot.onMessage(PRJMSListenerBoot.java:91)

        at com.ibm.ejs.jms.listener.MDBWrapper$PriviledgedOnMessage.run(MDBWrapper.java:309)

        at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:63)

        at com.ibm.ejs.jms.listener.MDBWrapper.callOnMessage(MDBWrapper.java:266)

        at com.ibm.ejs.jms.listener.MDBWrapper.onMessage(MDBWrapper.java:235)

        at com.ibm.mq.jms.MQSession$FacadeMessageListener.onMessage(MQSession.java:147)

        at com.ibm.msg.client.jms.internal.JmsSessionImpl.run(JmsSessionImpl.java:2846)

        at com.ibm.mq.jms.MQSession.run(MQSession.java:862)

        at com.ibm.ejs.jms.JMSSessionHandle.run(JMSSessionHandle.java:1058)

        at com.ibm.ejs.jms.listener.ServerSession.connectionConsumerOnMessage(ServerSession.java:1090)

        at com.ibm.ejs.jms.listener.ServerSession.onMessage(ServerSession.java:760)

        at com.ibm.ejs.jms.listener.ServerSession.dispatch(ServerSession.java:726)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)

        at java.lang.reflect.Method.invoke(Method.java:611)

        at com.ibm.ejs.jms.listener.ServerSessionDispatcher.dispatch(ServerSessionDispatcher.java:47)

        at com.ibm.ejs.container.MDBWrapper.onMessage(MDBWrapper.java:98)

        at com.ibm.ejs.container.MDBWrapper.onMessage(MDBWrapper.java:135)

        at com.ibm.ejs.jms.listener.ServerSession.run(ServerSession.java:581)

        at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1691)

Caused by:

java.lang.NoClassDefFoundError: org.springframework.context.support.ClassPathXmlApplicationContext

        at com.fepoc.eob.service.PersistenceServiceFactory.<clinit>(PersistenceServiceFactory.java:14)

        at java.lang.J9VMInternals.initializeImpl(Native Method)

        at java.lang.J9VMInternals.initialize(J9VMInternals.java:236)

        at java.lang.Class.forNameImpl(Native Method)

        at java.lang.Class.forName(Class.java:179)

        at com.pegarules.generated.activity.ra_action_invoke_d0ac00606040955e7e296725cd7cc4fa.step4_circum0(ra_action_invoke_d0ac00606040955e7e296725cd7cc4fa.java:572)

        at com.pegarules.generated.activity.ra_action_invoke_d0ac00606040955e7e296725cd7cc4fa.perform(ra_action_invoke_d0ac00606040955e7e296725cd7cc4fa.java:120)

        at com.pega.pegarules.session.internal.mgmt.Executable.doActivity(Executable.java:3510)

         at com.pegarules.generated.activity.ra_action_invoke_d0ac00606040955e7e296725cd7cc4fa.perform(ra_action_invoke_d0ac00606040955e7e296725cd7cc4fa.java:120)

        at com.pega.pegarules.session.internal.mgmt.Executable.doActivity(Executable.java:3510)

        at com.pegarules.generated.activity.ra_action_starteobmessaging_cb9041c926490d34d22744a0819841a9.step6_circum0(ra_action_starteobmessaging_cb9041c926490d34d22744a0819841a9.java:698)

                                                                                                                                                                                         at com.pegarules.generated.activity.ra_action_sta

rteobmessaging_cb9041c926490d34d22744a0819841a9.perform(ra_action_starteobmessaging_cb9041c926490d34d22744a0819841a9.java:168)

                                                                                                                                at com.pega.pegarules.session.internal.mgmt.Executable.doActivity(Executable.java:3510)

        at com.pega.pegarules.session.internal.mgmt.base.ThreadRunner.runActivitiesAlt(ThreadRunner.java:646)

        ... 57 more

Caused by:

java.lang.ClassNotFoundException: org.springframework.context.support.ClassPathXmlApplicationContext

        at java.net.URLClassLoader.findClass(URLClassLoader.java:434)

        at com.ibm.ws.bootstrap.ExtClassLoader.findClass(ExtClassLoader.java:204)

        at java.lang.ClassLoader.loadClassHelper(ClassLoader.java:688)

        at java.lang.ClassLoader.loadClass(ClassLoader.java:667)

        at com.ibm.ws.bootstrap.ExtClassLoader.loadClass(ExtClassLoader.java:119)

        at java.lang.ClassLoader.loadClass(ClassLoader.java:650)

        at com.ibm.ws.classloader.ProtectionClassLoader.loadClass(ProtectionClassLoader.java:62)

        at com.ibm.ws.classloader.ProtectionClassLoader.loadClass(ProtectionClassLoader.java:58)

        at com.ibm.ws.classloader.CompoundClassLoader.loadClass(CompoundClassLoader.java:566)

        at java.lang.ClassLoader.loadClass(ClassLoader.java:650)

        ... 69 more

***Updated by Moderator: Marissa to add SR details that didn't migrate over***

**Moderation Team has archived post**

This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.

Group Tags

Correct Answer
November 18, 2016 - 9:23am

Hello!

On reviewing the SR, we noticed that the issue has been resolved after importing the missing terracotta toolkit JAR files.

Regards,
Lochan  |  Community Moderator  |  Pegasystems Inc.

Comments

Keep up to date on this post and subscribe to comments

June 17, 2016 - 1:45pm

Hi Sandeep,

Can you please check whether this class is present in pr_engineclasses table?

June 18, 2016 - 3:55am

Hi Sandeep,

I have a doubt on this below particular class(PersistenceServiceFactory.java) which may not have the dependent jars related to org.springframework.context.support.ClassPathXmlApplicationContext .

  1. java.lang.NoClassDefFoundError: org.springframework.context.support.ClassPathXmlApplicationContext

at com.fepoc.eob.service.PersistenceServiceFactory.<clinit>(PersistenceServiceFactory.java:14)

June 18, 2016 - 9:28am
Response to ArunMahanty

You are on the right track, for 3rd party jars, please test the classloading using a standalone java program (use Class.forName("org.springframework.context.support.ClassPathXmlApplicationContext") in your program).  Also, if you use the shared lib approach, you should put all custom jars to shared lib to test instead of importing them to pega db (doing both would be a problem for the same jar).

June 18, 2016 - 10:43am

Hi All,

Thanks for all the replies.

PersistenceServiceFactory is our custom class in a Persistence jar located in the shared lib which is dependent on the above spring class which happens to be in the pr_engineclasses table in the spring context jar. When we lookup this java class from SMA via Etier Runtime, it is pointing to pegajdbc://xxxxxxxxxx:0/spring-context.jar which I am sure is coming from pega database but somehow it is giving class not found exception when trying to test our custom Persistence jar

Pega I believe has about 6 spring related jar in the database. So, we have only put other spring jars other than these 6 in the shared lib along with our custom jars.

One thing what we have noticed is pega loading two classpaths pegajdbc://xxxxxxxxxx:0 and pegajdbc://xxxxxxxxxx:1. And, I believe all pega jars are in loaded into the 0 classpath and we wonder if the application is looking into classpath 1 and not able to find the jars. The server startup log does say it is using genClassPath: pegajdbc://xxxxxxxxxx:1. Not sure how to go about it

June 18, 2016 - 11:05am
Response to svpunugu

try put all your jars (including dependent jars) at the share lib level (after testing standalone program successfully). Looks like your version of those 6 jars are not compatible with those from pega.

June 20, 2016 - 2:17pm

An SR was opened with GCS for additional support on this issue.

June 20, 2016 - 2:19pm
Response to SylorgaetanoSchinco

Thank you Syl! I have updated the original post with the SR therefore connecting this post with it!

Marissa | Community Moderator | Pegasystems Inc.

Mod
November 18, 2016 - 9:23am

Hello!

On reviewing the SR, we noticed that the issue has been resolved after importing the missing terracotta toolkit JAR files.

Regards,
Lochan  |  Community Moderator  |  Pegasystems Inc.

Lochana | Community Moderator | Pegasystems Inc.