Skip to main content



      Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » NPE in AbstractBundleContainer with Eclipse 3.6
NPE in AbstractBundleContainer with Eclipse 3.6 [message #536124] Thu, 27 May 2010 03:59 Go to next message
Eclipse UserFriend
Hi,

I'm trying to move an RCP application from 3.5 to 3.6

With 3.6, a NPE occured at startup:
!ENTRY org.eclipse.core.resources 4 2 2010-05-27 09:44:18.768
!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.core.resources".
!STACK 0
java.lang.NullPointerException
	at org.eclipse.pde.internal.core.target.AbstractBundleContainer.getVMArguments(AbstractBundleContainer.java:525)
	at org.eclipse.pde.internal.core.target.TargetPlatformService.newDefaultTargetDefinition(TargetPlatformService.java:525)
	at org.eclipse.pde.internal.core.PluginModelManager.initDefaultTargetPlatformDefinition(PluginModelManager.java:574)
	at org.eclipse.pde.internal.core.PluginModelManager.initializeTable(PluginModelManager.java:527)
	at org.eclipse.pde.internal.core.PluginModelManager.findModel(PluginModelManager.java:869)
	at org.eclipse.pde.core.plugin.PluginRegistry.findModel(PluginRegistry.java:105)
	at org.eclipse.pde.internal.core.builders.BundleErrorReporter.validateContent(BundleErrorReporter.java:50)
	at org.eclipse.pde.internal.core.builders.ManifestConsistencyChecker.validateManifestFile(ManifestConsistencyChecker.java:269)
	at org.eclipse.pde.internal.core.builders.ManifestConsistencyChecker.validateProject(ManifestConsistencyChecker.java:227)
	at org.eclipse.pde.internal.core.builders.ManifestConsistencyChecker.build(ManifestConsistencyChecker.java:157)
	at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:629)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:172)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:203)
	at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:255)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:258)
	at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:311)
	at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:343)
	at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:144)
	at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:242)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)


I set a breakpoint in 3.5 and so I notice that the method getVMArguments is not called.

Any idea why this happened?

Regards,
Re: NPE in AbstractBundleContainer with Eclipse 3.6 [message #536294 is a reply to message #536124] Thu, 27 May 2010 10:52 Go to previous messageGo to next message
Eclipse UserFriend
What version of Eclipse 3.6 are you using? With the most recent code, line 525 is where we first access FrameworkAdmin. If we are unable to get the framework admin service we would fail with an NPE in this case, but I expect there would be many other problems with the target as we use framework admin when managing targets and launching.
Re: NPE in AbstractBundleContainer with Eclipse 3.6 [message #536299 is a reply to message #536124] Thu, 27 May 2010 11:01 Go to previous messageGo to next message
Eclipse UserFriend
Ouch I forgot to mention the version of Eclipse 3.6 :s so it is the RC1, build ID: 20100520-1308
The plugin where the NPE occured is: org.eclipse.pde.core_3.6.0.v20100512.jar

I notice that the same error is happening when I try to setRawClassPath on a java project.
EDIT: it seems that is each time the builder is running:
java.lang.NullPointerException
	at org.eclipse.pde.internal.core.target.AbstractBundleContainer.getVMArguments(AbstractBundleContainer.java:525)
	at org.eclipse.pde.internal.core.target.TargetPlatformService.newDefaultTargetDefinition(TargetPlatformService.java:525)
	at org.eclipse.pde.internal.core.PluginModelManager.initDefaultTargetPlatformDefinition(PluginModelManager.java:574)
	at org.eclipse.pde.internal.core.PluginModelManager.initializeTable(PluginModelManager.java:527)
	at org.eclipse.pde.internal.core.PluginModelManager.findModel(PluginModelManager.java:869)
	at org.eclipse.pde.core.plugin.PluginRegistry.findModel(PluginRegistry.java:105)
	at org.eclipse.pde.internal.core.builders.BundleErrorReporter.validateContent(BundleErrorReporter.java:50)
	at org.eclipse.pde.internal.core.builders.ManifestConsistencyChecker.validateManifestFile(ManifestConsistencyChecker.java:269)
	at org.eclipse.pde.internal.core.builders.ManifestConsistencyChecker.validateProject(ManifestConsistencyChecker.java:227)
	at org.eclipse.pde.internal.core.builders.ManifestConsistencyChecker.build(ManifestConsistencyChecker.java:157)
	at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:629)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:172)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:203)
	at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:255)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:258)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:220)
	at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:362)
	at org.eclipse.core.internal.resources.Project$1.run(Project.java:545)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1975)
	at org.eclipse.core.internal.resources.Project.internalBuild(Project.java:524)
	at org.eclipse.core.internal.resources.Project.build(Project.java:115)


Do you have any idea why the FrameworkAdmin service will not be available? What can I check?

[Updated on: Thu, 27 May 2010 11:19] by Moderator

