[kaffe] jBoss & Kaffe

Dalibor Topic robilad@yahoo.com
Wed May 14 05:30:02 2003


Hallo Helmer,

--- Helmer Krämer <hkraemer@freenet.de> wrote:
> On Wed, 14 May 2003 13:43:27 +0200
> Ronald Aigner <ra3@os.inf.tu-dresden.de> wrote:
> 
> Hi Ronald,
> 
> > On Wednesday 14 May 2003 09:53, Dalibor Topic wrote:
> > > argh, I wasn't finished with the code ...
> > > in libraries/javalib/java/lang/Class.java:
> > >
> > >  public ClassLoader getClassLoader() {
> > >          ClassLoader loader = getClassLoader0();
> > >
> > >          if (loader == null) {
> > >                 loader = ClassLoader.getSystemClassLoader();
> > >          }
> > >
> > >          return loader;
> > >  }
> > Tried this. Now jBoss exits in the line "String path = loc.getFile();",
> which 
> > means that there is no URL for the code-source, which in turn means that it
> 
> > should be set. This is only done by the URLClassLoader. Does JDK specify, 
> > whether this has to be done by the other ClassLoaders as well?
> > 
> >    /**
> >     * Boot up JBoss.
> >     *
> >     * @param args   The command line arguments.
> >     *
> >     * @throws Exception    Failed to boot.
> >     */
> >    public void boot(final String[] args) throws Exception
> >    {
> >       // Auto set HOME_DIR to ../bin/run.jar if not set
> >       String homeDir = System.getProperty(ServerConfig.HOME_DIR);
> >       if (homeDir == null)
> >       {
> >         ProtectionDomain pd = Main.class.getProtectionDomain();
> >         CodeSource cs = pd.getCodeSource();
> >         URL loc = cs.getLocation();
> >          String path = loc.getFile();
> >          /* The 1.4 JDK munges the code source file with URL encoding so
> run
> >           * this path through the decoder so that is JBoss starts in a path
> 
> > with
> >           * spaces we don't come crashing down.
> >          */
> >          path = java.net.URLDecoder.decode(path);
> >          File file = new File(path).getParentFile().getParentFile();
> >          homeDir = file.getCanonicalPath();
> >       }
> >       props.setProperty(ServerConfig.HOME_DIR, homeDir);
> > <code continues>
> 
> i'll commit a patch later this week, which will fix this
> issue (that is, I hope so, since eclipse does something
> similar and is starting w/o problems with my patch).

That's a very cool prospect. How long does it take to start up eclipse with
your patch?

I'm asking since Mark Wielaard has posted a challenge to get eclipse to load on
a free software java virtual machine using free software only, in less then a
minute [1]. There is even a real prize beyound eternal fame to be won ;)

cheers,
dalibor topic

[1] http://mail.gnu.org/archive/html/classpath/2003-04/msg00038.html

__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com