Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [pde-dev] Plugin not started


One of the most common problems is to reference a class in a jar which you don't have access to at runtime.  For instance, if you place a jar in your project (project A), any other project who depends on project A can use classes in it.  But since the jar is not on the Bundle-Classpath, when you run the bundle it will fail to find the class.  This is the reason I asked about the class being in a jar vs source folder.

The things to verify to make sure it works:
1. Verify the source folder is included as a library.  This should be in the build.properties of your project.  You should see an entry for source.<library_name>= <source folder>.  That library name should appear in the Bundle-Classpath header of your manifest (unless the library is '.' and you don't specify a Bundle-Classpath).
2. Verify the package is being exported by the contributing plug-in.  Should be an Export-Package statement.  If there are additional attributes to the package, you might remove them (for example, x-friends)
3. Make sure there is a Require-Bundle or Import-Package statement in the consuming project's manifest.

Also, there might be some problems if you export the same package from two plug-ins.  If you use an Import-Package statement, you will get "wired" to one of the implementations and it might not be the one you anticipate.

You also mentioned circular dependencies.  This is not a good practice.  You might consider breaking out some of the code into a "core" bundle which the other bundles can reference.

Hope this helps,

Brian Bauman
    IBM Software Group - Austin, TX
    Eclipse Committer
    baumanbr@xxxxxxxxxx
    (512) 838 -2938 (T/L 678-2938)



From: Boris Glawe <public@xxxxxxxxxxxxxx>
To: "Eclipse PDE general developers list." <pde-dev@xxxxxxxxxxx>
Date: 10/03/2007 07:08 AM
Subject: Re: [pde-dev] Plugin not started





Brian Bauman schrieb:
>
> Can you attach the two projects (or a small scale replica) you are
> having problems with.  NoClassDefFoundErrors can be caused by a
> variety of reasons.  Is the class you are looking for which resides in
> a jar file or is it in a source folder ready to be compiled?  
The class is in a source folder. It's compiled (the .class file exists)
and it it's in the package, which is explicitly exported by plugin B.
It's not somewhere in a subfolder of the package but exactly in the
folder corresponding to the exported package.

Unfortunately I don't know the exact license of the code, as it's part
of a research project at my university. I will have to ask, whether I'm
allowed to post the project. The next problem: There are more then two
projects involved! I would have to send you a dozen of projects, as the
all interdependent.

Could you please give me any advice where to search for failure reasons
(typical problems with classloaders, further maybe hidden errorlogs) or
how to debug in the meantime?

I'm quiet confused, as eclipse lists the broken plugin B in the plugin
details window, but cannot use it - and don't give me any more
errormessages which I could use for debugging!

Thanks and greets
Boris


>
> Brian Bauman
>     IBM Software Group - Austin, TX
>     Eclipse Committer
>     baumanbr@xxxxxxxxxx
>     (512) 838 -2938 (T/L 678-2938)
>
>
>
> From:                  Boris Glawe <public@xxxxxxxxxxxxxx>
> To:                  pde-dev@xxxxxxxxxxx
> Date:                  10/02/2007 11:32 AM
> Subject:                  [pde-dev] Plugin not started
>
>
> ------------------------------------------------------------------------
>
>
>
> Hi,
>
> I don't know, whether I'm right here - but I can't find a better place
> to find help for my problem:
>
> I have a lot of eclipse projects in my workspace, each of them
> implementing an eclipse plugin. These plugins depend on each other.
>
> Let's say Plugin A requires plugin B.
>
> If I've understood eclipse correctly, a plugin gets loaded, as soon as
> one of it's classes, is being instantiated (Yes, lazy loading is set to
> true in the MANIFEST.MF). Is that correct?
>
> My problem:
>
> Plugin A requires a class that is in B. With the first trial to
> instantiate this class, I get a NoClassDefFoundError.
>
> I've set a breakpoint at the very top of the Constructor of the
> activator's class of plugin B but the debugger never reaches this point
> before the thrown error!
>
>
> I conclude from this, that eclipse never tries to load the plugin!
>
> The plugina A and B are listed in help->about->plugin details!
>
> Where could I begin with the search for the failure reason?
>
> Plugin B is  listed in the Required-Plugins section of A's MANIFEST.MF.
>
> B's packages that are required in A are explicitly exported in the
> MANIFEST.MF!
>
> There's a cyclic dependency between A and B! Some Classes of B need to
> be instantiated during the execution of A's start() method. I've already
> tried to remove this cyclic dependency, by commenting out all lines in
> the start() method, that access B's classes. Unfortunately this didn't
> help.
>
> Do you have any idea, what I could try next? Except the error log, I
> don't know where to find more information.
>
>
> _______________________________________________
> pde-dev mailing list
> pde-dev@xxxxxxxxxxx
>
https://dev.eclipse.org/mailman/listinfo/pde-dev
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> pde-dev mailing list
> pde-dev@xxxxxxxxxxx
>
https://dev.eclipse.org/mailman/listinfo/pde-dev
>  

_______________________________________________
pde-dev mailing list
pde-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/pde-dev


Back to the top