Hey

Mark Gordon wrote:
> I am having a class loading problem.  Would the following two lines of
> code use different classpaths to locate the same class within ORION?
> The first line finds the class.  The second line throws a
> ClassNotFoundException.  Both lines work outside ORION.
> 
> Thanks in advance,
> -Mark ([EMAIL PROTECTED])
> 
> 1. Object o = new com.telesoft.database.DbConfig();
> 2. Object o = Beans.instantiate(null, "com.telesoft.database.DbConfig");

Yes, as they will use potentially different classloaders. If you really
want them to be equal I would suggest changing 2 to:
Object o = Beans.instantiate(this.getClass().getClassLoader(),
"com.telesoft.database.DbConfig");

Specifying null will make instantiate use the thread context classloader
(read about it in the docs dude ;-) ). Supplying a classloader gives you
more control of exactly how classloading is accomplished.

Hope this helps :-)

/Rickard

-- 
Rickard Öberg

@home: +46 13 177937
Email: [EMAIL PROTECTED]
Homepage: http://www-und.ida.liu.se/~ricob684

Reply via email to