It SOUNDS like something is not re-setting the Thread.contextClassloader back properly. You might want to trace through the first plugin and see if/what is setting the Thread.contextClassloader and make sure it's setting it back to the original value at the end. Basically, it looks like the Class.forName is ending up using the classloader of the first plugin which loads the BusFactory class from there. That BusFactory class is different than the BusFactory class in the second plugins classloader which results in that exception.
Dan On Sun April 19 2009 4:49:33 pm am am wrote: > Hi, > > I am having trouble instanstiating 2 different web service clients from the > same ECLIPSE (RPC) runtime. I have 2 plugins, and each instantiates a > different web service. The first plugin is ok, but the second gets a class > cast exception for the Busfactory (please note that each plugin by it self > is fine. I.e. if i run each plugin separately the web services are ok) I > have traced the problem in the following code snippet from the method > --public static BusFactory newInstance(String className) -- > > busFactoryClass = Class.forName(className, true, > classLoader).asSubclass(BusFactory.class); > This throws a class cast exception for the second plugin. Can not > understand why. I debugged it and the className seems correct (the same in > the sucessful case) org.apache.cxfbusfactory Can you please help me? > > Thank you, > Many Regards, > Akis -- Daniel Kulp [email protected] http://www.dankulp.com/blog
