Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[pde-dev] Re: pde-dev Digest, Vol 31, Issue 4

pde-dev-request@xxxxxxxxxxx wrote:
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.
You should never have cyclic dependencies between plugins. Among other
things, cyclic project dependencies cause the builder all sorts of headaches. In the past (not sure about 3.2 or 3.3 with this), I've seen very erratic behavior
when cycles were present.

Do you have any idea, what I could try next? Except the error log, I don't know where to find more information.

More generally, there are several things you should check for when you
get mysterious errors upon attempting to instantiate an extension class:

- you have a static initializer in the class being instantiated that throws an exception
- your bundle activator class' start() method throws an exception
- your bundle activator class has a static initializer that throws an exception
- the class being instantiated doesn't have a 0-argument constructor
- the class being instantiated has a 0-arg constructor that is not public

IMHO, the Eclipse runtime framework should really do a much better job at
detecting and reporting (at least some of) these problems clearly. In the past,
I've traced through code in org.eclipse.core.runtime (I think) that trapped
exceptions and ended up throwing a ClassNotFoundException (or somesuch)
without giving any indication of what *really* went wrong. Very hard to
diagnose!

--
Cheers,
 -- Bob

--------------------------------
Robert M. Fuhrer
Research Staff Member
Programming Technologies Dept.
IBM T.J. Watson Research Center

IMP Team Lead (http://eclipse-imp.sourceforge.net)
X10: Productivity for High-Performance Parallel Programming (http://x10.sf.net)




Back to the top