Re: Classloader

From: Chuck Hill (chil..lobal-village.net)
Date: Tue Aug 19 2003 - 13:04:24 EDT

  • Next message: Harald Niesche: "Re: Possible bug with incremental builder and WebServerResources"

    WOBootstrap is what WO 5.2 uses for launching WO Apps. You might be better
    off rewriting the code below:

    com.bar.foo.TheClass.class.getClassLoader().getResourceAsStream("mypack/file
    .xml");

    (off the top of my head). getSystemResourceAsStream()locates the resource
    through the system class loader (see getSystemClassLoader()). That is
    probably above the WOBootstrap classloader and hence the resource cannot be
    located.

    Chuck

    At 07:03 PM 19/08/2003 +0200, Frédéric Dreier wrote:
    >Hi,
    >
    >I am still trying to deploy my application and get stuck on a classloader
    >problem.. Within eclipse everything run perfectly, but I run in troubles
    >stating from command line (using myApp.cmd)..
    >
    >I have a WOApplication that use an external jar file. A class within this
    >jar file load some XML file (also in the jar file) using:
    >
    >ClassLoader.getSystemResourceAsStream("mypack/file.xml");
    >
    >It returns the stream when running within eclipse but null when running from
    >command line.
    >
    >After some investigations i find that the system classloader are not the
    >same. Running from command line use some kind of 'WOBootstrap' classloader..
    >(?)
    >
    >
    >Thanks in advance,
    >
    >
    >Frederic
    >
    >
    >
    >PS: using 'Class.forName("mypack/MyClass");' return a value, it says that
    >the jar files is in path...
    >
    >

    --
    

    Chuck Hill chil..lobal-village.net Global Village Consulting Inc. http://www.global-village.net



    This archive was generated by hypermail 2.0.0 : Tue Aug 19 2003 - 12:54:46 EDT