could not find framework in eclipse RCP application - eclipse-rcp

I have developed one eclipse RCP application which I am calling from my own Java program.
When I run my own Java program from command prompt (windows) it is perfectly working and giving the results.
But when I have integrated with the ant build script in eclipse 3.2 it is giving the following problem:
!ENTRY org.eclipse.core.launcher 4 0 Dec 02, 2009 10:53:17.608
!MESSAGE Exception launching the Eclipse Platform:
!STACK
java.lang.RuntimeException: Could not find framework
at org.eclipse.core.launcher.Main.getBootPath(Main.java:395)
at org.eclipse.core.launcher.Main.basicRun(Main.java:174)
at org.eclipse.core.launcher.Main.run(Main.java:704)
at xxx.xxx.xxxx.MyCodeGenerator.main(MyCodeGenerator.java:13)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.tools.ant.taskdefs.ExecuteJava.run(ExecuteJava.java:202)
at org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:134)
Can you please help me what could be the possible reasons for this error.

As mentioned in this thread, you:
do not only have to add the platform plugins you wish to export to the list of dependent plugins of your feature,
but you also have to the list of included plugins
(See this project for instance)
Make sure you "Validate Plug-ins" before you launch your RCP (see this thread).
With the Launch Configuration Dialog, in the "Plug-ins" Tab, there is a "Validate Plug-ins" button that you can click to verify that all the dependency of the "selected" plug-ins are satisfied.
If there are some errors, you can click the "Add Required Plug-ins" to correct the error.

Related

MagicDraw 18.3 developing plugins using Eclipse 4.5.2.M

I am having trouble configurating Eclipse for MD 18.3 plugin development.
I have thoroughly followed the "MagicDraw 18.3 Developer Guide / Development in Eclipse" tutorial you can find inside MagicDraw\openapi section to set up Eclipse.
When launching MagicDraw with all plugins run configuration, it throws the following error and terminates:
!ENTRY org.eclipse.core.variables 4 120 2016-07-20 10:39:12.159
!MESSAGE Reference to undefined variable file_uri
caused by this line of the run configuration
-Dosgi.framework.extensions=reference:${file_uri:${workspace_loc:/MagicDraw/MAGIC_DRAW_INSTALL_DIRECTORY/lib/bundles}}/com.nomagic.magicdraw.osgi.fragment
However, \lib\bundles\com.nomagic.magicdraw.osgi.fragment_1.0.0.201601271815.jar
is existing
I'm running the demo license, but that shouldn't influence the configuration. Any suggestions?
UPDATE
Solved this issue, by replacing reference:${file_uri:${workspace_loc:/MagicDraw/MAGIC_DRAW_INSTALL_DIRECTORY/lib/bundles}}/com.nomagic.magicdraw.osgi.fragment with the actual path and enabling com.nomagic.magicdraw.platform.feature in the bundles tab of the run configuration.
Next Problem: The provided example plugins won't load, throwing
java.lang.NullPointerException at com.nomagic.magicdraw.plugins.XMLPluginDescriptorLoader.loadPluginDescriptorData(XMLPluginDescriptorLoader.java:172)
and therefore
ERROR PLUGINS - Failed to create plugin: My Plug-in 2
java.lang.ClassNotFoundException: myplugin2.MyPlugin2
Same message for both, the example plugins and my own plugin. I have checked the plugin.xml files and also experimentally enabled the run configurations > bundles > workspace checkbox.
Try to edit this line:
- Dosgi.framework.extensions=com.nomagic.magicdraw.osgi.fragment
Setting up a new clean Eclipse installation solved everything.

Eclipse Plug-ins develop: Plug-in A use a Class in Plug-in B, after exporting as jars and installed in to eclipse, NoClassDefFoundError occurs

