ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wohlgemuth <berlinguyi...@gmail.com>
Subject Re: weird problem with Class instanceOf
Date Wed, 09 Aug 2006 11:20:24 GMT
ok I got it fixed, I had to set the loader ref, kinder annoying and is
there an easy way todo this automatical?

thx for your help and pointing me in the right direction!

final soloutioon:

	<path id="lib">
		<pathelement path="../../build" />
		<fileset dir="../../lib" includes="**/*.jar,**/*.zip" />
	</path>

	<typedef name="config"
classname="edu.ucdavis.genomics.metabolomics.binbase.cluster.ant.Configuration"
loaderref="lib.loader" classpathref="lib" />
	<typedef name="parameter"
classname="edu.ucdavis.genomics.metabolomics.binbase.cluster.ant.ClusterParameter"
classpathref="lib"  loaderref="lib.loader"/>
	<taskdef name="upload"
classname="edu.ucdavis.genomics.metabolomics.binbase.cluster.ant.ClusterUploadLibraryTask"
classpathref="lib" loaderref="lib.loader"/>


On 8/9/06, wohlgemuth <berlinguyinca@gmail.com> wrote:
> ok good shot,
>
> they have differenct hashcodes now how do I fix this? my complete ant
> task looks like:
>
> <project name="antTaskExample" default="example">
>
>         <!-- define our classpath -->
>         <path id="lib">
>                 <pathelement path="../../build" />
>                 <fileset dir="../../lib" includes="**/*.jar,**/*.zip" />
>         </path>
>
>         <typedef name="config"
> classname="edu.ucdavis.genomics.metabolomics.binbase.cluster.ant.Configuration"
> classpathref="lib" />
>         <typedef name="parameter"
> classname="edu.ucdavis.genomics.metabolomics.binbase.cluster.ant.ClusterParameter"
> classpathref="lib" />
>         <taskdef name="upload"
> classname="edu.ucdavis.genomics.metabolomics.binbase.cluster.ant.ClusterUploadLibraryTask"
> classpathref="lib" />
>
>
> <config id="conf">
>         <parameter name="username" value="..." />
> </config>
>
>         <target name="uploadLibs" description="upload some libraries to the cluster">
>                 <upload description="initialize our cluster"
> factory="edu.ucdavis.genomics.metabolomics.binbase.cluster.util.RocksClusterFactoryImpl"
> merge="true">
>                         <config refid="conf"/>
>
>                         <!-- select our files for the upload -->
>                         <fileset dir="../../">
>                                 <include name="**/*.jar"/>
>                         </fileset>
>                 </upload>
>         </target>
> </project>
>
> when I use the config element without a refrence like:
>
>         <target name="uploadLibs" description="upload some libraries to the cluster">
>                 <upload description="initialize our cluster"
> factory="edu.ucdavis.genomics.metabolomics.binbase.cluster.util.RocksClusterFactoryImpl"
> merge="true">
>                         <config id="conf">
>                                 <parameter name="username" value="..." />
>                         </config>
>
>                         <!-- select our files for the upload -->
>                         <fileset dir="../../">
>                                 <include name="**/*.jar"/>
>                         </fileset>
>                 </upload>
>         </target>
>
> it works without any problems.
>
> so we need to have 2 different class loaders. How can I avoid this?
>
> /gert
>
> On 8/8/06, Stephen McConnell <mcconnell@dpml.net> wrote:
> >
> >
> > > -----Original Message-----
> > > From: wohlgemuth [mailto:berlinguyinca@gmail.com]
> > > Sent: Wednesday, 9 August 2006 1:09 PM
> > > To: Stephen McConnell
> > > Cc: Ant Users List
> > > Subject: Re: weird problem with Class instanceOf
> > >
> > > I give it a try first tomorrow morning, but I'm acually quite
> > > shure that this is not the case, cause I tried already
> > > different names for the classes to check this.
> >
> > Class naming in this scenario is largely academic. The JVM has in memory two
> > objects - one object is a class named Configuration and another object (in
> > another classloader) is a class named Configuration. Class renaming will not
> > change the underlying problem.
> >
> > Cheers, Steve.
> >
>
>
> --
> --------------------------------------------------------------------
> http://fiehnlab.ucdavis.edu/staff/wohlgemuth
>
> work:    wohlgemuth@ucdavis.edu
> phone:   530 754 7113
>
> private: wohlgemuth@mindcrime-ilab.de
> phone:    530 220 3728
>


-- 
--------------------------------------------------------------------
http://fiehnlab.ucdavis.edu/staff/wohlgemuth

work:    wohlgemuth@ucdavis.edu
phone:   530 754 7113

private: wohlgemuth@mindcrime-ilab.de
phone:    530 220 3728

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


Mime
View raw message