Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » JavaUI.getWorkingCopyManager() => NullPointerException
JavaUI.getWorkingCopyManager() => NullPointerException [message #298831] Mon, 06 February 2006 05:05 Go to next message
Eclipse UserFriend
Originally posted by: timbo.web.de

Hi,

when I call this methode, it throws a NullPointerException. Can anybody
help me?

Thx Tim
Re: JavaUI.getWorkingCopyManager() => NullPointerException [message #298875 is a reply to message #298831] Mon, 06 February 2006 14:16 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

Are you running under Eclipse? This method is only valid when running as
an Eclipse plugin.

Tim wrote:
> Hi,
>
> when I call this methode, it throws a NullPointerException. Can anybody
> help me?
>
> Thx Tim
>

--
Thanks,
Rich Kulp
Re: JavaUI.getWorkingCopyManager() => NullPointerException [message #298892 is a reply to message #298875] Tue, 07 February 2006 04:31 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: timbo.web.de

Rich Kulp wrote:

> Are you running under Eclipse? This method is only valid when running as
> an Eclipse plugin.



Yes, I'm running this method in a plugin, I created a view, which should
access the WorkingCopyManager.

JavaPlugin.getDefault().getWorkingCopyManager();

also doesn't work
Re: JavaUI.getWorkingCopyManager() => NullPointerException [message #298919 is a reply to message #298892] Tue, 07 February 2006 10:15 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

I don't know why you are getting an NPE, but you shouldn't be using
JavaPlugin. That is an internal class. You should be using:

JavaUI.getWorkingCopyManager()

This is the API way of getting it.

However, this begs the question because under the covers this method
does JavaPlugin.getDefault().getWorkingCopyManager().

What line exactly gives the NPE? What does the stack trace say. If it
says that JavaPlugin.getDefault() return null, then this shouldn't
happen because that can only happen if the jdt ui plugin did not
initialize correctly.

So what is in your .log file, what stack trace?

--
Thanks,
Rich Kulp
Re: JavaUI.getWorkingCopyManager() => NullPointerException [message #298924 is a reply to message #298919] Tue, 07 February 2006 11:29 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: timbo.web.de

when i call JavaUI.getWorkingCopyManager() I get this exception


!ENTRY org.eclipse.ui 4 4 2006-02-07 17:01:58.686
!MESSAGE Unhandled event loop exception

!ENTRY org.eclipse.ui 4 0 2006-02-07 17:01:58.701
!MESSAGE java.lang.NullPointerException
!STACK 0
java.lang.NullPointerException
at org.eclipse.jdt.ui.JavaUI.getWorkingCopyManager(JavaUI.java: 616)
at
test.plugin.TestWorkingCopyManagerAction.run(TestWorkingCopy ManagerAction.java:31)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:996 )
at
org.eclipse.jface.action.ActionContributionItem.handleWidget Selection(ActionContributionItem.java:538)
at
org.eclipse.jface.action.ActionContributionItem.access$2(Act ionContributionItem.java:488)
at
org.eclipse.jface.action.ActionContributionItem$5.handleEven t(ActionContributionItem.java:400)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java (Compiled
Code))
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:843)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3125)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2758)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:1699)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1663)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:367)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:143)
at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplicatio n.java:103)
at
org.eclipse.core.internal.runtime.PlatformActivator$1.run(Pl atformActivator.java:226)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:376)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:163)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:85)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:58)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:60)
at java.lang.reflect.Method.invoke(Method.java:391)
at org.eclipse.core.launcher.Main.invokeFramework(Main.java:334 )
at org.eclipse.core.launcher.Main.basicRun(Main.java:278)
at org.eclipse.core.launcher.Main.run(Main.java:973)
at org.eclipse.core.launcher.Main.main(Main.java:948)
Re: JavaUI.getWorkingCopyManager() => NullPointerException [message #298932 is a reply to message #298924] Tue, 07 February 2006 13:44 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

What version of Eclipse and JDT are you using because my Eclipse/JDT is
I20060131 and JavaUI line 616 is no where near the
getWorkingCopyManager class.

But looking at the code I'm willing to bet it is because
JavaPlugin.getDefault() is returning null.

There is something funny about your setup. Can up bring up a straight
java editor? Does that work in your setup?

Tim wrote:
> when i call JavaUI.getWorkingCopyManager() I get this exception
>
>
> !ENTRY org.eclipse.ui 4 4 2006-02-07 17:01:58.686
> !MESSAGE Unhandled event loop exception
>
> !ENTRY org.eclipse.ui 4 0 2006-02-07 17:01:58.701
> !MESSAGE java.lang.NullPointerException
> !STACK 0
> java.lang.NullPointerException
> at org.eclipse.jdt.ui.JavaUI.getWorkingCopyManager(JavaUI.java: 616)
> at

--
Thanks,
Rich Kulp
Re: JavaUI.getWorkingCopyManager() => NullPointerException [message #298974 is a reply to message #298924] Wed, 08 February 2006 11:23 Go to previous message
Eclipse UserFriend
Originally posted by: daniel.megert.eclipse.org

Tim wrote:

> when i call JavaUI.getWorkingCopyManager() I get this exception

Does your plugin.xml or manifest.mf declare to depend on
org.eclipse.jdt.ui? Are there any other messages in .log?

Dani

>
>
> !ENTRY org.eclipse.ui 4 4 2006-02-07 17:01:58.686
> !MESSAGE Unhandled event loop exception
>
> !ENTRY org.eclipse.ui 4 0 2006-02-07 17:01:58.701
> !MESSAGE java.lang.NullPointerException
> !STACK 0
> java.lang.NullPointerException
> at org.eclipse.jdt.ui.JavaUI.getWorkingCopyManager(JavaUI.java: 616)
> at
> test.plugin.TestWorkingCopyManagerAction.run(TestWorkingCopy ManagerAction.java:31)
>
> at org.eclipse.jface.action.Action.runWithEvent(Action.java:996 )
> at
> org.eclipse.jface.action.ActionContributionItem.handleWidget Selection(ActionContributionItem.java:538)
>
> at
> org.eclipse.jface.action.ActionContributionItem.access$2(Act ionContributionItem.java:488)
>
> at
> org.eclipse.jface.action.ActionContributionItem$5.handleEven t(ActionContributionItem.java:400)
>
> at
> org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java (Compiled
> Code))
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:843)
> at
> org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3125)
> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2758)
> at
> org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:1699)
> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1663)
> at
> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:367)
>
> at
> org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:143)
> at
> org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplicatio n.java:103)
> at
> org.eclipse.core.internal.runtime.PlatformActivator$1.run(Pl atformActivator.java:226)
>
> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:376)
>
> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:163)
>
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:85)
>
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:58)
>
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:60)
>
> at java.lang.reflect.Method.invoke(Method.java:391)
> at org.eclipse.core.launcher.Main.invokeFramework(Main.java:334 )
> at org.eclipse.core.launcher.Main.basicRun(Main.java:278)
> at org.eclipse.core.launcher.Main.run(Main.java:973)
> at org.eclipse.core.launcher.Main.main(Main.java:948)
>
Previous Topic:Team Synchronize doesn't respect CVS module file list
Next Topic:ICompilationUnit from active Editor
Goto Forum:
  


Current Time: Sun Nov 09 15:24:34 EST 2025

Powered by FUDForum. Page generated in 0.03450 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top