Plugin A uses a class,ClassB, which is from Plugin B.When "run as eclipse application", everything goes well; however, when PluginA adn Plugin B are exported as Jar, and install into a new eclipse platform, they run well independently, but crash when the codes reach the line where Plugin A uses the ClassB.
error log: ava.lang.NoClassDefFoundError Caused by: java.lang.ClassNotFoundException
In plugin org.jboss.vpe.browsersim.eclipse, there is BrowserSimLauncher.java in the package org.jboss.vep.browsersim.eclipse.launcher;
In plugin org.ayound.js.debug.core, there exits a java file "JsLaunchConfigurationDelegate.java", and I put BrowserSimLauncher.launchBrowserSim(startUrl);
into it, this means I've used previous plugin's class 'BrowserSimLauncher' in the latter plugin.
I also do all the"dependencies things", including adding lines to latter plugin's manifest.mf:
Import-Package: org.jboss.tools.vpe.browsersim.eclipse.launcher
and to previous plugin's manifest.mf:
Export-Package: org.jboss.tools.vpe.browsersim.eclipse.launcher
In the development environment, both plugins compiles successfully, when "run as eclipse application", things goes well, and the latter plugin can sucessfully call BrowserSimLauncher.launchBrowserSim(startUrl); ;
however, when I exported both plugins as several .jar files, and copy them into the /plugin folder of another eclipse directory, start the eclipse, both plugins can run well independently, but the plugin fails to call BrowserSimLauncher.launchBrowserSim(startUrl);. and the error log show as follow:
!ENTRY org.eclipse.core.jobs 4 2 2015-01-06 16:29:03.817
!MESSAGE An internal error occurred during: "Launching index.html".
!STACK 0
java.lang.NoClassDefFoundError: org/jboss/tools/vpe/browsersim/eclipse/launcher/BrowserSimLauncher
at org.ayound.js.debug.launch.JsLaunchConfigurationDelegate.launch(JsLaunchConfigurationDelegate.java:101)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:858)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:707)
at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:1018)
at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1222)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
Caused by: java.lang.ClassNotFoundException: org.jboss.tools.vpe.browsersim.eclipse.launcher.BrowserSimLauncher cannot be found by org.ayound.js.debug.core_2.2.0
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:501)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:421)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:412)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
... 6 more
the latter plugin(js.debug.core) can't find the previous plugin(browsersim.eclipse)!
If you just copy plugins in to the Eclipse 'plugins' directory then you need to specify the '-clean' option when you start Eclipse to get it to rebuild the plugin dependencies cache.
You can specify '-clean' on the Eclipse command line or in the eclipse.ini file (here it must be before any -vmargs line).
It is safe to always specify -clean but it will slow down the Eclipse start a bit.
supplements:
Just startup eclipse with option "-clean", problem solved. Details are from reference article:
What it does:
if set to "true", any cached data used
by the OSGi framework and eclipse
runtime will be wiped clean. This will
clean the caches used to store bundle
dependency resolution and eclipse
extension registry data. Using this
option will force eclipse to
reinitialize these caches.
How to use it:
Edit the eclipse.ini file located in your Eclipse install directory and insert -clean as the first line.
Or edit the shortcut you use to start Eclipse and add -clean as the first argument.
Or create a batch or shell script that calls the Eclipse executable with the -clean argument. The advantage to this step is you can keep the script around and use it each time you want to clean out the workspace. You can name it something like eclipse-clean.bat (or eclipse-clean.sh).
(From: http://www.eclipsezone.com/eclipse/forums/t61566.html)
Other eclipse command line options: http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fmisc%2Fruntime-options.html

using SWTBot but always encounter [Exception in thread "WorkbenchTestable" java.lang.IllegalArgumentException: No Classloader found for plug-in X]

I'm using SWTBot 2.1.1 in Eclipse 4.2.2 Juno on Mac OS X 10.8.4.
There are some tutorials (1, 2) online, but no matter how many times I tried, I always encounter
!ENTRY org.eclipse.core.net 1 0 2013-07-17 17:33:52.328
!MESSAGE System property http.nonProxyHosts has been set to local|*.local|169.254/16|*.169.254/16 by an external source. This value will be overwritten using the values from the preferences
Exception in thread "WorkbenchTestable" java.lang.IllegalArgumentException: No Classloader found for plug-in com.eclipse.swtbot.setup
at org.eclipse.swtbot.eclipse.core.RemotePluginTestRunner.getClassLoader(RemotePluginTestRunner.java:79)
at org.eclipse.swtbot.eclipse.core.RemotePluginTestRunner.getTestClassLoader(RemotePluginTestRunner.java:73)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.loadClass(RemoteTestRunner.java:693)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.loadClasses(RemoteTestRunner.java:429)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:452)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.swtbot.eclipse.core.RemotePluginTestRunner.main(RemotePluginTestRunner.java:64)
at org.eclipse.swtbot.eclipse.core.UITestApplication.runTests(UITestApplication.java:117)
at org.eclipse.ui.internal.testing.WorkbenchTestable$1.run(WorkbenchTestable.java:71)
at java.lang.Thread.run(Thread.java:680)
Everytime I run this SWTBot test, it will only bring up an empty Eclipse window and nothing more.
Someone points out that I should add the current bundle in Run -> Run Configuration ... -> SWTBot Test -> Plug-ins, but even if I add all plug-in in there, the error still exist.
Any help?
In launch configurations -> plug-ins, do you have the "launch with" combobox set with "all workspace and enabled target plug-ins"?
I struggled with same issue and figured out this was (part of) the problem.
I had the same issue. For me there was the bundle which contains my swtbot test not launched because I did not selected it in the run Configuration. Here are the steps you should check which worked for me:
Run -> Run Configurations… -> your SWTBot Test -> Plug-ins
Launch with: plug-ins selected below only
Select all plug-ins from Workspace you need to run your application + your plug-in that contains the SWTBot test
now click on Add Required Plug-ins for two times to ensure all needed plug-ins are selected from Target Platform
ensure you have the minimum of Plug-ins selected needed by the SWTBot. These are: org.eclipse.swtbot.eclipse.core,
org.eclipse.swtbot.eclipse.finder,
org.eclipse.swtbot.junit4_x,
org.eclipse.swtbot.swt.finder
click Validate Plug-ins and add all Plug-ins manually that are mentioned there
click Apply and Run

