ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From B├╝lent Erdemir <bu...@kocbank.com.tr>
Subject AntClassLoader2 broken ? (Reported as bug id: 36838)
Date Wed, 28 Sep 2005 09:01:00 GMT


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]

Note: FalezDeployRMI is a custom Ant task.

However, the class is in fact stored in Jboss jars. Indeed, when I start ant 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 performs 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



Bu mesaj ve onunla iletilen tum ekler gonderildigi kisi ya da kuruma ozel ve Bankalar Kanunu
geregince, gizlilik yukumlulugu tasiyor olabilir. Bu mesaj, hicbir sekilde, herhangi bir amac
icin cogaltilamaz, yayinlanamaz ve para karsiligi satilamaz; mesajin yetkili alicisi veya
alicisina iletmekten sorumlu kisi degilseniz, mesaj icerigini ya da eklerini kopyalamayiniz,
yayinlamayiniz, baska kisilere yonlendirmeyiniz ve mesaji gonderen kisiyi derhal uyararak
bu mesaji siliniz. Bu mesajin iceriginde ya da eklerinde yer alan bilgilerin dogrulugu, butunlugu
ve guncelligi Bankamiz tarafindan garanti edilmemektedir ve bilinen viruslere karsi kontrolleri
yapilmis olarak yollanan mesajin sisteminizde yaratabilecegi zararlardan Bankamiz sorumlu
tutulamaz.

This message and the files attached to it are under the privacy liability in accordance with
the Banking Law and confidential to the use of the individual or entity to whom they are addressed.
This message cannot be copied, disclosed or sold monetary consideration for any purpose. If
you are not the intended recipient of this message, you should not copy, distribute, disclose
or forward the information that exists in the content and in the attachments of this message;
please notify the sender immediately and delete all copies of this message. Our Bank does
not warrant the accuracy, integrity and currency of the information transmitted with this
message. This message has been detected for all known computer viruses thence our Bank is
not liable for the occurrence of any system corruption caused by this message

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


Mime
View raw message