Eclipse RCP- org.eclipse.ui.plugin missing - eclipse-rcp

I've written an Eclipse RCP application that runs fine in Eclipse, however, packaging it to be a standalone application has been tricky. I've worked my way though a few class path errors, but now I'm getting a new one.
After running the export wizard and launching my application, it throws a ClassDefError and ClassNotFoundException, specifically it's looking for org.eclipse.ui.plugin.AbstractUIPlugin. I did not find this in my copy of the eclipse SDK, and I downloaded the SDK again to be sure, and still couldn't find it. I found a jar online that supposedly contained the fiel along with some other eclipse packages, however, I then got this:
NoSuchMethodError: org.eclipse.ui.plugin.AbstractUIPlugin: method ()V not found
I figure the problem is more I did something wrong rather than this class is actually missing, but I've gone though all the configurations and I'm sure all the required packages and dependencies are included. Any ideas?

Download and install the new version of adt plugin 21.0.0.

Does your application works when you run from Eclipse? If so then try to open your plugin.xml, go to Runtime and on the bottom right part of the window you should see Classpath. Try adding the required plugins there.

Related

Eclipse plugin development: Missing dependencies at runtime

Background
I'm currently trying to extend Junit (org.eclipse.jdt) in order to do some tracing.
Therefore I created my own plugin project which (among others) provides a class which should be used by the junit runtime plugin.
I have setup my project as a dependency for junit and the package containing my class is listed as "exported" in my Manifest in the runtime tab. If I run the plugins as an eclipse application everything builds and starts allright and.
Problem
However, if in the started eclipse I perform a "Run as Junit", I get a NoClassDefFoundError concerning my class. In my understanding this means, that at runtime my class is not visible in the started eclipse. I thus printed the classpath while running and like expected my plugin doesn't show up.
Do I have to add my plugin to the "runtime" settings of the junit plugin? In the Manifest, my package is not available under the "export -> add" button. I tried importing a jar of my plugin and configuring those exports manually here, but this did not help either.
My thought process kind of gets stuck with this "run in run" configuration...
Any help is welcome!
Digging deeper in the code I found that the reason for the error is, that the part which calls my code and throws the error is run in a seperately started VM which has its classpath set via code. Nothing was wrong with the configuration, it just was not used in this case.
So if you ever stumble upon a "VMRunnerConfiguration" while having classpath problems, this might be your problem. ;)

weird behaviour of eclipse osgi bundle

I'm trying to deploy a few bundles I implemented along all the required bundles from Eclipse in order to run my own. Let's say, include the Equinox container also with my bundles so it is like an executable old-school JAR.
That said, when I try to run
java -jar org.eclipse.osgi_3.8.1.v20120830-144521.jar
Nothing happens...it just stays there doing nothing...even if I copy just that bundle to some other place and try the same, nothing happens...is this usual? I mean, I have done this successfully with older versions of this bundle (3.6) and it worked flawlessly.
Alas, I tried -debug flag to see if I could get some output, but only a complain about mission .options file is happening, nothing else.
Thanks,
Alex
Just in case someone has the same problem...having checked this link: http://docs.codehaus.org/spaces/flyingpdf/pdfpageexport.action?pageId=82903240, I created the configuration folder, a config.ini in it with the following contents:
osgi.bundles=org.eclipse.equinox.common#start, org.eclipse.update.configurator#start,
org.eclipse.core.runtime#start, org.eclipse.core.jobs#start,
org.eclipse.equinox.registry#start, org.eclipse.equinox.preferences#start,
org.eclipse.core.contenttype#start, org.apache.felix.gogo.runtime#start,
org.apache.felix.gogo.shell#start,
org.eclipse.equinox.app#start,org.eclipse.equinox.console#start,
eclipse.ignoreApp=true
osgi.noShutdown=true
This seems to work. I believe this is the minimum set of bundles required to run the Equinox OSGi container...from there, you can use the osgi shell to play with your bundles
You havent included -console option, that is the one that will open up the console view right?

google-api-client-java eclipse build path and google app engine

I am trying to follow the instructions here:
http://android-developers.blogspot.ca/2013/01/verifying-back-end-calls-from-android.html
I have decided to download the google-api-java-client library and see if I can instantiate the code on the bottom half of the page referenced above. I have imported libraries in eclipse in my app engine project so that eclipse doesn't complain about anything BUT when I try this:
GoogleIdToken token = GoogleIdToken.parse(mJFactory, tokenString);
eclipse complains with red underlining on 'GoogleIdToken.parse()' and this text
The project was not built since its build path is incomplete. Cannot find the class file for com.google.api.client.auth.jsontoken.JsonWebSignature. Fix the build path then try building this project
and
The type com.google.api.client.auth.jsontoken.JsonWebSignature cannot be resolved. It is indirectly referenced from required .class files
I have gone to this site and have followed the instructions as closely as I can, but the error remains.
http://code.google.com/p/google-api-java-client/wiki/Setup#Download_Library_with_Dependencies
can anyone tell me how to get rid of this error?
see this link:
http://code.google.com/p/google-api-java-client/
The jars with version 1.12.0-beta were not working for me, (as described above) but 1.13.2-beta was released and seems to work fine.
BTW, I was willing to try anything, including different versions of eclipse and wiping my eclipse workspace metadata. I even tried older versions of the google api library, which actually worked. I was going to go with 1.9, but I found out the last one (1.13) had some useful options that I wanted to take advantage of. 1.13.2-beta got rid of the eclipse errors for me.

Eclipse thinks it can't find 3rd party JAR in PlayFramework 2.0

I've been using the PlayFramework for some small projects, whenever I've done this its all been through a text editor. I've now moved over to Eclipse. I followed the commands to generate Eclipse project settings etc.
Everything seems to work fine. However, one 3rd party library, which I've added to referenced libs and put inside the \libs dir is throwing a 'cannot resolve type' error in Eclipse.
But when I run the project, everything works just fine. So the error is nothing more than an annoyance, and its the type of annoyance that really bothers me! So can anyone please tell me how I fix this.

Eclipse RCP: How to troubleshoot plugin dependencies & classpath problems?

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?
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.
You can try the following in your run configuration:
In the Main tab check Clear (workspace) under Workspace Data
In the Configuration tab check clear the configuration area before launching under Configuration Area
This helps me every time I encounter some strange ClassNotFound errors.
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.
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.
One more complement, hope it helps.
Open plugin.xml, check "build" tab, see how "binary build" are configured. It affects which files will compiled and exported.
See binary build here : http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.pde.doc.user%2Fguide%2Ftools%2Feditors%2Fmanifest_editor%2Fbuild.htm