Hi gwunwai,

>> What happens is that if I run my applications on the command line, by
>> setting the classpath accordingly, the validation runs fine.

Tell me the classpath that you gave at the command prompt. Also list out the
jar files that you have in lib folder of Ant, so that I can suggest you what
jar file to remove from where.

-Venkat-

> ----------
> From:         Lee Gwun Wai[SMTP:[EMAIL PROTECTED]
> Reply To:     [EMAIL PROTECTED]
> Sent:         Monday, July 29, 2002 8:32 AM
> To:   xerces-j-user
> Subject:      java.lang.LinkageError: loader constraints violated when
> linking org/w3c/dom/Document class
> 
> Hello gurus,
> 
> I'm using JAXP 1.2 which allows me to validate an XML document against an
> XML Schema file that is not referenced in the top level node of the XML
> document itself. I didn't want to write something to create the reference
> in
> the document itself.
> 
> I used the jaxp 1.2 jars from the java xml summer pack downloaded from
> Sun,
> and I'm using Ant 1.5 with JUnit 3.7 (I have xml-apis.jar and
> XercesImpl.jar
> in my ANT_HOME\lib folder)
> 
> What happens is that if I run my applications on the command line, by
> setting the classpath accordingly, the validation runs fine.
> 
> When I run my test cases using Ant (JUnit batchtest), I get this error:
> java.lang.LinkageError: loader constraints violated when linking
> org/w3c/dom/Document class
>         at
> org.apache.xerces.jaxp.DocumentBuilderFactoryImpl.newDocumentBuilder(Docum
> en
> tBuilderFactoryImpl.java:88)
>         at
> org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter.getDo
> cu
> mentBuilde(XMLJUnitResultFormatter.java:93)
>         at
> org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter.start
> Te
> stSuite(XMLJUnitResultFormatter.java:138)
>         at
> org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.fireStartTest
> Su
> ite(JUnitTestRunner.java:433)
>         at
> org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTest
> Ru
> nner.java:279)
>         at
> org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.executeInVM(JUnitTa
> sk
> .java:804)
>         at
> org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execute(JUnitTask.j
> av
> a:551)
>         at
> org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execute(JUnitTask.j
> av
> a:527)
>         at org.apache.tools.ant.Task.perform(Task.java:317)
>         at org.apache.tools.ant.Target.execute(Target.java:309)
>         at org.apache.tools.ant.Target.performTasks(Target.java:334)
>         at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
>         at org.apache.tools.ant.Project.executeTargets(Project.java:1250)
>         at org.apache.tools.ant.Main.runBuild(Main.java:610)
>         at org.apache.tools.ant.Main.start(Main.java:196)
>         at org.apache.tools.ant.Main.main(Main.java:235)
> 
> I have checked inside the jars, and it seems that this Document.class
> exists
> in both xml-apis.jar (Ant 1.5) and dom.jar (Jaxp 1.2).
> 
> How can I resolve this?
> 
> Thanks everyone,
> gwunwai
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
--------------------------------------------------------------------------
Note: The information contained in this message may be privileged and
confidential and protected from disclosure. If the reader of this message is
not the intended recipient, or an employee or agent responsible for
delivering this message to the intended recipient, you are hereby notified
that any unauthorized use, dissemination, distribution or copying of this
communication is strictly prohibited. If you have received this
communication in error, please notify us immediately by replying to the
message and kindly deleting it from your computer system. Thank you in
advance for your cooperation.
--------------------------------------------------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to