You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Olivier Lamy <la...@accor-hotels.com> on 2003/07/16 10:41:24 UTC

Class Loader problem (I suspect)

Hello all,
I want to use external ant task in my maven.xml.
I declare this :

<path id="jagtool.classpath">
<j:forEach var="dep" items="${pom.dependencies}">
<j:if test="${dep.groupId == 'sybase'}">
<pathelement
location="${maven.repo.local}/${dep.groupId}/jars/${dep.artifact}"/>
</j:if>
</j:forEach>
</path>
<ant:taskdef name="jag_connect"
classname="com.sybase.jaguar.management.jagtool.ant.ConnectTask">
<ant:classpath>
<ant:path refid="jagtool.classpath"/>
</ant:classpath>
</ant:taskdef>
<ant:taskdef name="jag_gen_stubs"
classname="com.sybase.jaguar.management.jagtool.ant.GenerateStubsTask">
<ant:classpath>
<ant:path refid="jagtool.classpath"/>
</ant:classpath>
</ant:taskdef>

Then I want to use as this :

<goal name="serviceslayer:generate-stub">
	<ant:jag_connect host="${props}"
		password="${props}"
		port="${props}"
		user="${props}"/>

</goal>

See the console output, in the attach file. (the windows output)
I suspect the org.omg.CORBA.ORB is loaded in the parent classloader whereas
the others are loaded by the ant loader. And the parent class loader can't
load the com.sybase.CORBA.ORB which is in the ant loader. (In a solaris
output, i obtain the message :

--- Nested Exception ---
org.omg.CORBA.INITIALIZE: can't instantiate default ORB implementation
com.sybase.CORBA.ORB  vmcid:
0x0  minor code: 0  completed: No
        at org.omg.CORBA.ORB.create_impl(ORB.java:297)
        at org.omg.CORBA.ORB.init(ORB.java:336)
        at
com.sybase.jaguar.management.jagtool.JTContext.initialize(JTContext.java:125
)
        at
com.sybase.jaguar.management.jagtool.ant.ConnectTask.execute(ConnectTask.jav
a:74)
        at org.apache.tools.ant.Task.perform(Task.java:341)
        at org.apache.commons.jelly.tags.ant.AntTag.doTag(AntTag.java:232)
        at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:279)
        at
org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:135)
        at
org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:233)
        at com.werken.werkz.jelly.GoalTag$1.performAction(GoalTag.java:128)
        at com.werken.werkz.Goal.fire(Goal.java:639)
        at com.werken.werkz.Goal.attain(Goal.java:575)
        at
org.apache.maven.plugin.PluginManager.attainGoals(PluginManager.java:434)
        at org.apache.maven.MavenSession.attainGoals(MavenSession.java:348)
        at org.apache.maven.cli.App.doMain(App.java:525)
        at org.apache.maven.cli.App.main(App.java:1088)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at com.werken.forehead.Forehead.run(Forehead.java:543)
        at com.werken.forehead.Forehead.main(Forehead.java:573)
Caused by: java.lang.ClassNotFoundException: com.sybase.CORBA.ORB
        at java.net.URLClassLoader$1.run(URLClassLoader.java:198)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:265)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:217)
        at org.omg.CORBA.ORB.create_impl(ORB.java:295)
        ... 21 more

Is it possible to extend the maven-classpath ?

Thanks a lot,
Olivier