You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by ck...@onebox.com on 2006/10/19 15:59:13 UTC

Classpath failure has me mystified.

My problem:

When running a build file, I get this error message:

     [java] Error in FetchDataAsXML.getXML(): java.lang.ClassNotFoundException:
oracle.jdbc.driver.OracleDriver

The relevant sections of the build file:

	<target name="init">
		<tstamp>
			<format property="TODAY" pattern="MMMM dd, yyyy" />
		</tstamp>
		&lt;!-- irrelevant properties omitted --&gt;
		<property name="oracle.xsu12.jar.path" value="c:/oracle/ora90JavaXDK/lib/xsu12.jar" />
		<property name="oracle.xml.parser.jar.path" value="c:/oracle/ora90JavaXDK/lib/xmlparserv2.jar" />
		<property name="sars.jar.path" value="../sars.jar" />
	</target>

	<java classname="com.kilonovember.alpo.sarsj.FetchDataAsXML" fork="true">
		<classpath>
			<pathelement location="${sars.jar.path}" />
			<pathelement location="${oracle.xsu12.jar.path}" />
			<pathelement location="${oracle.xml.parser.jar.path}" />
		</classpath>
		<arg value="QueryFileName=${sql.dir}/${query.file}" />
		<arg value="QueryName=${query.name}" />
		<arg value="QueryVersion=${query.version}" />
		<arg value="BindVariables=${query.bind-variables}" />
		<arg value="XMLFileName=${xml.dir}/${outfile}" />
	</java>

When I run the com.kilonovember.alpo.sarsj.FetchDataAsXML class from the command line like this:

java -cp %CLASSPATH%;../sars.jar;c:\oracle\ora90JavaXDK\lib\xsu12.jar;c:\oracle\ora90JavaXDK\lib\xmlparserv2.jar com.kilonovember.alpo.sarsj.FetchDataAsXML QueryFileName=../queries.xml QueryName=pending XMLFileName=hropeod.xml bindvars=1:2006-10-13;2:2006-10-15

the program executes without fault.

I have carefully checked to see that the elements of the classpath attribute passed on the command line match the <pathelement location="" /> values, 

<property name="oracle.xsu12.jar.path" value="c:/oracle/ora90JavaXDK/lib/xsu12.jar" />
--
c:\oracle\ora90JavaXDK\lib\xsu12.jar

<property name="oracle.xml.parser.jar.path" value="c:/oracle/ora90JavaXDK/lib/xmlparserv2.jar" />
--
c:\oracle\ora90JavaXDK\lib\xmlparserv2.jar

so I am stumped as to why the build file gives this error.

Any insight you can offer will be gratefully accepted.

Thanks.

-- 
Charles Knell
cknell@onebox.com - email

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Classpath failure has me mystified.

Posted by James Abley <ja...@volantis.com>.
ant -v

ant -d

What equivalent command-line is ANT generating?

James

cknell@onebox.com wrote:
> My problem:
> 
> When running a build file, I get this error message:
> 
>      [java] Error in FetchDataAsXML.getXML(): java.lang.ClassNotFoundException:
> oracle.jdbc.driver.OracleDriver
> 
> The relevant sections of the build file:
> 
> 	<target name="init">
> 		<tstamp>
> 			<format property="TODAY" pattern="MMMM dd, yyyy" />
> 		</tstamp>
> 		&lt;!-- irrelevant properties omitted --&gt;
> 		<property name="oracle.xsu12.jar.path" value="c:/oracle/ora90JavaXDK/lib/xsu12.jar" />
> 		<property name="oracle.xml.parser.jar.path" value="c:/oracle/ora90JavaXDK/lib/xmlparserv2.jar" />
> 		<property name="sars.jar.path" value="../sars.jar" />
> 	</target>
> 
> 	<java classname="com.kilonovember.alpo.sarsj.FetchDataAsXML" fork="true">
> 		<classpath>
> 			<pathelement location="${sars.jar.path}" />
> 			<pathelement location="${oracle.xsu12.jar.path}" />
> 			<pathelement location="${oracle.xml.parser.jar.path}" />
> 		</classpath>
> 		<arg value="QueryFileName=${sql.dir}/${query.file}" />
> 		<arg value="QueryName=${query.name}" />
> 		<arg value="QueryVersion=${query.version}" />
> 		<arg value="BindVariables=${query.bind-variables}" />
> 		<arg value="XMLFileName=${xml.dir}/${outfile}" />
> 	</java>
> 
> When I run the com.kilonovember.alpo.sarsj.FetchDataAsXML class from the command line like this:
> 
> java -cp %CLASSPATH%;../sars.jar;c:\oracle\ora90JavaXDK\lib\xsu12.jar;c:\oracle\ora90JavaXDK\lib\xmlparserv2.jar com.kilonovember.alpo.sarsj.FetchDataAsXML QueryFileName=../queries.xml QueryName=pending XMLFileName=hropeod.xml bindvars=1:2006-10-13;2:2006-10-15
> 
> the program executes without fault.
> 
> I have carefully checked to see that the elements of the classpath attribute passed on the command line match the <pathelement location="" /> values, 
> 
> <property name="oracle.xsu12.jar.path" value="c:/oracle/ora90JavaXDK/lib/xsu12.jar" />
> --
> c:\oracle\ora90JavaXDK\lib\xsu12.jar
> 
> <property name="oracle.xml.parser.jar.path" value="c:/oracle/ora90JavaXDK/lib/xmlparserv2.jar" />
> --
> c:\oracle\ora90JavaXDK\lib\xmlparserv2.jar
> 
> so I am stumped as to why the build file gives this error.
> 
> Any insight you can offer will be gratefully accepted.
> 
> Thanks.
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org