DataNucleus JIRA is now in read-only mode. Raise any new issues in GitHub against the plugin that it applies to. DataNucleus JIRA will remain for the foreseeable future but will eventually be discontinued
Issue Details (XML | Word | Printable)

Key: NUCCORE-689
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Unassigned
Reporter: Andrew Baxter
Votes: 0
Watchers: 2

If you were logged in you would be able to see more operations.
DataNucleus Core

Invalid manifests prevent DN from starting

Created: 01/Apr/11 06:22 PM   Updated: 18/Feb/14 09:22 AM   Resolved: 05/Apr/11 10:06 AM
Component/s: None
Affects Version/s: 3.0.0.m3
Fix Version/s: 3.0.0.m4

 Description  « Hide
If DataNucleus checks a manifest file that is missing a symbolic name, it fails with a NPE instead of failing early and returning null. In our case, DataNucleus was checking aspectjtools-1.6.5.jar which has a broken manifest. I believe the expected behavior is for it to return null and ignore that bundle, rather than throw an exception.

The easy solution would be to check if the symbolic name is null. Alternatively, PluginParser.parseManifest could return a null bundle if the symbolic name is missing, but I don't know which behavior is expected.

This might have been in m2 as well, but I couldn't figure out which revision m2 started at. I believe it survived the bad manifest in m1, but I don't know why that would be from briefly glancing at the code.

Index: src/java/org/datanucleus/plugin/
--- src/java/org/datanucleus/plugin/ (revision 12679)
+++ src/java/org/datanucleus/plugin/ (working copy)
@@ -490,7 +490,7 @@
     protected Bundle registerBundle(Manifest mf, URL manifest)
         Bundle bundle = PluginParser.parseManifest(mf, manifest);
- if (bundle == null)
+ if (bundle == null || bundle.getSymbolicName() == null)
             // Didn't parse correctly, so ignore it
             return null;

Sort Order: Ascending order - Click to sort in descending order
Andy Jefferson added a comment - 01/Apr/11 07:43 PM
Any report of an NPE would logically quote it (and stack trace).

Andrew Baxter added a comment - 01/Apr/11 07:56 PM - edited
Sorry, here's the stack trace:

Caused by: java.lang.NullPointerException
at org.datanucleus.plugin.NonManagedPluginRegistry.registerBundle(
at org.datanucleus.plugin.NonManagedPluginRegistry.registerBundle(
at org.datanucleus.plugin.NonManagedPluginRegistry.registerExtensions(
at org.datanucleus.plugin.NonManagedPluginRegistry.registerExtensionPoints(
at org.datanucleus.plugin.PluginManager.<init>(
at org.datanucleus.NucleusContext.<init>(
at org.datanucleus.NucleusContext.<init>(
at org.datanucleus.api.jdo.JDOPersistenceManagerFactory.<init>(
at org.datanucleus.api.jdo.JDOPersistenceManagerFactory.createPersistenceManagerFactory(
at org.datanucleus.api.jdo.JDOPersistenceManagerFactory.getPersistenceManagerFactory(
... 41 more

Jeff Miller added a comment - 19/Apr/11 05:55 PM
Thank you for deleting the comments. Shows how professional DataNucleus is. When will a jar file be made available?

Andy Jefferson added a comment - 19/Apr/11 07:03 PM
When you reply in an insulting tone, yes comments get deleted. I simply informed you that there are two options ... 3.0.0.m4 release, or nightly builds. The former is undefined when it will be released. The latter has been provided nightly since 2004 (and is linked on the page entitled "Download", on every page on our website).

You have since replied in a further insulting tone, and I would strongly suggest that you change your behaviour to free, open source, products. The software is there for you to download, build, change, use as you see fit, but lack of respect for the people who develop it is uncalled for. If you don't like the product, then go and use something else; much simpler and more polite than questioning professionality ...

Jeff Miller added a comment - 19/Apr/11 07:20 PM
First off, I am not trying to be insulting. I am just trying to get answers and help. I just don't want to have to keep getting the nightly build and recompiling it. I don't have the time and resources to do so. I just asked a simple question and I just want a simple answer. If you don't know when you will get a jar built for this new release, just say so.

Chris Colman added a comment - 21/Apr/11 01:55 PM
The jars are built as part of the nightly build: You don't have to get the nightly build and then compile it unless you need to make a change that's not in the SVN trunk.