ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 36838] New: - AntClassLoader2 broken ? For custom tasks ?
Date Wed, 28 Sep 2005 08:57:38 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=36838>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=36838

           Summary: AntClassLoader2 broken ? For custom tasks ?
           Product: Ant
           Version: 1.6.5
          Platform: All
        OS/Version: Windows XP
            Status: NEW
          Severity: major
          Priority: P1
         Component: Core
        AssignedTo: dev@ant.apache.org
        ReportedBy: bulente@gmail.com
                CC: bulente@gmail.com


Hi,

My JVM (Sun 1.5.0_04) shows that the Jboss class
org.jnp.interfaces.NamingContextFactory is loaded from ant.jar. Here's the
output when I start ant with plain 'ant' call (without any -lib parameter and
ANT_OPTS is set to -verbose:class) 

[FalezDeployRMI] FalezDeployRMI is running
[FalezDeployRMI] 0
[Loaded com.sun.naming.internal.ResourceManager from c:\dev\java\jdk\jre\lib\rt.jar]
[Loaded com.sun.naming.internal.VersionHelper from c:\dev\java\jdk\jre\lib\rt.jar]
[Loaded com.sun.naming.internal.VersionHelper12 from c:\dev\java\jdk\jre\lib\rt.jar]
[Loaded java.util.WeakHashMap from shared objects file]
[Loaded java.util.WeakHashMap$Entry from shared objects file]
[Loaded com.sun.naming.internal.VersionHelper12$2 from
c:\dev\java\jdk\jre\lib\rt.jar]
[Loaded com.sun.naming.internal.VersionHelper12$6 from
c:\dev\java\jdk\jre\lib\rt.jar]
[Loaded com.sun.naming.internal.VersionHelper12$5 from
c:\dev\java\jdk\jre\lib\rt.jar]
[Loaded javax.naming.NamingEnumeration from c:\dev\java\jdk\jre\lib\rt.jar]
[Loaded com.sun.naming.internal.VersionHelper12$InputStreamEnumeration from
c:\dev\java\jdk\jre\lib\rt.jar]
[Loaded com.sun.naming.internal.VersionHelper12$InputStreamEnumeration$1 from
c:\dev\java\jdk\jre\lib\rt.jar]
[Loaded com.sun.naming.internal.VersionHelper12$4 from
c:\dev\java\jdk\jre\lib\rt.jar]
[FalezDeployRMI] 1
[Loaded javax.naming.spi.InitialContextFactory from c:\dev\java\jdk\jre\lib\rt.jar]
[Loaded javax.naming.spi.ObjectFactory from c:\dev\java\jdk\jre\lib\rt.jar]
[Loaded org.jnp.interfaces.NamingContextFactory from
file:/C:/dev/tools/ant/lib/ant.jar]
[Loaded javax.naming.Name from c:\dev\java\jdk\jre\lib\rt.jar]
[FalezDeployRMI] 2
[Loaded org.apache.tools.ant.util.DateUtils from file:/C:/dev/tools/ant/lib/ant.jar]
[Loaded java.text.ChoiceFormat from c:\dev\java\jdk\jre\lib\rt.jar]
[Loaded java.text.MessageFormat from shared objects file]
[Loaded java.text.MessageFormat$Field from shared objects file]

BUILD SUCCESSFUL
Total time: 1 second
[Loaded java.lang.Shutdown from shared objects file]
[Loaded java.lang.Shutdown$Lock from shared objects file]

Note: FalezDeployRMI is a custom Ant task.

However, the class is in fact stored in Jboss jars. Indeed, when I start and as
'ant -ant -lib c:\dev\tools\zzjboss\client\jbossall-client.jar', the output is
now correct:

[FalezDeployRMI] FalezDeployRMI is running
[FalezDeployRMI] 0
[Loaded com.sun.naming.internal.ResourceManager from c:\dev\java\jdk\jre\lib\rt.jar]
[Loaded com.sun.naming.internal.VersionHelper from c:\dev\java\jdk\jre\lib\rt.jar]
[Loaded com.sun.naming.internal.VersionHelper12 from c:\dev\java\jdk\jre\lib\rt.jar]
[Loaded java.util.WeakHashMap from shared objects file]
[Loaded java.util.WeakHashMap$Entry from shared objects file]
[Loaded com.sun.naming.internal.VersionHelper12$2 from
c:\dev\java\jdk\jre\lib\rt.jar]
[Loaded com.sun.naming.internal.VersionHelper12$6 from
c:\dev\java\jdk\jre\lib\rt.jar]
[Loaded com.sun.naming.internal.VersionHelper12$5 from
c:\dev\java\jdk\jre\lib\rt.jar]
[Loaded javax.naming.NamingEnumeration from c:\dev\java\jdk\jre\lib\rt.jar]
[Loaded com.sun.naming.internal.VersionHelper12$InputStreamEnumeration from
c:\dev\java\jdk\jre\lib\rt.jar]
[Loaded com.sun.naming.internal.VersionHelper12$InputStreamEnumeration$1 from
c:\dev\java\jdk\jre\lib\rt.jar]
[Loaded com.sun.naming.internal.VersionHelper12$4 from
c:\dev\java\jdk\jre\lib\rt.jar]
[FalezDeployRMI] 1
[Loaded javax.naming.spi.InitialContextFactory from c:\dev\java\jdk\jre\lib\rt.jar]
[Loaded javax.naming.spi.ObjectFactory from c:\dev\java\jdk\jre\lib\rt.jar]
[Loaded org.jnp.interfaces.NamingContextFactory from
file:/c:/dev/tools/zzjboss/client/jbossall-client.jar]
[Loaded javax.naming.Name from c:\dev\java\jdk\jre\lib\rt.jar]
[FalezDeployRMI] 2
[Loaded org.apache.tools.ant.util.DateUtils from file:/C:/dev/tools/ant/lib/ant.jar]

Don't understand why Ant classloader (maybe delegating to parent classloader)
reports that it loads a nonexisting class from the ant.jar library. 

Here's the excerpt from the build.xml file:
	<path id="devhelppath">
		<path path="${java.class.path}"/>
		<fileset file="${falez.build.dhpath}"/>
		<fileset dir="c:\dev\tools\zzjboss\client"/>
		<fileset dir="c:\dev\tools\zzjboss\lib"/>
		<fileset dir="c:\dev\tools\zzjboss\server\all\lib"/>
	</path>
	<target name="testFalezDeployRMI">
    	<taskdef name="FalezDeployRMI"
classname="org.falez.devhelp.BuildHelper.FalezDeployRMI" 
    		classpathref="devhelppath"/>
		<FalezDeployRMI hostip="127.0.0.1" hostport="8787" file="hoba"/>
	</target>

And the task only does the following (stripped down version):	
	@Override
	public void execute() throws BuildException {
		try {
			log("0");
			InitialContext context = new InitialContext();
			log("1");
			NamingContextFactory factory = new NamingContextFactory();
			log("2");
		} catch (Exception e) {
			e.printStackTrace();
		}

Thanks for your time,
Bulent Erdemir

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message