ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joseph Davidson <...@interguru.com>
Subject Environment Problem
Date Tue, 15 Apr 2003 00:17:31 GMT
I am an ant newbie.  This is my first build file.

I have some code that includes the sax parser.  It runs well from the 
command line

C:\Adocs\com\interguru\mailConversion>java convertTest
Starting ConvertTest
Ending ConvertTest
------------------------------------------------

under this classpath

-----------------------------------------------------------
C:\Adocs\com\interguru\mailConversion>set classpath
CLASSPATH=.;c:\COREL\OFFICE7\SHARED\BARISTA;c:\COREL\OFFICE7\SHARED\TRUEDOC;C:\adocs\com\interguru\mailConversion;C:\Adocs;.
----------------------------------------------------------------------------------------------------

However, when I run it under ant I get this

----------------------------------------------------

C:\Adocs\com>ant
Buildfile: build.xml

init:

prepare:

build:

run:
     [java] Starting TestXML
     [java] javax.xml.parsers.FactoryConfigurationError: Provider 
org.apache.xerces.jaxp.SAXParserFactoryImpl not found

BUILD SUCCESSFUL
Total time: 2 seconds
C:\Adocs\com>

-----------------------------------------------------------------------------------------------
this is last few lines of the -debug output
--------------------------------------------------------------------------------------

Class java.util.HashMap loaded from parent loader
Class java.util.regex.Pattern loaded from parent loader
Class javax.xml.parsers.SAXParserFactory loaded from parent loader
ResourceStream for META-INF/services/javax.xml.parsers.SAXParserFactory 
loaded from parent loader
Finding class org.apache.xerces.jaxp.SAXParserFactoryImpl

BUILD SUCCESSFUL
Total time: 2 seconds

--------------------------------------------------------------------------------------------------

The build file is here.

----------------------------------------------------------------

<!-- Mail Conversion build --> 
<project name="mailConversion" default="run" basedir="C:/Adocs"> 
  <target name="init"> 

  
</target>


<!-- Configure the context PATH for this application --> 
<property name="mailConversion" value="mailConversion" /> 
<property name="path" value="com/interguru/mailConversion"/>
<property name="build" value="${path}"/>



<path id="classpath">
 <!-- <fileset dir="${path}"/> -->
  <pathelement path="${path}"/>	
  <pathelement path="C:/Adocs"/>
</path> 


<target name="prepare" depends="init" description="Compile Dependent classes whose dependicies
are not seen by the jit ">
	<javac srcdir="${path}" destdir="${path}" >
	    <include name="*Conversion.java" /> 
	    <classpath  refid="classpath"/> 
  	</javac> 
</target>

<!-- Executable Targets -->


<target name="build" depends="prepare" description="Compile app Java files" >
  <javac srcdir="${path}" destdir="${path}" >
    <include name="*.java" /> 
    
  </javac> 

</target>

<target name="run" depends="build" description="run Java MailConversion" >
       <java classname="convertTest">
	       <classpath refid="classpath"/>   
       </java>
</target>

</project>


Joseph Davidson
301 593 4152
www.interguru.com





Mime
View raw message