ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vijay Viatla <Vijay.Via...@lfs.co.uk>
Subject RE: java task
Date Wed, 05 Nov 2003 09:26:10 GMT
Priyapravas,

Perhaps you should check the jars which are loaded in your classpath. 

I guess, your classpath, which loaded before the java task, might not have
this SAX Implementation class. Fork is used inorder to overcome these
classpath issues by creating a new VM altogether.

Vijay

-----Original Message-----
From: Keith Hatton [mailto:khatton@axiomsystems.com]
Sent: 05 November 2003 09:01
To: Ant Users List
Subject: RE: java task


Hi Priyapravas,
 
At a guess this has something to do with Ant's classloaders.
When you use fork=true, Ant starts a new VM with a straightforward classpath
setting.
When you use the <java> task without forking, some classes may be invisible
because of the classloading mechanism (don't ask me about the details :)).
As a rule, I would say fork=true is good, unless your app is really simple.
 
Hope this helps
Keith

-----Original Message-----
From: Priyapravas [mailto:priyapravas@infosys.com]
Sent: 05 November 2003 07:43
To: Ant Users List
Subject: java task


All, 
I tried executing the java task from within ant. The target looked something
like this: 

<target depends="init" name="execute"> 
<java classname="<name_of_the_class_to_execute>"> 
<classpath refid="project.class.path"/> 
</java> 
</target> 

On executing this target I got the following error: 

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

Now, I added the attribute fork="true" to the java task element. 

<target depends="init" name="execute"> 
<java classname="<name_of_the_class_to_execute>" fork="true"> 
<classpath refid="project.class.path"/> 
</java> 
</target> 

I was able to execute the java task. Can anyone explain this? 

Cheers, 
-Priyapravas


This email is intended only for the use of the addressees named above and may be confidential
or legally privileged. If you are not an addressee you must not read it and must not use any
information contained in it, nor copy it, nor inform any person other than Lynx Financial
Systems or the addressees of its existence or contents.  If you have received this email and
are not a named addressee, please delete it and notify the Lynx Financial Systems IT Department
on 0113 2892990.

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


Mime
View raw message