directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pierre-Arnaud Marcelot" ...@marcelot.net>
Subject [Studio] Fixing class loader issues between Eclipse plugins using "Buddy Class Loading"
Date Thu, 05 Jun 2008 08:23:55 GMT
Hi all,

While I was developing the Apache DS plugin for Apache Directory Studio, I
ran into several class loader issues.

The Apache DS plugin defines a new Log4J appender that is used to display
the logs of an Apache DS server in the a console inside Studio.
In the Apache DS plugin, the Log4J dependency is inherited from the Apache
Directory Studio Jars plugin which contains the Log4J jar dependency and
re-exports it in its MANIFEST.MF file.
The compilation worked fine, but at runtime I had some ClassNotFound
exceptions when I was trying to create a new instance of the Logger.
Basically the problem was that the two plugins (Apache DS and Jars) are not
sharing the same class loader, even if we explicitely re-export the
dependency.
So, the Log4J class in the Jars plugin class loader could not find my
Appender class that was in a separate class loader (the Apache DS plugin
class loader).

After a few researches on google, I finaly found that I had to use the
"Buddy Class Loading" feature of Eclipse to get my code working at runtime.

I though it could be interesting to share the links that helped me solve
this problem if someone working on Studio faces a similar issue.

http://www.eclipsezone.com/eclipse/forums/t61831.html
http://www.eclipsezone.com/articles/eclipse-vms/

Regards,
Pierre-Arnaud

Mime
View raw message