Doesn't work with clojure 1.5
Distributed load testing framework - Java, Jython, or Clojure scripts.
Brought to you by:
philipa
The problem is that in clojure 1.5.0 and 1.5.1 class clojure.lang.RT should be initialized before clojure.lang.Compiler. Check this question: http://stackoverflow.com/questions/15207596/npe-in-clojure-lang-compiler-when-trying-to-load-a-resource
I can suggest following solution: in ClojureScriptEngine add static block:
static { clojure.lang.RT.init(); }
Stacktrace of current exception:
net.grinder.engine.common.EngineException: Clojure is not on the classpath at net.grinder.scriptengine.clojure.ClojureScriptEngineService.createScriptEngine(ClojureScriptEngineService.java:56) ~[grinder-core-3.11.jar:na] at net.grinder.engine.process.ScriptEngineContainer.getScriptEngine(ScriptEngineContainer.java:81) ~[grinder-core-3.11.jar:na] at net.grinder.engine.process.GrinderProcess.run(GrinderProcess.java:404) ~[grinder-core-3.11.jar:na] at net.grinder.engine.process.WorkerProcessEntryPoint.run(WorkerProcessEntryPoint.java:86) ~[grinder-core-3.11.jar:na] at net.grinder.engine.agent.IsolatedGrinderProcessRunner.run(IsolatedGrinderProcessRunner.java:53) [grinder-core-3.11.jar:na] at net.grinder.engine.agent.DebugThreadWorker$1.run(DebugThreadWorker.java:63) [grinder-core-3.11.jar:na] Caused by: java.lang.ExceptionInInitializerError: null at clojure.lang.Compiler.<clinit>(Compiler.java:47) ~[clojure-1.5.0.jar:na] at net.grinder.scriptengine.clojure.ClojureScriptEngine.<init>(ClojureScriptEngine.java:54) ~[grinder-core-3.11.jar:na] at net.grinder.scriptengine.clojure.ClojureScriptEngineService.createScriptEngine(ClojureScriptEngineService.java:53) ~[grinder-core-3.11.jar:na] ... 5 common frames omitted Caused by: java.lang.NullPointerException: null at clojure.lang.RT.baseLoader(RT.java:2043) ~[clojure-1.5.0.jar:na] at clojure.lang.RT.load(RT.java:417) ~[clojure-1.5.0.jar:na] at clojure.lang.RT.load(RT.java:411) ~[clojure-1.5.0.jar:na] at clojure.lang.RT.doInit(RT.java:447) ~[clojure-1.5.0.jar:na] at clojure.lang.RT.<clinit>(RT.java:329) ~[clojure-1.5.0.jar:na] ... 8 common frames omitted
Fixed: https://sourceforge.net/p/grinder/code/ci/610758ea4ecb281f0c5c648c405335c342d197a5/
This issue still seems to occur in Grinder 3.11. From a clean download, if I put clojure-1.4.0.jar on the classpath, the helloworld.clj example runs. But if I put clojure-1.5.1.jar on the classpath, the agent returns the same NullPointerException as the original poster.
Would you consider re-opening this ticket?
This is fixed for the next release (3.12), see the milestone. I don't plan to release a patch against 3.11.
Its a one line change (see the comment from 29/4) if you want to hack it locally.
Sorry for the confusion. I saw "The Grinder 3.11" in the commit diff for the grinder/CHANGES file and thought it had already landed.
My apologies.
I'm trying to get meteor-load-test working and I think I'm still seeing this bug on the latest code. Here's what I've done:
-installed meteor-load-test (on OSX with homebrew)
-manually deleted all the 3.11-related files/dirs from ~/.m2/...
-pulled and built 3.12-SNAPSHOT
-edited meteor-load-test/project.clj to refer to 3.12-SNAPSHOT
-run an agent and a console, and pressed "start workers"
and here's the error I get:
...
SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]
2014-07-08 10:30:42,016 ERROR worker-bootstrap: Error running worker process
net.grinder.engine.common.EngineException: Clojure is not on the classpath
at net.grinder.scriptengine.clojure.ClojureScriptEngineService.createScriptEngine(ClojureScriptEngineService.java:56) ~[grinder-core-3.12-SNAPSHOT.jar:na]
...
I cloned from HEAD, built, and "installed":
then I ran the helloworld.clj:
The log shows Clojure 1.5.1 was used:
So it works standalone.
I suspect that Meteor is using other clojure classes before starting The Grinder. Unfortunately grinder code can't fix things that happen before it is called. This is a known weakness of the clojure runtime - http://dev.clojure.org/jira/browse/CLJ-1172.
There's some muttering in CLJ-1172 about changes. You might try running with clojure 1.6.0 first in your CLASSPATH, just to see whether its been addressed.
Otherwise, you'll have to get the meteor-load-test team to add the clojure.lang.RT.init() bootstrapping before they do anything significant with clojure.
Hi Jameson, thanks for trying meteor-load-test.
meteor-load-test is pinned to Clojure 1.4.0 and Grinder 3.11 so you shouldn't see this issue with the stock
lein deps
but I can understand wanting to use a more current version.In your repro steps I noticed that you didn't mention updating the Clojure version so maybe that is causing the issue? (not sure if Grinder 3.12 works with Clojure 1.4)
In any case, since this isn't an issue with The Grinder, please open a ticket over at https://github.com/alanning/meteor-load-test/issues and we'll figure out how to get it working.