You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Justin Lawler <ju...@eircom.net> on 2002/03/08 18:47:11 UTC

LinkageError when running TorqueSQLTask

I am execuring the ant task "TorqueSQLTask" through a program, ie im setting up all the necessary properties and then calling the "execute" method. and I get a LinkageError:

     [java] java.lang.LinkageError: loader constraints violated when linking org/xml/sax/XMLReader class
     [java]  at org.apache.xerces.jaxp.SAXParserFactoryImpl.newSAXParser(SAXParserFactoryImpl.java:95)
     [java]  at org.apache.torque.engine.database.transform.XmlToAppData.parseFile(XmlToAppData.java:160)
     [java]  at org.apache.torque.task.TorqueDataModelTask.initControlContext(TorqueDataModelTask.java:225)
     [java]  at org.apache.torque.task.TorqueSQLTask.initControlContext(TorqueSQLTask.java:226)
     [java]  at org.apache.velocity.texen.ant.TexenTask.execute(TexenTask.java:480)
     [java]  at com.work.torque.TableObjGen.createSQLFile(TableObjGen.java:196)
     [java]  at com.work.torque.TableObjGen.main(TableObjGen.java:321)
     [java]  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     [java]  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
     [java]  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     [java]  at java.lang.reflect.Method.invoke(Method.java:324)
     [java]  at org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:124)
     [java]  at org.apache.tools.ant.taskdefs.Java.run(Java.java:305)
     [java]  at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:127)
     [java]  at org.apache.tools.ant.taskdefs.Java.execute(Java.java:88)
     [java]  at org.apache.tools.ant.Task.perform(Task.java:217)
     [java]  at org.apache.tools.ant.Target.execute(Target.java:184)
     [java]  at org.apache.tools.ant.Target.performTasks(Target.java:202)
     [java]  at org.apache.tools.ant.Project.executeTarget(Project.java:601)
     [java]  at org.apache.tools.ant.Project.executeTargets(Project.java:560)
     [java]  at org.apache.tools.ant.Main.runBuild(Main.java:454)
     [java]  at org.apache.tools.ant.Main.start(Main.java:153)
     [java]  at org.apache.tools.ant.Main.main(Main.java:176)


I'm running the Torque and tdk versions "020302", with all the jars that came with the tdk. I was having a look in the tdk jars and there seems to be a few jars with the XMLReader in them, eg. XMLParserAPIs, xalan-2.1.0, dom4j-1.1. Could this be part of the problem?

Also, there seems to be no problem when running this task straight from ant.

thanks,
Justin

Re: LinkageError when running TorqueSQLTask

Posted by Daniel Rall <dl...@finemaltcoding.com>.
"Justin Lawler" <ju...@eircom.net> writes:

> no, to further complicate things, im running the program that executes the
> task from the ant "java" task, because its much easier to create a classpath
> in ant. Is there any way of finding out where it loads each class from?

For Catalina, adding debug="3" to the right server.xml element will
show classloading information.  For Ant, running `ant -debug` ought to
do the trick.

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: LinkageError when running TorqueSQLTask

Posted by Justin Lawler <ju...@eircom.net>.
----- Original Message -----
From: Daniel Rall <dl...@finemaltcoding.com>
To: Turbine Users List <tu...@jakarta.apache.org>
Sent: Tuesday, March 12, 2002 1:05 AM
Subject: Re: LinkageError when running TorqueSQLTask


