Title: Message
This is the problem (similar to what) I and some other people were having.
I _think_ I know where the problem comes from (I faced it in slightly different case):
 
new Xerces (2.0) is trying to be smart about classloaders (prolly they are right here) and when attempting to load parser impl. (and other stuff) it obtains classloader using Thread.getContextClassloader() HOWEVER the problem is that Ant, when calling tasks does NOT set context classpath (and sounds like it is not going to in the near future). The result is that the classloader Xerces gets a hold on is a wrong one (I think it is IDEA's CL in our particular case) and that finally screws things up.
 
The workaround (quite ugly) I found is to replace xerces.jar in idea/lib with an older version of xerces (1.4.x). It makes the build work, but breaks XML validation.
 
I also tried using  <taskdef reverseloader="true"> attribute (see link below), I am not sure what exactly does it do. For me it did not work  - caused Linkage error violating loader constraints.
 
 
See this link for discussion of this problem:
http://www.mail-archive.com/[email protected]/msg11157.html
 
 
Anton: I believe you were on this problem. Hope this information may help. Would running Ant in a separate process help here?

--
fedor.

----
Self Test for Paranoia:
        You know you have it when you can't think of anything that's
your own fault.

-----Original Message-----
From: Willem Salembier [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 27, 2002 7:21 AM
To: [EMAIL PROTECTED]
Subject: [Eap-list] ant build failed

Hi,
 
I am using the Ariadna build 614. My ant scripts never work when I have a doctype entry defined with a link to a .dtd.
 
<!DOCTYPE project SYSTEM "http://servername/dtd/ant141.dtd">
 
The error I get is:
build.xml
null
Build completed with 1 error. Time: 1 s
Or in full text mode:
build.xml
Detected Java version: 1.3 in: C:\Progra~1\jdk1.3.1\jre
Detected OS: Windows 2000
parsing buildfile C:\Projects\CG\build.xml with URI = file:C:/Projects/CG/build.xml
resolving systemId: null
null
 at org.apache.tools.ant.ProjectHelper.parse(ProjectHelper.java:142)
 at org.apache.tools.ant.ProjectHelper.configureProject(ProjectHelper.java:85)
 at com.intellij.ant.AntMain.a(AntMain.java:149)
 at com.intellij.ant.AntMain.a(AntMain.java:293)
 at com.intellij.ant.AntMain.main(AntMain.java:62)
--- Nested Exception ---
java.lang.NullPointerException
 at org.apache.tools.ant.ProjectHelper$RootHandler.resolveEntity(ProjectHelper.java:223)
 at org.apache.xerces.util.EntityResolverWrapper.resolveEntity(EntityResolverWrapper.java:138)
 at org.apache.xerces.impl.XMLEntityManager.resolveEntity(XMLEntityManager.java:528)
 at org.apache.xerces.impl.XMLDocumentScannerImpl$DTDDispatcher.dispatch(XMLDocumentScannerImpl.java:809)
 at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:333)
 at org.apache.xerces.parsers.StandardParserConfiguration.parse(StandardParserConfiguration.java:525)
 at org.apache.xerces.parsers.StandardParserConfiguration.parse(StandardParserConfiguration.java:581)
 at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:147)
 at org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1157)
 at javax.xml.parsers.SAXParser.parse(SAXParser.java:363)
 at org.apache.tools.ant.ProjectHelper.parse(ProjectHelper.java:117)
 at org.apache.tools.ant.ProjectHelper.configureProject(ProjectHelper.java:85)
 at com.intellij.ant.AntMain.a(AntMain.java:149)
 at com.intellij.ant.AntMain.a(AntMain.java:293)
 at com.intellij.ant.AntMain.main(AntMain.java:62)
 
Build completed with 1 error. Time: 1 s
My ant scripts run perfectly outside IDEA, but never from within IDEA. If a comment the doctype tag, the script works fine from IDEA.
Another thing I noticed are the error messages in the bottom status bar
 
<!DOCTYPE project SYSTEM "http://servername/dtd/ant141.dtd">        error: can't resolve URL
<!DOCTYPE project SYSTEM "file://C:/ant141.dtd">                            error:can't resolve URL
<!DOCTYPE project SYSTEM "C:/ant141.dtd">                                   no error in status bar, but script doesn't work either
 
Anyone noticed the same problems?
 
Regards,
 
Willem

Reply via email to