Hi I'm trying to use the Ant task to launch many
solex session at one time.
I use this ant file.
<?xml version="1.0" encoding="ISO-8859-1"?>
<project name="solex-test" default="Solex"
basedir=".">
<property name="preferedHost" value="www.zzzzzzz.it"/>
<!--
<property name="preferedHost"
value="localhost:8080"/>
set the solex task "preferedHost"
property to the tested server.
ex:
<solex
session="workspace\com.neomalogic.solex\ant\te
st.slx"
result="workspace\com.neomalogic.solex\ant\res
ult.xml"
xsl="../xsl/simple.xsl"
preferedHost="${preferedHost}"
loop="5"/>
-->
<path id="solex-jar">
<filelist
dir="D:\Programmi\eclipse_php\plugins\com.neomalogic.s
olex_0.5.3.rc1" files="solex.jar"/>
<fileset
dir="D:\Programmi\eclipse_php\plugins\com.neomalogic.s
olex_0.5.3.rc1\lib"><include
name="**/*.jar"/></fileset>
<fileset
dir="D:\Programmi\eclipse_php\plugins\org.apache.ant_1
.6.5\lib"><include name="**/*.jar"/></fileset>
<fileset
dir="D:\Programmi\eclipse_php\plugins"><include
name="**/*.jar"/></fileset>
</path>
<taskdef name="solex"
classname="com.neomalogic.solex.player.ant.Ant
SessionPlayer"
classpathref="solex-jar"/>
<target name="Solex" description="Test the new
Solex Ant task">
<solex
session="D:/Eclipse_PHP_WorkSpace/prova2/TestP
ulsanteNuovo.slx"
result="result.xml"
preferedHost="${preferedHost}"
loop="1"/>
</target>
</project>
Using Eclipse, the task start but it throws these
exceptions:
Buildfile:
D:\Eclipse_311_Workspace\ProvaTest\build.xml
Solex:
[solex] Start loop n° 1/1 of the session:
D:/Eclipse_PHP_WorkSpace/prova2/TestPulsanteNuovo.slx
[solex] java.lang.NullPointerException
[solex] at
com.neomalogic.solex.player.ant.AntSessionPlayer.playN
extRequest(AntSessionPlayer.java:242)
[solex] at
com.neomalogic.solex.player.ant.AntSessionPlayer.run
(AntSessionPlayer.java:208)
[solex] at
com.neomalogic.solex.player.ant.AntSessionPlayer.execu
te(AntSessionPlayer.java:144)
[solex] at
org.apache.tools.ant.UnknownElement.execute
(UnknownElement.java:275)
[solex] at org.apache.tools.ant.Task.perform
(Task.java:364)
[solex] at org.apache.tools.ant.Target.execute
(Target.java:341)
[solex] at
org.apache.tools.ant.Target.performTasks
(Target.java:369)
[solex] at
org.apache.tools.ant.Project.executeSortedTargets
(Project.java:1216)
[solex] at
org.apache.tools.ant.Project.executeTarget
(Project.java:1185)
[solex] at
org.apache.tools.ant.helper.DefaultExecutor.executeTar
gets(DefaultExecutor.java:40)
[solex] at
org.eclipse.ant.internal.ui.antsupport.EclipseDefaultE
xecutor.executeTargets(EclipseDefaultExecutor.java:32)
[solex] at
org.apache.tools.ant.Project.executeTargets
(Project.java:1068)
[solex] at
org.eclipse.ant.internal.ui.antsupport.InternalAntRunn
er.run(InternalAntRunner.java:423)
[solex] at
org.eclipse.ant.internal.ui.antsupport.InternalAntRunn
er.main(InternalAntRunner.java:137)
One for every GET
Logged In: YES
user_id=15514
We are seeing this error as well when running the Ant
Launcher. Note that the user documentation
(http://solex.sourceforge.net/) does not document the Ant
launcher as usable; it is only used in the project's
internal testing.
In looking into the code, which I presume you have done by
now, you see that the famous line 242 has the call
SolexPlugin.getDefault().getPreferenceStore();
and in hitting F3 on getDefault() you find out that
SolexPlugin has an incorrect assumption in its singleton
implemntation, that it will only be called from within
Eclipse; when it is called from Ant, the instance has not
been created, and the static method returns null, resulting
in the NPE above.
It is not clear the best way to fix this, since the plugin
presumably has some requirement for the initialization
parameters that Eclipse gives it, since the Runner is trying
to get the Plugin's preferences store...