[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Plugin ClassLoader Bug?

Carmen,

Thanks for that, it worked great.

I also tried the info on wiki and did not succeed. I also tried the solution that David Vincent Soamai suggested. I seemed to work, but playing with the classloaders led to serious problems with Eclipse in my case; in short Eclipse blew up and could not even open a Writer to log the problems. (But thanks for reply and the suggestion in any case David:-) What I like about about your solution is that it is neat and clean with no real side effects. The only down side I see is that we do not get the benefit of the loose coupling between the InitialContext and the factory via the jndi.properties file. This could be fixed though if it was really needed by reading the system property and doing a classForName on it. A bit more work, but not really that much trouble.

Once again thanks for your help, it saved me an awful lot of grief.

Best regards
Joel

Carmen Zannier wrote:
The workaround I found for the jndi problem:

   I explicitly created an instance of NamingContextFactory.  To my
recollection, I got a ClassNotFoundException on NamingContextFactory when it
was called implicitly.  I originally had:
         Context c = new InitialContext(jndiProps);

  I changed my code to:
        NamingContextFactory f = new NamingContextFactory();
        Context ctx = f.getInitialContext(jndiProps);
  This seems to be working.

  No, I have not found out the root causes yet, except through my debugging as
I mentioned before.  This link:
http://eclipsewiki.swiki.net/114#eclipseClassloading does not seem to be
sufficient.  I emphasize again that I have included the required jar files in
my plugin folder at runtime, and referenced it in my plugin.xml file...

  Any other suggestions?

thanks,
Carmen




Carmen,

I have a similar problem trying to create an InitialContext to
communicate with JBoss. First, you mention you found a work around for
Example 1, could you please share it. Second, have you had any luck it
finding out what the root causes are?


Thanks,
Joel