ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephane Bailliez <sbaill...@imediation.com>
Subject RE: LinkageError Problems
Date Tue, 10 Apr 2001 05:57:23 GMT

As its name suggests, it is a security violation on the classloader meaning
that you are loading twice org.w3c.dom.* classes in different classloaders
(ie the system classloader and AntClassLoader in this case) and try to
instantiate them.

This is to avoid some malicious coder to replace classes at runtime and
letting believe it is the original class.

Your choice as of now is to fork your task process so that you use your
classes in another VM.

Hope this helps.

-- 
 St├ęphane Bailliez 
 Software Engineer, Paris - France 
 iMediation - http://www.imediation.com 
 Disclaimer: All the opinions expressed above are mine and not those from my
company. 



> -----Original Message-----
> From: Stephen Champeau [mailto:schampeau@leaselink.com]
> Sent: Tuesday, April 10, 2001 1:40 AM
> To: Ant List (E-mail)
> Subject: LinkageError Problems
> 
> 
> A few days ago I sent a message describing a problem I had 
> compiling some
> classes that use XML under Ant 1.3. I received a response 
> suggesting I try
> using includeAntRuntime = "no" in my <javac> task.
> 
> This solved my compile problems, but I'm having trouble 
> running my custom
> tasks that use XML. I define a classpath that sticks the 
> xerces.jar at the
> front of my classpath. My javac task uses it.
> 
>    <path id="project.class.path">
>       <pathelement location="${basedir}/build/xerces.jar"/>
>       <pathelement location="${basedir}/build/jar_update.jar"/>
>       <pathelement path="${java.class.path}"/>
>    </path>
> 
> I have a custom task that also uses xerces.jar. I defined a 
> taskdef for this
> that uses the classpath.
> 
>    <taskdef
>       name="buildupdate"
>       classname="com.lml.leaselink.update.BuildUpdateTask">
>       <classpath refid="project.class.path"/>
>    </taskdef>
> 
> When I attempt to run a task that uses this task:
> 
>    <target name="move_files_for_update" depends="update_clean">
>       <buildupdate
>          makelogifnoupdates = "false"
>          buildloglocation = "${basedir}/${buildLog}"
>          lastbuilddirectory = "${basedir}/${lastBuildClassDir}"
>          newbuilddirectory = "${basedir}/${classDir}"
>          updatejardirectory = "${basedir}/${updateClassDir}"
>          removejardirectory = "${basedir}/${removeClassDir}"
>       />
>    </target>
> 
> I get an exception for each of the XML classes that the task 
> attempts to
> load:
> 
> java.io.IOException: java.lang.LinkageError: Class 
> org/w3c/dom/Document
> violates loader constraints
>       ...
> java.io.IOException: java.lang.LinkageError: Class org/w3c/dom/Element
> violates loader constraints
>       ...
> java.io.IOException: java.lang.LinkageError: Class 
> org/w3c/dom/NodeList
> violates loader constraints
> 	...
> 
> Can anyone offer any ideas on how to fix this?
> 
> Thanks,
> 
> Steve C.
> 
> 

Mime
View raw message