1

I used the following code to get IJavaProject type from string:

IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
IJavaProject javaProject = JavaCore.create(project);

After this, I used javaProject.open(monitor); where monitor is of type IProgreeMonitor, to open the project... I am not able to open the filr there is some problem with it. The exception shown is:

Java Model Exception: Java Model Status [com.ibm.plugin does not exist]
 at org.eclipse.jdt.internal.core.JavaElement.newJavaModelException(JavaElement.java:501)
 at org.eclipse.jdt.internal.core.Openable.generateInfos(Openable.java:245)
 at org.eclipse.jdt.internal.core.JavaElement.openWhenClosed(JavaElement.java:514)
 at org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:251)
 at org.eclipse.jdt.internal.core.Openable.open(Openable.java:431)
 at packagesearch.HelloWorldAction.run(HelloWorldAction.java:49)
 at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:251)
 at org.eclipse.ui.internal.WWinPluginAction.runWithEvent(WWinPluginAction.java:229)
 at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:583)
 at org.eclipse.jface.action.ActionContributionItem.access2ドル(ActionContributionItem.java:500)
 at org.eclipse.jface.action.ActionContributionItem6ドル.handleEvent(ActionContributionItem.java:452)
 at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
 at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
 at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3823)
 at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3422)
 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.access4ドル(Workbench.java:2200)
 at org.eclipse.ui.internal.Workbench5ドル.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:37)
 at java.lang.reflect.Method.invoke(Method.java:599)
 at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:549)
 at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
 at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
 at org.eclipse.equinox.launcher.Main.main(Main.java:1212)
Jørn Schou-Rode
38.5k16 gold badges91 silver badges123 bronze badges
asked Jan 29, 2010 at 10:39

2 Answers 2

3

As mentioned in my previous answer, your project does not exist, meaning you are trying to open 'null'.

Hence the exception.

answered Jan 29, 2010 at 12:32
Sign up to request clarification or add additional context in comments.

Comments

0

I assume you mean IProgressMonitor.

IProgressMonitor is used to get updates on the progress of a task that is running in parallel (i.e. how near to completion it is), not to open resources.

I hope that explains the error, but I'm afraid I don't know how to open the project.

answered Jan 29, 2010 at 11:00

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.