> "Justin Lawler" <ju...@eircom.net> writes:
>
> > I am execuring the ant task "TorqueSQLTask" through a program, ie im
setting up all the necessary properties and then calling the "execute"
method. and I get a LinkageError:
> >
> >      [java] java.lang.LinkageError: loader constraints violated when
linking org/xml/sax/XMLReader class
> >      [java]  at
org.apache.xerces.jaxp.SAXParserFactoryImpl.newSAXParser(SAXParserFactoryImp
l.java:95)
> >      [java]  at
org.apache.torque.engine.database.transform.XmlToAppData.parseFile(XmlToAppD
ata.java:160)
> >      [java]  at
org.apache.torque.task.TorqueDataModelTask.initControlContext(TorqueDataMode
lTask.java:225)
> >      [java]  at
org.apache.torque.task.TorqueSQLTask.initControlContext(TorqueSQLTask.java:2
26)
> >      [java]  at
org.apache.velocity.texen.ant.TexenTask.execute(TexenTask.java:480)
> >      [java]  at
com.work.torque.TableObjGen.createSQLFile(TableObjGen.java:196)
> >      [java]  at com.work.torque.TableObjGen.main(TableObjGen.java:321)
> >      [java]  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
> >      [java]  at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
> >      [java]  at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
> >      [java]  at java.lang.reflect.Method.invoke(Method.java:324)
> >      [java]  at
org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:124)
> >      [java]  at org.apache.tools.ant.taskdefs.Java.run(Java.java:305)
> >      [java]  at
org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:127)
> >      [java]  at org.apache.tools.ant.taskdefs.Java.execute(Java.java:88)
> >      [java]  at org.apache.tools.ant.Task.perform(Task.java:217)
> >      [java]  at org.apache.tools.ant.Target.execute(Target.java:184)
> >      [java]  at
org.apache.tools.ant.Target.performTasks(Target.java:202)
> >      [java]  at
org.apache.tools.ant.Project.executeTarget(Project.java:601)
> >      [java]  at
org.apache.tools.ant.Project.executeTargets(Project.java:560)
> >      [java]  at org.apache.tools.ant.Main.runBuild(Main.java:454)
> >      [java]  at org.apache.tools.ant.Main.start(Main.java:153)
> >      [java]  at org.apache.tools.ant.Main.main(Main.java:176)
> >
> >
> > I'm running the Torque and tdk versions "020302", with all the jars that
came with the tdk. I was having a look in the tdk jars and there seems to be
a few jars with the XMLReader in them, eg. XMLParserAPIs, xalan-2.1.0,
dom4j-1.1. Could this be part of the problem?
>
> That is exactly the problem -- as the error message says, a
> LinkageError was thrown (loaded impl may not match loaded interface).
> If you're running from Tomcat or another servlet container which
> includes its own XML parser, things are further complicated.
>
> > Also, there seems to be no problem when running this task straight from
ant.
>
> Are you running your app from within a servlet container?

no, to further complicate things, im running the program that executes the
task from the ant "java" task, because its much easier to create a classpath
in ant. Is there any way of finding out where it loads each class from?

thanks,
Justin



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: LinkageError when running TorqueSQLTask

Posted by Daniel Rall <dl...@finemaltcoding.com>.
"Justin Lawler" <ju...@eircom.net> writes:

> I am execuring the ant task "TorqueSQLTask" through a program, ie im setting up all the necessary properties and then calling the "execute" method. and I get a LinkageError:
>
>      [java] java.lang.LinkageError: loader constraints violated when linking org/xml/sax/XMLReader class
>      [java]  at org.apache.xerces.jaxp.SAXParserFactoryImpl.newSAXParser(SAXParserFactoryImpl.java:95)
>      [java]  at org.apache.torque.engine.database.transform.XmlToAppData.parseFile(XmlToAppData.java:160)
>      [java]  at org.apache.torque.task.TorqueDataModelTask.initControlContext(TorqueDataModelTask.java:225)
>      [java]  at org.apache.torque.task.TorqueSQLTask.initControlContext(TorqueSQLTask.java:226)
>      [java]  at org.apache.velocity.texen.ant.TexenTask.execute(TexenTask.java:480)
>      [java]  at com.work.torque.TableObjGen.createSQLFile(TableObjGen.java:196)
>      [java]  at com.work.torque.TableObjGen.main(TableObjGen.java:321)
>      [java]  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>      [java]  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>      [java]  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>      [java]  at java.lang.reflect.Method.invoke(Method.java:324)
>      [java]  at org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:124)
>      [java]  at org.apache.tools.ant.taskdefs.Java.run(Java.java:305)
>      [java]  at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:127)
>      [java]  at org.apache.tools.ant.taskdefs.Java.execute(Java.java:88)
>      [java]  at org.apache.tools.ant.Task.perform(Task.java:217)
>      [java]  at org.apache.tools.ant.Target.execute(Target.java:184)
>      [java]  at org.apache.tools.ant.Target.performTasks(Target.java:202)
>      [java]  at org.apache.tools.ant.Project.executeTarget(Project.java:601)
>      [java]  at org.apache.tools.ant.Project.executeTargets(Project.java:560)
>      [java]  at org.apache.tools.ant.Main.runBuild(Main.java:454)
>      [java]  at org.apache.tools.ant.Main.start(Main.java:153)
>      [java]  at org.apache.tools.ant.Main.main(Main.java:176)
>
>
> I'm running the Torque and tdk versions "020302", with all the jars that came with the tdk. I was having a look in the tdk jars and there seems to be a few jars with the XMLReader in them, eg. XMLParserAPIs, xalan-2.1.0, dom4j-1.1. Could this be part of the problem?

That is exactly the problem -- as the error message says, a
LinkageError was thrown (loaded impl may not match loaded interface).
If you're running from Tomcat or another servlet container which
includes its own XML parser, things are further complicated.

> Also, there seems to be no problem when running this task straight from ant.

Are you running your app from within a servlet container?

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>