Question
Atos Syntel
IN
Last activity: 27 Jan 2016 8:28 EST
Actions to take when you get a ClassNotFoundException error
when you get a ClassNotFoundException what are some of the very first things you do to fix it or find the cause of it (let it be any class).
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
Atos Syntel
IN
Our LSA found that one of the required jar (connector.jar) was missing, after importing the connector.jar the functionality started working.
My mistake, should have checked it first.
Would have been useful if the error message had hinted that this is related to the missing connector jar file.
Thanks for your help.
Pegasystems Inc.
IN
Hi Dilipan,
First thing to check is to verify missing class in pr_engineclasses table, whether its present there or not
Citicorp Services India Private Limited
IN
Hi Dilipan,
First we need to have a look at the logs, From logs we can figure out what to do. Primarily I have faced ClassNotFoundException with problem invoking library function and sometimes during installation & upgrade of Pega.
Could you please post the log files, so that I can try to help you out.
Thanks,
Gowrishankar.
Atos Syntel
IN
This is what i have - java.lang.ClassNotFoundException: com.ibm.mq.MQEnvironment
i had imported the third party jar (com.ibm.mq.jar) via Pega Import wizard, i can see the class com.ibm.mq.MQEnvironment listed in pr_engineclasses table, but when i try to lookup the Java class in ETier Runtime Environment in SMA i get "class not found" response.
This issue is occurring in only region (QA), the mq jar is working fine in other regions.
Pegasystems Inc.
US
Can you show the response of SMA for the working env? Also show the pr_engineclasses table entry of the class in question, again for both working and non-working env.
Atos Syntel
IN
Have attached them.
Pegasystems Inc.
US
check your non-working env, to see if the DSS: properties/com.pega.pegarules.bootstrap.codeset.version.mq/default is defined or not.
Atos Syntel
IN
yes it is there with the correct version that i had mentioned during the import.
Pegasystems Inc.
US
that is strange, please show me the DSS screen for both working and non-working env. Also check prbootstrap.properties files for both env, maybe they are externalized.
Atos Syntel
IN
Please find the screenshots of the DSS in the attached zip file.
I cross checked the contents of prbootstrap.properties from both env, they are identical.
Pegasystems Inc.
US
can u please share the prbootstrap.properties for both envs?
Atos Syntel
IN
Please find them in the attached zip file.
Pegasystems Inc.
US
We have gone through the full sanity checks, if you still have issue, create a SR for further investigation.
Accepted Solution
Atos Syntel
IN
Our LSA found that one of the required jar (connector.jar) was missing, after importing the connector.jar the functionality started working.
My mistake, should have checked it first.
Would have been useful if the error message had hinted that this is related to the missing connector jar file.
Thanks for your help.
Pegasystems Inc.
US
great to hear. thanks for the quick reply! Please mark this item complete.
Pegasystems Inc.
US
BTW, I do expect the error message related to the missing jar if you check the full error stack on the server side (search for caused by ....). Also be aware of importing like connector.jar can sometimes cause incompatible class versions within prpc. In that case, the approach here is still applicable.
Atos Syntel
IN
Understood
Pegasystems Inc.
IN
Did you restart application server after importing thie mq.jar through Pega App?
Atos Syntel
IN
yes, i did.
Pegasystems Inc.
US
First of all, you would like to review the complete error stack to find "caused by" details. ClassNotFoundException can be caused by other reasons, for example, during engine startup there are issues with database connectivity, rulebase not loaded correctly or the rules/data schema not specified correctly, etc. Secondly, if your final root cause is ClassNotFoundException during class Foo (fully qualified class name), then you can use SMA>>Advanced>>ETier runtime to look up the class to see if you get the same ClassNotFoundException or not (most of the time that should be the case). Once that is confirmed, you can review if this class is from pega or from your own. If it is from your own, you can normally import the jar to pega database using import wizard and recycle the server. However, be aware of potential conflicts of your own jars, if that is the case (e.g., some of the jars have the same class/interface as the OOTB pega distribution). If that is the case, it is better to include your jars in the app server classpath (pending on app server, for example, websphere uses shared lib), again the SMA utility will come handy to find out the potential conflicts.