| Summary: | NPE in getUniqueIdentifier | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Tools] CDT | Reporter: | Miwako Tokugawa <miwako.tokugawa> | ||||||
| Component: | cdt-build-managed | Assignee: | Project Inbox <cdt-build-managed-inbox> | ||||||
| Status: | NEW --- | QA Contact: | Jonah Graham <jonah> | ||||||
| Severity: | normal | ||||||||
| Priority: | P3 | CC: | cdtdoug, jamesblackburn+eclipse | ||||||
| Version: | 8.0 | ||||||||
| Target Milestone: | --- | ||||||||
| Hardware: | PC | ||||||||
| OS: | Linux | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
The class is there in 7.0.X. Maybe you got memory issues or corrupted installation? Right.. I'm using ConfigurationDataProvider.java in my source tree too. Let me check out cdt7_0_1 from scratch and try again. (In reply to comment #2) > Right.. I'm using ConfigurationDataProvider.java in my source tree too. Let me > check out cdt7_0_1 from scratch and try again. Sorry, typo. I"m "seeing" Seems a little better with the fresh checkout. (no error)
I'm getting
!MESSAGE Plug-in "org.eclipse.cdt.managedbuilder.core" was unable to instantiate class "org.eclipse.cdt.managedbuilder.internal.dataprovider.ConfigurationDataProvider".
The class shows up in the backtrace, so it is there.
Caused by: java.lang.NullPointerException:
at org.eclipse.cdt.managedbuilder.core.ManagedBuilderCorePlugin.getUniqueIdentifier(ManagedBuilderCorePlugin.java:73)
at org.eclipse.cdt.managedbuilder.internal.dataprovider.ConfigurationDataProvider.<clinit>(ConfigurationDataProvider.java:72)
Created attachment 187785 [details]
backtrace
As far as I understand, to be able to instantiate a class outside of the package its package needs to be exported in MANIFEST.MF of managedbuilder.core. If you are compiling 7.0.1 branch try to add in there org.eclipse.cdt.managedbuilder.internal.dataprovider;x-internal:=true, If it does not help, looks like bug 313038 did some related changes, maybe try to apply the attached path in reverse. >looks like bug 313038 did some related changes, maybe try to apply the attached path in reverse. Wow, thanks. Yeap, this fixed the problem. Actually the ConfigurationDataProvider instantiation error is caused by a NPE, i.e. Caused by: java.lang.NullPointerException: at org.eclipse.cdt.managedbuilder.core.ManagedBuilderCorePlugin.getUniqueIdentifier(ManagedBuilderCorePlugin.java:73) at org.eclipse.cdt.managedbuilder.internal.dataprovider.ConfigurationDataProvider.<clinit>(ConfigurationDataProvider.java:72) When I comment out the CConfigurationDataProviderDescriptor.java change you made for bug 313028, i.e. try { fProvider = createProvider(extension); } catch (CoreException e) { CCorePlugin.log(e.getStatus()); } I don’t get the NPE or the instantiation error, and my code works ok. Thanks. Could you also try exporting the package in the manifest to see if that fixes the issue? (In reply to comment #8) > Could you also try exporting the package in the manifest to see if that fixes > the issue? Hi, James. I tried and it doesn't fix the issue. We clearly need a test case for whatever your code is doing... Created attachment 187884 [details]
testcase (run as junit plugin test)
|
Build Identifier: cdt7.0.1 (ok with cdt6.0.2) Hi. I get the error described when I run a code using cdt7.0.1. The same code works ok when running with cdt6.0.2. The backtrace is as follows: java.lang.NoClassDefFoundError: org/eclipse/cdt/managedbuilder/internal/dataprovider/ConfigurationDataProvider at org.eclipse.cdt.managedbuilder.core.ManagedBuildManager.findBuildInfo(ManagedBuildManager.java:2747) at org.eclipse.cdt.managedbuilder.core.ManagedBuildManager.getBuildInfo(ManagedBuildManager.java:2992) at org.eclipse.cdt.managedbuilder.internal.core.PropertyManager.getConfigurationFromId(PropertyManager.java:379) at org.eclipse.cdt.managedbuilder.internal.core.PropertyManager.access$0(PropertyManager.java:376) at org.eclipse.cdt.managedbuilder.internal.core.PropertyManager$LoaddedInfo.getConfiguration(PropertyManager.java:66) at org.eclipse.cdt.managedbuilder.internal.core.PropertyManager.setLoaddedData(PropertyManager.java:404) at org.eclipse.cdt.managedbuilder.internal.core.PropertyManager.getData(PropertyManager.java:350) at org.eclipse.cdt.managedbuilder.internal.core.PropertyManager.loadProperties(PropertyManager.java:184) at org.eclipse.cdt.managedbuilder.internal.core.PropertyManager.getProperties(PropertyManager.java:123) at org.eclipse.cdt.managedbuilder.internal.core.PropertyManager.getProperty(PropertyManager.java:116) at org.eclipse.cdt.managedbuilder.internal.core.PropertyManager.getProperty(PropertyManager.java:451) at org.eclipse.cdt.managedbuilder.internal.core.Tool.<init>(Tool.java:348) at org.eclipse.cdt.managedbuilder.internal.core.ToolChain.<init>(ToolChain.java:260) at org.eclipse.cdt.managedbuilder.internal.core.FolderInfo.<init>(FolderInfo.java:141) at org.eclipse.cdt.managedbuilder.internal.core.Configuration.<init>(Configuration.java:416) at org.eclipse.cdt.managedbuilder.internal.core.ManagedProject.<init>(ManagedProject.java:142) at org.eclipse.cdt.managedbuilder.internal.core.ManagedBuildInfo.<init>(ManagedBuildInfo.java:127) at org.eclipse.cdt.managedbuilder.core.ManagedBuildManager.loadOldStyleBuildInfo(ManagedBuildManager.java:2035) at org.eclipse.cdt.managedbuilder.core.ManagedBuildManager.getOldStyleBuildInfo(ManagedBuildManager.java:2959) at org.eclipse.cdt.managedbuilder.internal.dataprovider.ProjectConverter.convertManagedBuildInfo(ProjectConverter.java:583) at org.eclipse.cdt.managedbuilder.internal.dataprovider.ProjectConverter.convertProject(ProjectConverter.java:147) at org.eclipse.cdt.internal.core.settings.model.xml.XmlProjectDescriptionStorage.getConvertedDescription(XmlProjectDescriptionStorage.java:414) at org.eclipse.cdt.internal.core.settings.model.xml.XmlProjectDescriptionStorage.getProjectDescription(XmlProjectDescriptionStorage.java:240) at org.eclipse.cdt.internal.core.settings.model.CProjectDescriptionManager.getProjectDescriptionInternal(CProjectDescriptionManager.java:416) at org.eclipse.cdt.internal.core.settings.model.CProjectDescriptionManager.getProjectDescription(CProjectDescriptionManager.java:398) at org.eclipse.cdt.managedbuilder.core.ManagedBuildManager.findBuildInfo(ManagedBuildManager.java:2731) at org.eclipse.cdt.managedbuilder.core.ManagedBuildManager.getBuildInfo(ManagedBuildManager.java:2992) at org.eclipse.cdt.managedbuilder.core.ManagedBuildManager.getBuildInfo(ManagedBuildManager.java:2947) Reproducible: Always