Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » Re: Plugin.getBundle() == null!
Re: Plugin.getBundle() == null! [message #101801] Wed, 21 November 2007 12:47 Go to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Miles Daffin wrote:
> Dear All,
>
> Can anyone think of a reason why a Plugin.getBundle() should return
> null? I have a classpath container initializer that calls my Plugin's
> static getDefault method. This returns a non-null reference. It then
> checks calls the Plugin.getBundle() method, which returns null. My
> plugin does *not* override the start method. This problem is hard to
> reproduce - it comes and goes. Does anyone have any idea what is going
> on and what I can do about it?
>
> eclipse.buildId=M20070921-1145
> java.version=1.5.0_11
> java.vendor=Sun Microsystems Inc.
> BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
> Framework arguments: -plugincustomization
> C:\dev\tools\eclipseide\3.3prod\eclipse\configuration\msde-g lobal-eclipse-prefs.ini
> -showlocation
> Command-line arguments: -os win32 -ws win32 -arch x86 -clean
> -plugincustomization
> C:\dev\tools\eclipseide\3.3prod\eclipse\configuration\msde-g lobal-eclipse-prefs.ini
> -showlocation
>

I know it's a cross-post, but maybe the folks in
eclipse.technology.equinox might also have some insight into this.

PW


--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse. platform.doc.isv/guide/workbench.htm


Re: Plugin.getBundle() == null! [message #101814 is a reply to message #101801] Wed, 21 November 2007 12:55 Go to previous messageGo to next message
Miles Daffin is currently offline Miles DaffinFriend
Messages: 86
Registered: July 2009
Member
Thanks PW. I was hoping you would notice this one.

Our custom classpath container initializer has a dependency on preferences
stored by the plugin it ships with. It looks like the classpath container
initializer code and the plugin code are being accessed by separate worker
threads. So this could be a simple race condition.

Anyway - if anyone has any ideas whay we can do to sort this I would be
exceedingly grateful.

Thanks,

Miles
Re: Plugin.getBundle() == null! [message #101834 is a reply to message #101814] Wed, 21 November 2007 13:24 Go to previous messageGo to next message
Miles Daffin is currently offline Miles DaffinFriend
Messages: 86
Registered: July 2009
Member
Here is a stacktrace just in from a user. Sorry for the length:
!ENTRY org.eclipse.core.resources 2 10035 2007-11-13 13:17:21.937
!MESSAGE The workspace exited with unsaved changes in the previous
session; refreshing workspace to recover changes.

!ENTRY org.eclipse.osgi 4 0 2007-11-13 13:17:29.421
!MESSAGE An error occurred while automatically activating bundle
msjava.ide.eclipse.msde (28).
!STACK 0
org.osgi.framework.BundleException: The activator
msjava.ide.eclipse.msde.MSDEPlugin for bundle msjava.ide.eclipse.msde is
invalid
at
org.eclipse.osgi.framework.internal.core.AbstractBundle.load BundleActivator(AbstractBundle.java:141)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tart(BundleContextImpl.java:970)
at
org.eclipse.osgi.framework.internal.core.BundleHost.startWor ker(BundleHost.java:346)
at
org.eclipse.osgi.framework.internal.core.AbstractBundle.star t(AbstractBundle.java:260)
at
org.eclipse.osgi.framework.util.SecureAction.start(SecureAct ion.java:400)
at
org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter .postFindLocalClass(EclipseLazyStarter.java:111)
at
org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLoc alClass(ClasspathManager.java:417)
at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.fin dLocalClass(DefaultClassLoader.java:189)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findLo calClass(BundleLoader.java:340)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl assInternal(BundleLoader.java:408)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:369)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:357)
at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loa dClass(DefaultClassLoader.java:83)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.loadCl ass(BundleLoader.java:289)
at
org.eclipse.osgi.framework.internal.core.BundleHost.loadClas s(BundleHost.java:227)
at
org.eclipse.osgi.framework.internal.core.AbstractBundle.load Class(AbstractBundle.java:1269)
at
org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI .createExecutableExtension(RegistryStrategyOSGI.java:160)
at
org.eclipse.core.internal.registry.ExtensionRegistry.createE xecutableExtension(ExtensionRegistry.java:788)
at
org.eclipse.core.internal.registry.ConfigurationElement.crea teExecutableExtension(ConfigurationElement.java:243)
at
org.eclipse.core.internal.registry.ConfigurationElementHandl e.createExecutableExtension(ConfigurationElementHandle.java: 51)
at
org.eclipse.jdt.core.JavaCore.computeClasspathContainerIniti alizer(JavaCore.java:1618)
at
org.eclipse.jdt.core.JavaCore.getClasspathContainerInitializ er(JavaCore.java:1594)
at
org.eclipse.jdt.internal.core.JavaModelManager.initializeCon tainer(JavaModelManager.java:2199)
at
org.eclipse.jdt.internal.core.JavaModelManager.getClasspathC ontainer(JavaModelManager.java:1546)
at org.eclipse.jdt.core.JavaCore.getClasspathContainer(JavaCore .java:1571)
at
org.eclipse.jdt.internal.core.JavaProject.resolveClasspath(J avaProject.java:2558)
at
org.eclipse.jdt.internal.core.JavaProject.getResolvedClasspa th(JavaProject.java:1848)
at
org.eclipse.jdt.internal.core.DeltaProcessor.createExternalA rchiveDelta(DeltaProcessor.java:802)
at
org.eclipse.jdt.internal.core.DeltaProcessor.resourceChanged (DeltaProcessor.java:1897)
at
org.eclipse.jdt.internal.core.DeltaProcessingState.resourceC hanged(DeltaProcessingState.java:368)
at
org.eclipse.core.internal.events.NotificationManager$2.run(N otificationManager.java:282)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at
org.eclipse.core.internal.events.NotificationManager.notify( NotificationManager.java:276)
at
org.eclipse.core.internal.events.NotificationManager.broadca stChanges(NotificationManager.java:148)
at
org.eclipse.core.internal.resources.Workspace.broadcastPostC hange(Workspace.java:311)
at
org.eclipse.core.internal.resources.Workspace.endOperation(W orkspace.java:1018)
at
org.eclipse.core.internal.resources.InternalWorkspaceJob.run (InternalWorkspaceJob.java:45)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Caused by: java.lang.NullPointerException
at org.eclipse.core.runtime.Plugin$1.run(Plugin.java:353)
at org.eclipse.core.runtime.Plugin.getPluginPreferences(Plugin. java:356)
at
msjava.ide.eclipse.msde.classpath.MSPkgClasspathContainer.ge tMSPkgOverride(MSPkgClasspathContainer.java:199)
at
msjava.ide.eclipse.msde.classpath.MSPkgClasspathContainer.in itializeEntries(MSPkgClasspathContainer.java:285)
at
msjava.ide.eclipse.msde.classpath.MSPkgClasspathContainer.ge tClasspathEntries(MSPkgClasspathContainer.java:255)
at
org.eclipse.jdt.internal.core.JavaModelManager.containerPutI fInitializingWithSameEntries(JavaModelManager.java:547)
at
org.eclipse.jdt.internal.core.SetContainerOperation.executeO peration(SetContainerOperation.java:49)
at
org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaMod elOperation.java:720)
at
org.eclipse.jdt.internal.core.JavaModelOperation.runOperatio n(JavaModelOperation.java:780)
at org.eclipse.jdt.core.JavaCore.setClasspathContainer(JavaCore .java:4519)
at
msjava.ide.eclipse.msde.classpath.MSPkgClasspathContainerIni tializer.initialize(MSPkgClasspathContainerInitializer.java: 67)
at
org.eclipse.jdt.internal.core.JavaModelManager.initializeCon tainer(JavaModelManager.java:2218)
at
org.eclipse.jdt.internal.core.JavaModelManager$9.run(JavaMod elManager.java:2148)
at
org.eclipse.jdt.internal.core.JavaModelManager.initializeAll Containers(JavaModelManager.java:2162)
at
org.eclipse.jdt.internal.core.JavaModelManager.getClasspathC ontainer(JavaModelManager.java:1544)
at org.eclipse.jdt.core.JavaCore.getClasspathContainer(JavaCore .java:1571)
at
org.eclipse.jdt.internal.core.JavaProject.resolveClasspath(J avaProject.java:2558)
at
org.eclipse.jdt.internal.core.JavaProject.getResolvedClasspa th(JavaProject.java:1848)
at
org.eclipse.jdt.internal.core.DeltaProcessingState.initializ eRoots(DeltaProcessingState.java:202)
at
org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaMod elOperation.java:717)
at
org.eclipse.jdt.internal.core.JavaModelOperation.runOperatio n(JavaModelOperation.java:780)
at org.eclipse.jdt.core.JavaCore.setClasspathVariables(JavaCore .java:4605)
at org.eclipse.jdt.core.JavaCore.setClasspathVariable(JavaCore. java:4569)
at
msjava.ide.eclipse.msde.classpath.MSVariableInitializer.setV ariableValue(MSVariableInitializer.java:89)
at
msjava.ide.eclipse.msde.classpath.MSVariableInitializer.init ialize(MSVariableInitializer.java:46)
at
msjava.ide.eclipse.msde.classpath.MSVariableInitializer.init ializeDefaultVariables(MSVariableInitializer.java:99)
at msjava.ide.eclipse.msde.MSDEPlugin.<init>(MSDEPlugin.java:65)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Nativ e Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(Native ConstructorAccessorImpl.java:39)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(De legatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:4 94)
at java.lang.Class.newInstance0(Class.java:350)
at java.lang.Class.newInstance(Class.java:303)
at
org.eclipse.osgi.framework.internal.core.AbstractBundle.load BundleActivator(AbstractBundle.java:136)
... 38 more
Root exception:
java.lang.NullPointerException
at org.eclipse.core.runtime.Plugin$1.run(Plugin.java:353)
at org.eclipse.core.runtime.Plugin.getPluginPreferences(Plugin. java:356)
at
msjava.ide.eclipse.msde.classpath.MSPkgClasspathContainer.ge tMSPkgOverride(MSPkgClasspathContainer.java:199)
at
msjava.ide.eclipse.msde.classpath.MSPkgClasspathContainer.in itializeEntries(MSPkgClasspathContainer.java:285)
at
msjava.ide.eclipse.msde.classpath.MSPkgClasspathContainer.ge tClasspathEntries(MSPkgClasspathContainer.java:255)
at
org.eclipse.jdt.internal.core.JavaModelManager.containerPutI fInitializingWithSameEntries(JavaModelManager.java:547)
at
org.eclipse.jdt.internal.core.SetContainerOperation.executeO peration(SetContainerOperation.java:49)
at
org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaMod elOperation.java:720)
at
org.eclipse.jdt.internal.core.JavaModelOperation.runOperatio n(JavaModelOperation.java:780)
at org.eclipse.jdt.core.JavaCore.setClasspathContainer(JavaCore .java:4519)
at
msjava.ide.eclipse.msde.classpath.MSPkgClasspathContainerIni tializer.initialize(MSPkgClasspathContainerInitializer.java: 67)
at
org.eclipse.jdt.internal.core.JavaModelManager.initializeCon tainer(JavaModelManager.java:2218)
at
org.eclipse.jdt.internal.core.JavaModelManager$9.run(JavaMod elManager.java:2148)
at
org.eclipse.jdt.internal.core.JavaModelManager.initializeAll Containers(JavaModelManager.java:2162)
at
org.eclipse.jdt.internal.core.JavaModelManager.getClasspathC ontainer(JavaModelManager.java:1544)
at org.eclipse.jdt.core.JavaCore.getClasspathContainer(JavaCore .java:1571)
at
org.eclipse.jdt.internal.core.JavaProject.resolveClasspath(J avaProject.java:2558)
at
org.eclipse.jdt.internal.core.JavaProject.getResolvedClasspa th(JavaProject.java:1848)
at
org.eclipse.jdt.internal.core.DeltaProcessingState.initializ eRoots(DeltaProcessingState.java:202)
at
org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaMod elOperation.java:717)
at
org.eclipse.jdt.internal.core.JavaModelOperation.runOperatio n(JavaModelOperation.java:780)
at org.eclipse.jdt.core.JavaCore.setClasspathVariables(JavaCore .java:4605)
at org.eclipse.jdt.core.JavaCore.setClasspathVariable(JavaCore. java:4569)
at
msjava.ide.eclipse.msde.classpath.MSVariableInitializer.setV ariableValue(MSVariableInitializer.java:89)
at
msjava.ide.eclipse.msde.classpath.MSVariableInitializer.init ialize(MSVariableInitializer.java:46)
at
msjava.ide.eclipse.msde.classpath.MSVariableInitializer.init ializeDefaultVariables(MSVariableInitializer.java:99)
at msjava.ide.eclipse.msde.MSDEPlugin.<init>(MSDEPlugin.java:65)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Nativ e Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(Native ConstructorAccessorImpl.java:39)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(De legatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:4 94)
at java.lang.Class.newInstance0(Class.java:350)
at java.lang.Class.newInstance(Class.java:303)
at
org.eclipse.osgi.framework.internal.core.AbstractBundle.load BundleActivator(AbstractBundle.java:136)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tart(BundleContextImpl.java:970)
at
org.eclipse.osgi.framework.internal.core.BundleHost.startWor ker(BundleHost.java:346)
at
org.eclipse.osgi.framework.internal.core.AbstractBundle.star t(AbstractBundle.java:260)
at
org.eclipse.osgi.framework.util.SecureAction.start(SecureAct ion.java:400)
at
org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter .postFindLocalClass(EclipseLazyStarter.java:111)
at
org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLoc alClass(ClasspathManager.java:417)
at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.fin dLocalClass(DefaultClassLoader.java:189)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findLo calClass(BundleLoader.java:340)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl assInternal(BundleLoader.java:408)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:369)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:357)
at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loa dClass(DefaultClassLoader.java:83)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.loadCl ass(BundleLoader.java:289)
at
org.eclipse.osgi.framework.internal.core.BundleHost.loadClas s(BundleHost.java:227)
at
org.eclipse.osgi.framework.internal.core.AbstractBundle.load Class(AbstractBundle.java:1269)
at
org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI .createExecutableExtension(RegistryStrategyOSGI.java:160)
at
org.eclipse.core.internal.registry.ExtensionRegistry.createE xecutableExtension(ExtensionRegistry.java:788)
at
org.eclipse.core.internal.registry.ConfigurationElement.crea teExecutableExtension(ConfigurationElement.java:243)
at
org.eclipse.core.internal.registry.ConfigurationElementHandl e.createExecutableExtension(ConfigurationElementHandle.java: 51)
at
org.eclipse.jdt.core.JavaCore.computeClasspathContainerIniti alizer(JavaCore.java:1618)
at
org.eclipse.jdt.core.JavaCore.getClasspathContainerInitializ er(JavaCore.java:1594)
at
org.eclipse.jdt.internal.core.JavaModelManager.initializeCon tainer(JavaModelManager.java:2199)
at
org.eclipse.jdt.internal.core.JavaModelManager.getClasspathC ontainer(JavaModelManager.java:1546)
at org.eclipse.jdt.core.JavaCore.getClasspathContainer(JavaCore .java:1571)
at
org.eclipse.jdt.internal.core.JavaProject.resolveClasspath(J avaProject.java:2558)
at
org.eclipse.jdt.internal.core.JavaProject.getResolvedClasspa th(JavaProject.java:1848)
at
org.eclipse.jdt.internal.core.DeltaProcessor.createExternalA rchiveDelta(DeltaProcessor.java:802)
at
org.eclipse.jdt.internal.core.DeltaProcessor.resourceChanged (DeltaProcessor.java:1897)
at
org.eclipse.jdt.internal.core.DeltaProcessingState.resourceC hanged(DeltaProcessingState.java:368)
at
org.eclipse.core.internal.events.NotificationManager$2.run(N otificationManager.java:282)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at
org.eclipse.core.internal.events.NotificationManager.notify( NotificationManager.java:276)
at
org.eclipse.core.internal.events.NotificationManager.broadca stChanges(NotificationManager.java:148)
at
org.eclipse.core.internal.resources.Workspace.broadcastPostC hange(Workspace.java:311)
at
org.eclipse.core.internal.resources.Workspace.endOperation(W orkspace.java:1018)
at
org.eclipse.core.internal.resources.InternalWorkspaceJob.run (InternalWorkspaceJob.java:45)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Re: Plugin.getBundle() == null! [message #101843 is a reply to message #101834] Wed, 21 November 2007 15:30 Go to previous message
Miles Daffin is currently offline Miles DaffinFriend
Messages: 86
Registered: July 2009
Member
This is now solved.

The issue was some code in the plugin constructor that caused the
classpath conatiner code to be executed, which in turn depended on the
plugin being properly started.

Sorry for cluttering up the channel.

Miles
Previous Topic:RMIClassLoader can't find my class.
Next Topic:Package uses conflict error
Goto Forum:
  


Current Time: Thu Jan 18 09:37:34 GMT 2018

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

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