views:

50

answers:

3

I am working on an RCP project based on eclipse. It has been working fine but recently I thought I'd upgrade it to use a new eclipse version (3.2 -> 3.5).

After a bit of trouble, it was running on the new platform. Then I did something. Don't know what. The end result is that I'm now getting a classpath error when one of my plugins (A) tries to access a class in one of the dependent plugins (B) (also one of mine).

As far as I can see, Plugin A has Plugin B in its' dependency list and the compiler shows no errors. To test, I created a new Plugin C with one class and accessed the class from Plugin A. That works fine.

Does anyone have any hints for troubleshooting such issues? A checklist of settings to check? I've been struggling with this for hours and getting nowhere! Particularly frustrating as it was working until I changed something!

Thanks

Update

I should also say that the project is quite old and uses the plugin.xml and not the manifest. Could this be a problem? Is there a way to upgrade?

+2  A: 

Some ideas:

  • Clean-and-build every project (maybe after a restart of Eclipse)
  • Check, whether the required packages are also exported
  • Check the Error log, maybe there is some unloadable plug-in, etc.
  • Check the Run configuration, whether every required plug-in is present there
  • If the problem does not happen in a Runtime workbench, but in an Exported RCP app, then check whether you compile the project with the same settings during export than in Eclipse

I hope, something helps about these.

Zoltán Ujhelyi
+1 Tried these already. Any idea how to get more logging? I just get a ClasspathNotFound dump.
paul
Some more ideas: (1) start with OSGi console, and use the command 'ss' to determine whether the plug-in is in ACTIVE state; (2) try to use the dependent plug-in (B) from the new plug-in (C), whether it throws the classcastexception; (3) try to use another class from the dependent plug-in in your A plug-in.
Zoltán Ujhelyi
+1  A: 

If I understand you correctly you have no compiler errors but when you run you get class not found exceptions? You could try PDE Tools > Update Classpath from the project's context menu to see if you declared any dependencies outside of the MANIFEST.MF file, which would result in compiling code that fails at runtime.

Fabian Steeg
A: 

I developed for RCP quite a long ago, but if I'm not wrong, since 3.4 or 3.5 you have to declare in the plugin configration which packages/classes are exported for dependent plugins and which are not. This is unlike the old convention of using 'internal' in the package to mark non-exported packages.

Since you have plugin.xml from very old version of eclipse, it might be the problem, as exported resources from one plugin to another were not enforced in Eclipse RCP 3.2.

Nir