Eclipse Ganymede throws null pointer exception

my eclipse IDE throws a null pointer exception from time to time on a very regular basis (every 3-4 days). First my Java EE project(s) will not compile and will output a nullpointer exception in the errors tab.
I made sure that my project facet (java 5.0) and compiler are the same (1.5). However, when i restart Eclipse, the problem goes away after cleaning and rebuilding the projects - when there's no errors in the first place.
It gets annoying because it takes a long time for me to restart Eclipse IDE, clean+build, restart server and actually dev+test code.
I made sure I have plenty of memory too, 512 because I had a memory issue with Eclipse in the past as well but thats resolved. I mention it as it may be relevant.
I reintalled Eclipse Ganymede for Java EE 3 times in C:\Eclipse and still have the same problem too. Tried in D:\ another partitioned disk and doesnt work.
Advice will be greatly appreciated.
Eclipse Platform
Version: 3.4.2
Build id: M20090211-1700
Java EE Ganymede SR2 Win32
Platform: Windows XP 32-bit
Here is the stack trace:
!ENTRY com.bea.weblogic.eclipse 4 9999 2012-06-15 12:22:53.989
!MESSAGE Unhandled Eclipse-WebLogic error
!STACK 0
java.lang.NullPointerException
at com.bea.weblogic.eclipse.model.Deployments.getName(Deployments.java:292)
at com.bea.weblogic.eclipse.model.Deployments.loadEJBs(Deployments.java:237)
at com.bea.weblogic.eclipse.model.Deployments.loadAll(Deployments.java:109)
at com.bea.weblogic.eclipse.ui.views.WebLogicServerTreeContentProvider.loadModulesAndRefresh(WebLogicServerTreeContentProvider.java:273)
at com.bea.weblogic.eclipse.ui.views.WebLogicServerTreeContentProvider.serverStateChanged(WebLogicServerTreeContentProvider.java:247)
at com.bea.weblogic.eclipse.model.ServerManager.fireServerStateChanged(ServerManager.java:94)
at com.bea.weblogic.eclipse.launcher.ServerLauncher$3.run(ServerLauncher.java:199)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:133)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3800)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3425)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2384)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2348)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2200)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:495)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:288)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:490)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:193)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:386)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:549)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
Some advices:
You could try to run eclipse from console, configure some logging to understand exception. Maybe you should remove some plugin that you don't use.
You could try to install just Eclipse Classic and after that install needed plugins. I do it always and haven't got any NPE exception issues. You'll get clean Eclipse without unnecessary plug-ins, so you reduce the possibility of exceptions.
Also you could try to use new version of Eclipse - Indigo.
You could also try to use some another IDE (for example: IntelliJ IDEA http://www.jetbrains.com/idea/)
It might be also interesting for you:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=328550
https://bugs.eclipse.org/bugs/show_bug.cgi?id=321358
https://bugs.eclipse.org/bugs/show_bug.cgi?id=326434

problem installing eclipse groovy plugin in galileo

I'm trying to install groovy plugin in eclipse 3.5 using this update site.
It does install but when it tries to restart I get an exception.
!SESSION Sat Aug 29 15:47:17 PDT 2009 ------------------------------------------
!ENTRY org.eclipse.equinox.launcher 4 0 2009-08-29 15:47:17.287
!MESSAGE Exception launching the Eclipse Platform:
!STACK java.lang.ClassNotFoundException: org.eclipse.core.runtime.adaptor.EclipseStarter
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
I tried to start using -clean options,deleted workspace no luck
Did anyone get this too??
It looks like you're missing a class or a jar required by the plugin; I'm not sure which one though, since the stacktrace does not indicate any such plugin specific class. You could attempt the following:
Examine the .log file of the workspace to view any additional details of the exception.
Verify if all the Groovy Eclipse plugin jars are present in the plugins and features directory of the Eclipse installation.
Start Eclipse with the consolelog and debug switches, and pipe the output to a debug log file. Examine for anything indicative of the problem in the logfile; if needed post the log file. The command to start Eclipse in this mode would be $eclipse -consolelog -debug | tee debugfile.log
Install the plugin on a clean installation of Eclipse.
OK now finally i fixed it after 2 days of war with eclipse, so for some reason when groovy plugin was installed eclipse modified config.ini file inside configuration folder
so I have to modify config.ini file to replace osgi.bundles value with
osgi.bundles=reference\:file\:org.eclipse.equinox.simpleconfigurator_1.0.100.v20090520-1905.jar#1\:start,reference\:file\:plugins/org.eclipse.jdt.core_3.5.0.xx-20090828-1900-e35.jar#4,reference\:file\:/Applications/galileo/plugins/org.apache.commons.collections_3.2.1.jar#4,reference\:file\:/Applications/galileo/plugins/org.apache.commons.lang_2.3.0.v200803061910.jar#4,reference\:file\:/Applications/galileo/plugins/org.codehaus.groovy_1.7.0.xx-20090828-1900-e35/#4,reference\:file\:/Applications/galileo/plugins/org.codehaus.groovy.eclipse.ant_2.0.0.xx-20090828-1900-e35/#4,reference\:file\:/Applications/galileo/plugins/org.codehaus.groovy.eclipse.codeassist.completion_2.0.0.xx-20090828-1900-e35.jar#4,reference\:file\:/Applications/galileo/plugins/org.codehaus.groovy.eclipse.codebrowsing_2.0.0.xx-20090828-1900-e35.jar#4,reference\:file\:/Applications/galileo/plugins/org.codehaus.groovy.eclipse.core_2.0.0.xx-20090828-1900-e35.jar#4,reference\:file\:/Applications/galileo/plugins/org.codehaus.groovy.eclipse.core.help_2.0.0.xx-20090828-1900-e35/#4,reference\:file\:/Applications/galileo/plugins/org.codehaus.groovy.eclipse.cstviewer_2.0.0.xx-20090828-1900-e35.jar#4,reference\:file\:/Applications/galileo/plugins/org.codehaus.groovy.eclipse.refactoring_2.0.0.xx-20090828-1900-e35.jar#4,reference\:file\:/Applications/galileo/plugins/org.codehaus.groovy.eclipse.ui_2.0.0.xx-20090828-1900-e35.jar#4,reference\:file\:/Applications/galileo/plugins/org.eclipse.jdt.groovy.core_1.0.0.xx-20090828-1900-e35.jar#4
By default osgi.bundles value is osgi.bundles=reference\:file\:org.eclipse.equinox.simpleconfigurator_1.0.100.v20090520-1905.jar#1\:start but as soon as I installed groovy plugin I had a modified value which caused eclipse fali to start.
now my eclipse starts and i see the groovy features too..
I had the same problem with installing the CVS plugin on a Eclipse Platform installation running TeXlipse. Turns out, after installing CVS, the installer had modified not the osgi.bundles, but the osgi.framework.
/Applications/TeXlipse/configuration/config.ini said:
osgi.framework=file\:/Applications/TeXlipse/Eclipse.app/Contents/MacOS/plugins/org.eclipse.osgi_3.5.2.R35x_v20100126.jar
and it was supposed to say
osgi.framework=file\:/Applications/TeXlipse/plugins/org.eclipse.osgi_3.5.2.R35x_v20100126.jar