Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » ClassLoader Issue using Birt in RCP
ClassLoader Issue using Birt in RCP [message #73402] Tue, 19 September 2006 19:51 Go to next message
James Leotta is currently offline James LeottaFriend
Messages: 202
Registered: July 2009
Senior Member
Hello,

I have an RCP app that at startup initializes my database using a class
with a static singleton pattern method and returns an
objectcontainer(the database). My problem is that when I start a
ReportEngine in Birt it uses a different classloader breaking my
singleton pattern and subsequently the application. Is there a way to
force a plugin to use the current classloader before it is instantiated?

Thanks in advance from a newbie to classloaders.
Re: ClassLoader Issue using Birt in RCP [message #74505 is a reply to message #73402] Tue, 10 October 2006 12:47 Go to previous message
Eclipse UserFriend
Originally posted by: jeff_mcaffer.REMOVE.ca.ibm.com

The short answer is No. All code in a bundle should be loaded by that
bundle's classloader. You might be getting into a funny case where you
do the initialization in the activator/plugin class as a static
initializer. That *can*, under some circumstances, allow for the
"singleton" class to be instantiated twice. So you may not be having a
classloader problem but rather a "double singleton" problem.

Jeff

James Leotta wrote:
> Hello,
>
> I have an RCP app that at startup initializes my database using a class
> with a static singleton pattern method and returns an
> objectcontainer(the database). My problem is that when I start a
> ReportEngine in Birt it uses a different classloader breaking my
> singleton pattern and subsequently the application. Is there a way to
> force a plugin to use the current classloader before it is instantiated?
>
> Thanks in advance from a newbie to classloaders.
Previous Topic:Launching Equinox using JDK 1.3 within eclipse
Next Topic:prevent bundles from installing or resolving?
Goto Forum:
  


Current Time: Wed Apr 24 17:30:26 GMT 2024

Powered by FUDForum. Page generated in 0.02582 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top