When running my ant build with the dashboard listener
set, I get a MalformedURLException. I've got jdom and
xerces and dashboard all in my classpath. They are all
at the front too. I get this error both on Solaris and
WinXP Pro.
Unable to instantiate listener
net.sourceforge.dashboard.ant.AntBuildManager
at org.apache.tools.ant.Main.addBuildListeners
(Main.java:652)
at org.apache.tools.ant.Main.runBuild
(Main.java:557)
at org.apache.tools.ant.Main.start(Main.java:196)
at org.apache.tools.ant.Main.main(Main.java:235)
Caused by: java.net.MalformedURLException
at java.net.URL.<init>(URL.java:613)
at java.net.URL.<init>(URL.java:476)
at java.net.URL.<init>(URL.java:425)
at
org.apache.xerces.impl.XMLEntityManager.setupCurrentE
ntity(Unknown So
urce)
at
org.apache.xerces.impl.XMLVersionDetector.determineDo
cVersion(Unknown
Source)
at
org.apache.xerces.parsers.XML11Configuration.parse
(Unknown Source)
at
org.apache.xerces.parsers.XML11Configuration.parse
(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse
(Unknown Source)
at
org.apache.xerces.parsers.AbstractSAXParser.parse
(Unknown Source)
at org.jdom.input.SAXBuilder.build
(SAXBuilder.java:455)
at org.jdom.input.SAXBuilder.build
(SAXBuilder.java:769)
at
net.sourceforge.dashboard.common.XMLConfigurationPar
ser.parseConfigur
ation(Unknown Source)
at
net.sourceforge.dashboard.common.BuildConfiguration.ge
tInstance(Unkno
wn Source)
at
net.sourceforge.dashboard.common.BuildManager.getCon
figuration(Unknow
n Source)
at
net.sourceforge.dashboard.common.BuildManager.<init>
(Unknown Source)
at
net.sourceforge.dashboard.ant.AntBuildManager.<init>
(Unknown Source)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance0
(Native Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance
(NativeConstruct
orAccessorImpl.java:39)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInsta
nce(DelegatingC
onstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance
(Constructor.java:274)
at java.lang.Class.newInstance0(Class.java:306)
at java.lang.Class.newInstance(Class.java:259)
at org.apache.tools.ant.Main.addBuildListeners
(Main.java:648)
... 3 more
--- Nested Exception ---
java.net.MalformedURLException
at java.net.URL.<init>(URL.java:613)
at java.net.URL.<init>(URL.java:476)
at java.net.URL.<init>(URL.java:425)
at
org.apache.xerces.impl.XMLEntityManager.setupCurrentE
ntity(Unknown So
urce)
at
org.apache.xerces.impl.XMLVersionDetector.determineDo
cVersion(Unknown
Source)
at
org.apache.xerces.parsers.XML11Configuration.parse
(Unknown Source)
at
org.apache.xerces.parsers.XML11Configuration.parse
(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse
(Unknown Source)
at
org.apache.xerces.parsers.AbstractSAXParser.parse
(Unknown Source)
at org.jdom.input.SAXBuilder.build
(SAXBuilder.java:455)
at org.jdom.input.SAXBuilder.build
(SAXBuilder.java:769)
at
net.sourceforge.dashboard.common.XMLConfigurationPar
ser.parseConfigur
ation(Unknown Source)
at
net.sourceforge.dashboard.common.BuildConfiguration.ge
tInstance(Unkno
wn Source)
at
net.sourceforge.dashboard.common.BuildManager.getCon
figuration(Unknow
n Source)
at
net.sourceforge.dashboard.common.BuildManager.<init>
(Unknown Source)
at
net.sourceforge.dashboard.ant.AntBuildManager.<init>
(Unknown Source)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance0
(Native Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance
(NativeConstruct
orAccessorImpl.java:39)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInsta
nce(DelegatingC
onstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance
(Constructor.java:274)
at java.lang.Class.newInstance0(Class.java:306)
at java.lang.Class.newInstance(Class.java:259)
at org.apache.tools.ant.Main.addBuildListeners
(Main.java:648)
at org.apache.tools.ant.Main.runBuild
(Main.java:557)
at org.apache.tools.ant.Main.start(Main.java:196)
at org.apache.tools.ant.Main.main(Main.java:235)
Logged In: YES
user_id=484527
I have the same problem. I'm running Ant 1.6.0 from a
script, with Sun's JDK 1.4.2 on Linux.
Logged In: YES
user_id=484527
My problem was that dashboard (1.0.4) in ant (1.6) was not
finding dashboard-props.xml on its classpath. A workaround
is to set the environment variable
LOCALCLASSPATH=/the/dir/containing/that/config/file/ before
running the ant script.
Logged In: YES
user_id=982593
I was also seeing the error 'Unable to instatiate listener ...'
To solve this, I did the following:
I am using dashboard(1.0.4) and ant(1.6.1) and am using
the 'scriptfile' attribute in my <ant> builder. I finally got
things working better after putting JDom on my system
classpath. Its not good enough to have this on Cruise
classpath if you are using 'scripfile' attribute. Furthermore, I
needed to edit the ant script (usr/local/ant/bin/ant) to add
the directory of my dashboard-props.xml file to the variable
LOCALCLASSPATH. Setting this within my shell was not good
enough, apparently. Note that the directory of the props file,
not the full path of the file, must be added. I also have found
that if the dashboard.prop.xml file has any kind of syntax
error, you will see the same generic error described above.
Dashboard simply throws an exception - "Invalid
Configuration", which utimately results in the same generic
error, 'Unable to instantiate listener'. Make sure your
dashboard props file is syntactically correct!
Now, on to the next problem...
Logged In: YES
user_id=1150988
Has anyone figured out how to solve this issue? I have come
this far:
1) I have copied the dashboard-server-1.0.5.jar to the Ant lib
directory, and got the class not found exception for org/jdom/
JDOMException.
2) I copied the jdom.jar file from CruiseControl into the Ant lib
directory, and got the RuntimeException: "Unable to
instantiate specified logger class net.sourceforge.dashboard.
cruisecontrol.CruiseBuildManager".
I use cruisecontrol-2.1.6, dashboard-1.0.5, apache-ant-1.6.2,
java version "1.4.2_05" and IntelliJ IDEA 4.5.2.
dashboard-props.xml:
------------------------------------------------
<dashboard>
<multicast>
<host>192.168.5.121</host>
<port>3274</port>
</multicast>
<targets>
<target name="init">
<message index="1"/>
</target>
<target name="clean">
<message index="2"/>
</target>
<target name="compile">
<message index="3"/>
</target>
<target name="aspect-compile">
<message name="aspect-compile" index="4"/>
</target>
<target name="signjars">
<message index="5"/>
</target>
<target name="deploy">
<message index="6"/>
</target>
<target name="test" event="FAILED">
<message name="aaargh" status="FAILED"/>
</target>
</targets>
</dashboard>
------------------------------------------------
Logged In: YES
user_id=1150988
10 minutes after I submitted my last post I solved my problem.
My post may have been avoided if I had read (and understood)
the previous submitters excellent advices. Sorry!
What I did: I moved the dashboard-props.xml from the Ant lib
directory into another location and added the path to it in the
ant-script ($ANT_HOME/bin/ant) like this:
LOCALCLASSPATH="$LOCALCLASSPATH":/path/to/props/