I'm learning Grinder 3.11 to script my performance tests. Here's my test script written in Jython:
from java.lang import ClassLoader
from com.fasterxml.jackson.databind import ObjectMapper
from java.net import URL, URLClassLoader
cl = ClassLoader.getSystemClassLoader()
for url in cl.getURLs():
print url.getFile()
class TestRunner:
def __call__(self):
self.test_scenario()
When I launch it with Grinder I keep getting the following error
2015-03-16 11:52:56,783 ERROR krk-mpfxv-16: aborting process - Java exception initialising test script
net.grinder.scriptengine.jython.JythonScriptExecutionException: Java exception initialising test script
from com.fasterxml.jackson.databind import ObjectMapper
File "/Users/mgawinec/projects/grinder-test/src/test/resources/./krk-mpfxv-file-store/current/grinder.py", line 4, in <module>
java.lang.NoClassDefFoundError: Could not initialize class com.fasterxml.jackson.databind.ObjectMapper
at java.lang.Class.forName0(Native Method) ~[na:1.8.0_05]
at java.lang.Class.forName(Class.java:340) ~[na:1.8.0_05]
When I commented the import for jackson
library and printed the jars in classpath with the rest of the script I got
/Users/xx/projects/grinder-test/src/test/resources/lib/grinder.jar
/Users/xx/projects/grinder-test/src/test/resources/lib/jackson-databind-2.2.3.jar
/Users/xx/projects/grinder-test/src/test/resources/lib/htmlcleaner-2.6.1.jar
/Users/xx/projects/grinder-test/src/test/resources/lib/jackson-core-2.0.0.jar
/Users/xx/projects/grinder-test/src/test/resources/lib/grinder-dcr-agent-3.11.jar
And after double-checking I can confirm that ObjectMapper
class is in the right package in the jackson-databind-2.2.3.jar
.
I didn't have such problems with other external libraries in Jython/Grinder combination.
How can I find what is the root cause of the problem?