Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » class not found by the run-time workbench
class not found by the run-time workbench [message #129571] Mon, 15 September 2003 14:59 Go to next message
Eclipse UserFriend
Hi,

I create a minimal plugin and this plugin refer to classes in other Java
project.

I setup the project properties so that they compile correctly.

However, the run-time workbench can't locate the classes from other
project.

Is there a simple way to make it work insteadof import these classes into
the plugin project?

Thanks
Re: class not found by the run-time workbench [message #129588 is a reply to message #129571] Mon, 15 September 2003 15:22 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.NO--SPAM.us.ibm.com

Read the Help Contents->PDE Developers Guide. This talks about how you
develop plugins in Eclipse.

Rich
Re: class not found by the run-time workbench [message #129739 is a reply to message #129588] Mon, 15 September 2003 15:48 Go to previous messageGo to next message
Eclipse UserFriend
Richard L. Kulp wrote:

> Read the Help Contents->PDE Developers Guide. This talks about how you
> develop plugins in Eclipse.

> Rich
Can you be more specific about which page I should read? I have broswed
most of them but did not find it. :(

Thanks
Re: class not found by the run-time workbench [message #129764 is a reply to message #129739] Mon, 15 September 2003 16:01 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.NO--SPAM.us.ibm.com

It is the whole concept of plugin development using the PDE that needs
to be reviewed. You are specifically missing the concept of required
plugins. To change the classpath of a plugin, you mustn't use the Java
Build Path, you need to use the plugin.xml and the build.properties.
Re: class not found by the run-time workbench [message #129775 is a reply to message #129764] Mon, 15 September 2003 16:35 Go to previous messageGo to next message
Eclipse UserFriend
Richard L. Kulp wrote:

> It is the whole concept of plugin development using the PDE that needs
> to be reviewed. You are specifically missing the concept of required
> plugins. To change the classpath of a plugin, you mustn't use the Java
> Build Path, you need to use the plugin.xml and the build.properties.

So the runtim-workbench will never find the classes located in other
non-plugin Java project in the workspace unless these classes are stored
in a plugin project or in a jar file that has been specified in the
plugin run-time library path.

To solve it, I need to convert this non plugin project to a plugin project
or make a jar file so that the plugin can find it.

Is it correct?
Re: class not found by the run-time workbench [message #130337 is a reply to message #129775] Tue, 16 September 2003 14:19 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.NO--SPAM.us.ibm.com

Correct. Plugins can only refer directly to classes that are in jars
that are specified to be either the runtime libraries of the plugin, or
runtime libraries of any plugin that it has set was dependencies (i.e.
required plugin). This will include any plugin that was marked as
exported from the required plugin.

It cannot find anything that is not marked as a plugin runtime library.

This is because each plugin gets its own classloader that points to its
runtime libraries, and has a pointer to the classloader of each required
plugin.

Rich
Re: class not found by the run-time workbench [message #130595 is a reply to message #130337] Tue, 16 September 2003 22:02 Go to previous messageGo to next message
Eclipse UserFriend
So, Richard, for the million dollar question....

Exactly *why* does each plugin have its own classloader?

Chris

"Richard L. Kulp" <richkulp@NO--SPAM.us.ibm.com> wrote in message
news:bk7k0c$38l$1@eclipse.org...
> Correct. Plugins can only refer directly to classes that are in jars
> that are specified to be either the runtime libraries of the plugin, or
> runtime libraries of any plugin that it has set was dependencies (i.e.
> required plugin). This will include any plugin that was marked as
> exported from the required plugin.
>
> It cannot find anything that is not marked as a plugin runtime library.
>
> This is because each plugin gets its own classloader that points to its
> runtime libraries, and has a pointer to the classloader of each required
> plugin.
>
> Rich
>
Re: class not found by the run-time workbench [message #131071 is a reply to message #130595] Wed, 17 September 2003 12:16 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.NO--SPAM.us.ibm.com

It allows for isolation of the plugins. Since Eclipse is a dynamic
environment with all sorts of unrelated code being plugged into it, if
they all used one classloader there would be conflicts galore. By each
using a separate classloader, the plugin only sees classes from its
plugin and from the plugins it depends upon. Other plugins that it
doesn't know about won't be interfering with it.

It also allows a plugin control of what is seen by a dependent plugin.
If a plugin doesn't export something in the plugin.xml, the dependent
plugin won't see it.

Rich
Re: class not found by the run-time workbench [message #131121 is a reply to message #129775] Wed, 17 September 2003 13:25 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ThisisFake.Fakeness.xyz

On Mon, 15 Sep 2003 20:35:10 +0000, Jack Chi wrote:

> Richard L. Kulp wrote:
>
>> It is the whole concept of plugin development using the PDE that needs
>> to be reviewed. You are specifically missing the concept of required
>> plugins. To change the classpath of a plugin, you mustn't use the Java
>> Build Path, you need to use the plugin.xml and the build.properties.
>
> So the runtim-workbench will never find the classes located in other
> non-plugin Java project in the workspace unless these classes are stored
> in a plugin project or in a jar file that has been specified in the
> plugin run-time library path.
>
> To solve it, I need to convert this non plugin project to a plugin project
> or make a jar file so that the plugin can find it.
>
> Is it correct?

I just checked and it seems like you are correct. It makes sense. You
can add those classes to your 'build path' quite easily. And compile with
no problem. But when you deploy, those classes are not deployed with your
project.

I think you can make a new JRE entry, and put your classpath into that
entry. Then choose that JRE for your project. That should make the
runtime workbench use that JRE and it will then contain the classes you
want. If JRE selection is stored per-project, that will be even better as
it wont affect any of your other projects.

I think thats the best way without jarring.


I wonder why non-plugin projects don't have their class path's added to
the runtime classpath when they are used as reference. I can't see any
reason why not!? If its referenced, obviously its going to be needed.

Wonder if the PDE reference model needs to be updated. I havent tested
this myself.


CL
Re: class not found by the run-time workbench [message #131183 is a reply to message #131071] Wed, 17 September 2003 14:56 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ThisisFake.Fakeness.xyz

On Wed, 17 Sep 2003 12:16:51 -0400, Richard L. Kulp wrote:

> It allows for isolation of the plugins. Since Eclipse is a dynamic
> environment with all sorts of unrelated code being plugged into it, if
> they all used one classloader there would be conflicts galore. By each
> using a separate classloader, the plugin only sees classes from its
> plugin and from the plugins it depends upon. Other plugins that it
> doesn't know about won't be interfering with it.
>
> It also allows a plugin control of what is seen by a dependent plugin.
> If a plugin doesn't export something in the plugin.xml, the dependent
> plugin won't see it.
>
> Rich

So then for every plugin that uses 'WizardPage' for instance, one class is
loaded? So each plugin will load its own set of every class in the
platform that it requires? Thats interesting. I guess it gives each
plugin its own namespace and static variables as well.

not bad.


CL
Re: class not found by the run-time workbench [message #131305 is a reply to message #131183] Wed, 17 September 2003 17:25 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.NO--SPAM.us.ibm.com

No. Each plugin classloader points to the classloaders of the required
plugins. Therefor any classes that are defined by a required plugin are
loaded once by that plugin's classloader. Not by each plugin classloader
that happens to be a dependent of it.

Rich
Re: class not found by the run-time workbench [message #132018 is a reply to message #131071] Thu, 18 September 2003 10:13 Go to previous messageGo to next message
Eclipse UserFriend
Mmm. My current eclipse with some extra plugins needs 29MB for
all jars together. Enter the out-of-the-box experiment.....

I extracted all of Eclipse's jars into one super-duper mega-jar (27MB)
and rewrote org.eclipse.core. I am able to run everything with one
single classloader just fine. There are no collisions, because everyone
uses package prefixes as they should.
If I remove useless symbolic debugging info, I can make the jar 22MB.
This is by no means the end. If I can track down all uses of reflection,
I can make the platform even smaller (think Rich Client Platform...).

Normal platform load time = 8 seconds. With single jar, one single
classloader and new core implementation = 6 seconds. Put the jar
on the bootclasspath = 4 seconds.
Of the 4 seconds, 2 seconds are spent in parsing the registry xml files.
So, I am currently removing the registry code and auto-generate a
registry compiled into bytecodes. I also need bytecode instrumentation
on the plugin class files to perform the nasty plugin startup magic.

Memory consumption (process/VM + heap) is also down by 10%.

My end target is 4x load time and 50% jar size.

Chris

"Richard L. Kulp" <richkulp@NO--SPAM.us.ibm.com> wrote in message
news:bka170$c08$1@eclipse.org...
> It allows for isolation of the plugins. Since Eclipse is a dynamic
> environment with all sorts of unrelated code being plugged into it, if
> they all used one classloader there would be conflicts galore. By each
> using a separate classloader, the plugin only sees classes from its
> plugin and from the plugins it depends upon. Other plugins that it
> doesn't know about won't be interfering with it.
>
> It also allows a plugin control of what is seen by a dependent plugin.
> If a plugin doesn't export something in the plugin.xml, the dependent
> plugin won't see it.
>
> Rich
>
Re: class not found by the run-time workbench [message #132678 is a reply to message #131305] Thu, 18 September 2003 22:11 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ThisisFake.Fakeness.xyz

On Wed, 17 Sep 2003 17:25:49 -0400, Richard L. Kulp wrote:

> No. Each plugin classloader points to the classloaders of the required
> plugins. Therefor any classes that are defined by a required plugin are
> loaded once by that plugin's classloader. Not by each plugin classloader
> that happens to be a dependent of it.
>
> Rich

oh yea. my plugin does not have the class definition anyway, so it can't
load the class. interesting. One day I guess ill look into class loaders
and understand how they know where to look for the classes, and how one
class loader can use classes from a different class loader.


CL
Re: class not found by the run-time workbench [message #132691 is a reply to message #132018] Thu, 18 September 2003 22:14 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ThisisFake.Fakeness.xyz

On Thu, 18 Sep 2003 10:13:22 -0400, Chris Laffra wrote:

> Mmm. My current eclipse with some extra plugins needs 29MB for
> all jars together. Enter the out-of-the-box experiment.....
>
> I extracted all of Eclipse's jars into one super-duper mega-jar (27MB)
> and rewrote org.eclipse.core. I am able to run everything with one
> single classloader just fine. There are no collisions, because everyone
> uses package prefixes as they should.
> If I remove useless symbolic debugging info, I can make the jar 22MB.
> This is by no means the end. If I can track down all uses of reflection,
> I can make the platform even smaller (think Rich Client Platform...).
>
> Normal platform load time = 8 seconds. With single jar, one single
> classloader and new core implementation = 6 seconds. Put the jar
> on the bootclasspath = 4 seconds.
> Of the 4 seconds, 2 seconds are spent in parsing the registry xml files.
> So, I am currently removing the registry code and auto-generate a
> registry compiled into bytecodes. I also need bytecode instrumentation
> on the plugin class files to perform the nasty plugin startup magic.
>
> Memory consumption (process/VM + heap) is also down by 10%.
>
> My end target is 4x load time and 50% jar size.
>
> Chris
>


Yes, but then one poorly written plugin can hose another, and the end user
would not necessarily be aware of which plugin was behaving poorly.

Also, what does that do to security managers? now their would be just one
class loader?

CL
Re: class not found by the run-time workbench [message #132729 is a reply to message #132691] Thu, 18 September 2003 23:54 Go to previous message
Eclipse UserFriend
"CL [dnoyeB] Gilbert" <ThisisFake@Fakeness.xyz> wrote in message
news:pan.2003.09.19.02.14.35.920647@Fakeness.xyz...

> Yes, but then one poorly written plugin can hose another,

What "hosing" scenarios did you have in mind?

> and the end user
> would not necessarily be aware of which plugin was behaving poorly.

NOTHING CHANGES!!!!! Log file still works, registry is still there,
the actual location where the class files come from differs, that's all.
If you develop with a normal runtime workbench, and once in while
generate the mega-jar and test it, I don't see much going wrong here.

> Also, what does that do to security managers? now their would be just one
> class loader?
Security? What kind of security? It is just one big Java program, is it not?

I am thinking about a seriously well-controlled effort to package up
eclipse (and perhaps a few selected 'application' plugins) into a
package that works just as well as the old one, but takes less
memory and CPU to deploy. Someone who is willing to ship
their application in this manner of course will do testing on the
result.

The real problems are in the case of multiple versions of the same
plugin installed. Then you really need multiple classloaders.
Also, if people don't use package names for name spaces,
collisions will occur.

Again, think Rich Client Platform, shipping a closed-off Human
Resource application, for instance.

Chris
Previous Topic:New Plugin development environment setup
Next Topic:BeanShell classloading issue
Goto Forum:
  


Current Time: Wed Jun 25 00:00:44 EDT 2025

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

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

Back to the top