I've searched Ant tutorials and JBehave tutorials all over and haven't
figured this out.

It seems like the jars/directories in my classpath defined in build.xml file
are not geting set when I run scenarioRunner via Ant.  If I manually add
Jars and my classes directory to my classpath it works fine.  Also, the
build (javac) task seems to be using the classpath fine.

My build.xml is simple, see at: http://gist.github.com/466055

I want the task "ant run-scenarios" to run only using lib/java/*.jar and
bin/ in the classpath, and ignore (unset) my CLASSPATH env variable.

When I run it I get:

run-scenarios:
[scenarioRunner] DistributionFactoryException:
java.lang.NullPointerException
[scenarioRunner] at DistributionFactory.<init>(DistributionFactory.java:20)
[scenarioRunner] at DistributionSteps.<init>(DistributionSteps.java:28)
[scenarioRunner] at
JavaLocalDistributionScenario.<init>(JavaLocalDistributionScenario.java:23)
...
[scenarioRunner] Caused by: java.lang.NullPointerException
[scenarioRunner] at ClassManager.<init>(ClassManager.java:30)
[scenarioRunner] at DistributionFactory.<init>(DistributionFactory.java:18)
[scenarioRunner] ... 30 more

The NullPointerException is because
ScriptEngineManager.new.getEngineByName("jruby") returns despite
jruby-complete.jar being in lib/java.

Maybe this is just my misunderstanding of how Ant works, but nobody in the
Java community spotted anything wrong with my build file, so I'm hoping you
guys can help.

Thanks in advance!

Reply via email to