Re: NPE in AbstractBundleContainer with Eclipse 3.6 [message #536301 is a reply to message #536124] Thu, 27 May 2010 11:12 Go to previous messageGo to next message
Eclipse UserFriend
I debug a little.
In serviceRegistry, l.887: there is nothing register for the class " org.eclipse.equinox.internal.provisional.frameworkadmin.Fram eworkAdmin " in the map "publishedServicesByClass"

This is the keyset of the map:
publishedServicesByClass.keySet();
	 (java.util.HashMap$KeySet) [org.eclipse.core.runtime.IBundleGroupProvider, org.eclipse.osgi.framework.console.ConsoleSession, org.eclipse.equinox.p2.core.IProvisioningAgent, org.eclipse.core.internal.preferences.exchange.IProductPreferencesService, org.eclipse.osgi.service.urlconversion.URLConverter, org.eclipse.core.runtime.IExtensionRegistry, javax.xml.parsers.DocumentBuilderFactory, org.eclipse.core.runtime.preferences.IPreferencesService, org.eclipse.osgi.service.runnable.StartupMonitor, org.eclipse.osgi.service.pluginconversion.PluginConverter, org.eclipse.core.internal.preferences.exchange.ILegacyPreferences, org.eclipse.osgi.service.runnable.ApplicationLauncher, org.eclipse.osgi.framework.log.FrameworkLog, org.eclipse.core.runtime.content.IContentTypeManager, org.eclipse.osgi.service.localization.BundleLocalization, javax.xml.parsers.SAXParserFactory, org.eclipse.core.runtime.IAdapterManager, org.eclipse.osgi.service.debug.DebugOptions, org.eclipse.equinox.p2.core.IAgentLocation, org.eclipse.osgi.service.resolver.PlatformAdmin, org.eclipse.pde.internal.core.target.provisional.ITargetPlatformService, org.eclipse.core.runtime.jobs.IJobManager, org.osgi.service.framework.CompositeBundleFactory, org.eclipse.equinox.internal.provisional.configurator.Configurator, org.eclipse.osgi.service.environment.EnvironmentInfo, org.eclipse.update.configurator.IPlatformConfigurationFactory, org.eclipse.osgi.service.datalocation.Location, org.osgi.service.packageadmin.PackageAdmin, org.osgi.service.startlevel.StartLevel, java.lang.ClassLoader, org.eclipse.equinox.app.IApplicationContext, org.eclipse.osgi.internal.provisional.verifier.CertificateVerifierFactory, org.osgi.service.prefs.PreferencesService, org.eclipse.osgi.service.security.TrustEngine, org.osgi.service.permissionadmin.PermissionAdmin, org.eclipse.osgi.signedcontent.SignedContentFactory, org.osgi.service.application.ApplicationDescriptor, org.osgi.service.url.URLStreamHandlerService, org.eclipse.osgi.framework.console.CommandProvider, org.eclipse.core.resources.IWorkspace, org.eclipse.pde.core.project.IBundleProjectService, org.osgi.service.application.ApplicationHandle, org.osgi.service.condpermadmin.ConditionalPermissionAdmin]


Do you know who is responsible to register service for class org.eclipse.equinox.internal.provisional.frameworkadmin.Fram eworkAdmin?
Re: NPE in AbstractBundleContainer with Eclipse 3.6 [message #536332 is a reply to message #536124] Thu, 27 May 2010 12:49 Go to previous messageGo to next message
Eclipse UserFriend
me again.

I find who was registering the FrameworkAdmin service in 3.5. It was in the start of the bundle /org.eclipse.equinox.frameworkadmin.equinox

But with the new version there is no more Activator and so on no launch of this service on start.
Re: NPE in AbstractBundleContainer with Eclipse 3.6 [message #536347 is a reply to message #536124] Thu, 27 May 2010 13:49 Go to previous messageGo to next message
Eclipse UserFriend
ok problem solved!!

After ask on equinox forum (here)

now the service is launched using Declarative Service and so on: the plugin org.eclipse.equinox.ds is required

So org.eclipse.pde.core required org.eclipse.equinox.ds.
Do I need to open a bug for that?

Regards,
Re: NPE in AbstractBundleContainer with Eclipse 3.6 [message #536358 is a reply to message #536347] Thu, 27 May 2010 14:50 Go to previous messageGo to next message
Eclipse UserFriend
This is not a bug with PDE as we ask OSGi for the service. We don't know if it is provided using declarative services.

I don't know if org.eclipse.equinox.frameworkadmin.equinox should have a dependency on ds. You could ask in the equinox forum. I expect that they don't want to add a dependency because the bundle can run without ds, just the service won't be available.
Re: NPE in AbstractBundleContainer with Eclipse 3.6 [message #536359 is a reply to message #536124] Thu, 27 May 2010 14:55 Go to previous messageGo to next message
Eclipse UserFriend
Ok, so it is just needed to avoid the NPE if the service is not here, isn't it?
Re: NPE in AbstractBundleContainer with Eclipse 3.6 [message #536372 is a reply to message #536124] Thu, 27 May 2010 16:29 Go to previous message
Eclipse UserFriend
If the framework admin service is unavailable you are going to encounter other problems working with the target, but I suppose a core exception saying the service can't be found is better than an npe.

If you file a bug against PDE UI I will look at it for 3.7.
Re: NPE in AbstractBundleContainer with Eclipse 3.6 [message #605880 is a reply to message #536347] Thu, 27 May 2010 14:50 Go to previous message
Eclipse UserFriend
This is not a bug with PDE as we ask OSGi for the service. We don't know if it is provided using declarative services.

I don't know if org.eclipse.equinox.frameworkadmin.equinox should have a dependency on ds. You could ask in the equinox forum. I expect that they don't want to add a dependency because the bundle can run without ds, just the service won't be available.
Previous Topic:How to zip an update site?
Next Topic:NPE in AbstractBundleContainer with Eclipse 3.6
Goto Forum:
  


Current Time: Tue Jul 08 17:34:45 EDT 2025

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

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

Back to the top