rmiesapi

RMI, ESAPI, and java.lang.NoClassDefFoundError: org/owasp/esapi/errors/IntrusionException


I have a program that uses RMI and also the latest version of ESAPI. I have it installed on two different machines. I have looked at everything I can think of in my installation, and it all seems the same. My program runs properly on one of the machines, but on the other I get the following:

Exception in thread "main" java.lang.Exception: Unable to start initial instance: of ReportServer. Exception: java.rmi.activation.ActivateFailedException: activation failed; nested exception is: 
    java.rmi.activation.ActivationException: object activation failed after 2 tries; nested exception is: 
    java.rmi.ServerError: Error occurred in server thread; nested exception is: 
    java.lang.NoClassDefFoundError: org/owasp/esapi/errors/IntrusionException
    at com.xxx.management.common.reports.ServerActivator.register(ServerActivator.java:185)
    at com.xxx.management.common.reports.ServerActivator.main(ServerActivator.java:94)

I would typically post more info as part of an initial question, but I am not sure what y'all would want to see. Happy to provide more.


Solution

  • Yeah, you track down this no differently than any other class that results in a NoClassDefFoundError. If you're using the latest version of ESAPI, start by searching for 'esapi-2.5.0.0.jar' and make sure that it is located in a place that is in your CLASSPATH. Since it's working on 1 machine and not the other, search on both and ask "what is different between these 2 machines" that may cause it. Also, maybe just start small, with a main() calling ESAPI.logger() and then try to log something. If you still get the error, try verbose class loading ('-verbose:class') to see if that helps. Beyond that, we definitely need more info.