I'm really sorry everyone I've flooded your Mailing List - I'm new. The spring library that I needed wasn't being shared either - which caused a *very* silent error when running Class.forName.
I have it working now. Sorry again, Branden MrVisser wrote: > > Hello, > > I'm using spring, and invoking the application context to load on a static > method. > > I am triggering this static method in the init() method of a servlet. > > I have the following 3 classes: > > public interface api.A > public class static.A //which has static method load(String implClass) > public class spring.B implements A //which contains all spring > dependencies > > to keep my API from having spring dependencies, I do something like > following method inside my servlet: > > A a = static.A.load("spring.B"); //actually, the impl string is in a > properties file > > Now, if api.A and static.A are in A.jar, and spring.B is in spring.jar, > Class.forName("example.spring.B") does not work (the thread just dies with > no exception thrown or anything). However, > Thread.currentThread().getContextClassLoader().loadClass("spring.B") will > successfully get a reference to the Class object. It just cannot be > initialized. > > If I move spring.B into A.jar with the rest, everything works fine. This > holds true with any combination of these JAR files being in common/lib or > shared/lib. > > What am I missing? Please let me know if you need more information. > > Thanks, > > Branden > -- View this message in context: http://www.nabble.com/Instantiating-a-class-in-shared-lib-tp18452107p18453911.html Sent from the Tomcat - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]