[Webtest] java.lang.Exception: Could not create task or type of type: testSpec.

Denis N. Antonioli webtest@lists.canoo.com
Tue, 25 Jul 2006 17:28:56 +0200


--Apple-Mail-1--559523025
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
	charset=US-ASCII;
	delsp=yes;
	format=flowed

Hi

It looks like ant isn't finding some dependencies (xml parser?).
Since you don't tell us what AntRunner.java is doing, I suggest you  
take a look at bin/webtest.bat to look at how to setup the classpath  
before calling ant.

Best
	dna

On 25 juil. 06, at 14:43, dlundin@aol.com wrote:

> Hello all,
>
> It looks like I am missing a jar file but am not sure - I am  
> getting this error while running java code that spins up an ant  
> process.
>
> My script works when it is run from webtest.bat.
>
> When run from java.exe, I get
> C:\webtest\doc\doc\samples>java AntRunner
> _baseDir=.
> _buildFile=test.xml
> java.lang.Exception: Configuration file test.xml is invalid, or  
> cannot be read.
>         at AntRunner.init(AntRunner.java:36)
>         at AntRunner.main(AntRunner.java:60)
> C:\webtest\doc\doc\samples>
>
> Here is my script:
> <?xml version="1.0"?>
> <!DOCTYPE project SYSTEM "WebTest.dtd">
> <project name="test" basedir="." default="main">
>     <import file="C:/webtest/lib/taskdef.xml"/>
>     <target name="main">
>   <testSpec name="myTest">
>   </testSpec>
>  </target>
> </project>
> I am including webtest.jar in my classpath and taskdef.xml is in c: 
> \webtest\lib - what's going on here?
>
> Thanks in advance
> Doug
> Check out AOL.com today. Breaking news, video search, pictures,  
> email and IM. All on demand. Always Free.

-- 
Buy a fast box with Windows NT, and you'll spend less time
with your family.
   -- Steve Jobs


--Apple-Mail-1--559523025
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
	charset=ISO-8859-1

<HTML><BODY style=3D"word-wrap: break-word; -khtml-nbsp-mode: space; =
-khtml-line-break: after-white-space; ">Hi<DIV><BR =
class=3D"khtml-block-placeholder"></DIV><DIV>It looks like ant isn't =
finding some dependencies (xml parser?).</DIV><DIV>Since you don't tell =
us what AntRunner.java is doing, I suggest you take a look at =
bin/webtest.bat to look at how to setup the classpath before calling =
ant.</DIV><DIV><BR =
class=3D"khtml-block-placeholder"></DIV><DIV>Best</DIV><DIV><SPAN =
class=3D"Apple-tab-span" style=3D"white-space:pre">	=
</SPAN>dna</DIV><DIV><BR><DIV><DIV>On 25 juil. 06, at 14:43, <A =
href=3D"mailto:dlundin@aol.com">dlundin@aol.com</A> wrote:</DIV><BR =
class=3D"Apple-interchange-newline"><BLOCKQUOTE type=3D"cite"> =
<DIV>Hello all,</DIV> <DIV>=A0</DIV> <DIV>It looks like I am missing a =
jar file but am not sure - I am getting this error while running java =
code that spins up an ant process.</DIV> <DIV>=A0</DIV> <DIV>My script =
works when it is run from webtest.bat.</DIV> <DIV>=A0</DIV> <DIV>When =
run from java.exe, I get</DIV> <DIV><FONT face=3D"Courier New, Courier, =
mono"><STRONG>C:\webtest\doc\doc\samples&gt;java AntRunner<BR> =
_baseDir=3D.<BR> _buildFile=3Dtest.xml<BR> java.lang.Exception: =
Configuration file test.xml is invalid, or cannot be read.<BR> =A0=A0=A0=A0=
=A0=A0=A0 at AntRunner.init(AntRunner.java:36)<BR> =A0=A0=A0=A0=A0=A0=A0 =
at AntRunner.main(AntRunner.java:60)</STRONG></FONT></DIV> <DIV><FONT =
face=3D"Courier New, Courier, =
mono"><STRONG>C:\webtest\doc\doc\samples&gt;</STRONG></FONT></DIV> <DIV> =
<DIV>=A0</DIV> <DIV>Here is my script:</DIV> <DIV><FONT face=3D"Courier =
New, Courier, mono"><STRONG>&lt;?xml version=3D"1.0"?&gt;<BR> =
&lt;!DOCTYPE project SYSTEM "WebTest.dtd"&gt;</STRONG></FONT></DIV> =
<DIV><FONT face=3D"Courier New, Courier, mono"><STRONG>&lt;project =
name=3D"test" basedir=3D"." default=3D"main"&gt;</STRONG></FONT></DIV> =
<DIV><FONT face=3D"Courier New, Courier, mono"><STRONG>=A0=A0=A0 =
&lt;import file=3D"C:/webtest/lib/taskdef.xml"/&gt;</STRONG></FONT></DIV> =
<DIV><FONT face=3D"Courier New, Courier, mono"><STRONG>=A0=A0=A0 =
&lt;target name=3D"main"&gt;</STRONG></FONT></DIV> <DIV><FONT =
face=3D"Courier New, Courier, mono"><STRONG>=A0=A0&lt;testSpec =
name=3D"myTest"&gt;<BR> =A0=A0&lt;/testSpec&gt;</STRONG></FONT></DIV> =
<DIV><FONT face=3D"Courier New, Courier, =
mono"><STRONG>=A0&lt;/target&gt;</STRONG></FONT></DIV> <DIV><FONT =
face=3D"Courier New, Courier, mono"><STRONG>&lt;/project&gt;<BR> =
</STRONG></FONT></DIV> <DIV>I am including webtest.jar in my classpath =
and taskdef.xml is in c:\webtest\lib - what's going on here?</DIV> =
<DIV>=A0</DIV> <DIV>Thanks in advance</DIV> <DIV>Doug</DIV> </DIV> <DIV =
class=3D"AOLPromoFooter"> <HR style=3D"margin-top:10px;"> <A =
href=3D"http://pr.atwola.com/promoclk/1615326657x4311227241x4298082137/aol=
?redir=3Dhttp%3A%2F%2Fwww%2Eaol%2Ecom" target=3D"_blank"><B>Check out =
AOL.com today</B></A>. Breaking news, video search, pictures, email and =
IM. All on demand. Always Free.<BR> </DIV> </BLOCKQUOTE></DIV><BR><DIV> =
<P style=3D"margin: 0.0px 0.0px 0.0px 0.0px"><FONT face=3D"Helvetica" =
size=3D"3" style=3D"font: 12.0px Helvetica">--<SPAN =
class=3D"Apple-converted-space">=A0</SPAN></FONT></P> <P style=3D"margin: =
0.0px 0.0px 0.0px 0.0px"><FONT face=3D"Helvetica" size=3D"3" =
style=3D"font: 12.0px Helvetica">Buy a fast box with Windows NT, and =
you'll spend less time</FONT></P> <P style=3D"margin: 0.0px 0.0px 0.0px =
0.0px"><FONT face=3D"Helvetica" size=3D"3" style=3D"font: 12.0px =
Helvetica">with your family.</FONT></P> <P style=3D"margin: 0.0px 0.0px =
0.0px 0.0px"><FONT face=3D"Helvetica" size=3D"3" style=3D"font: 12.0px =
Helvetica"><SPAN class=3D"Apple-converted-space">=A0 </SPAN>-- Steve =
Jobs</FONT></P>  </DIV><BR></DIV></BODY></HTML>=

--Apple-Mail-1--559523025--