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: NUCRDBMS-539
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Marco Schulze
Reporter: Marco Schulze
Votes: 0
Watchers: 0
Operations

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

NullPointerException hides real exception

Created: 01/Jul/11 03:13 PM   Updated: 01/Jul/11 03:18 PM   Resolved: 01/Jul/11 03:18 PM
Component/s: None
Affects Version/s: None
Fix Version/s: None


 Description  « Hide
Original exception is lost: MappedStoreManager:160 - throw new
NucleusUserException(LOCALISER.msg("039003", idFactoryName)).setFatal();
Setting: props.put("datanucleus.identifierFactory", "datanucleus"); - es
gibt aber nur:
    <extension point="org.datanucleus.store_identifierfactory">
        <identifierfactory name="datanucleus2"
class-name="org.datanucleus.store.mapped.identifier.DN2IdentifierFactory"/>
        <identifierfactory name="jpa"
class-name="org.datanucleus.store.mapped.identifier.JPAIdentifierFactory"/>
        <identifierfactory name="datanucleus1"
class-name="org.datanucleus.store.mapped.identifier.DNIdentifierFactory"/>
        <identifierfactory name="jpox"
class-name="org.datanucleus.store.mapped.identifier.JPOXIdentifierFactory"/>
 
    </extension>


Exception that is shown:

SCHWERWIEGEND: Failed initialising database. Please check that your
database JDBC driver is accessible, and the database URL and
username/password are correct. Exception : null
java.lang.NullPointerException
        at
org.datanucleus.store.rdbms.ConnectionFactoryImpl$ManagedConnectionImpl.close(ConnectionFactoryImpl.java:488)
        at
org.datanucleus.store.rdbms.RDBMSStoreManager.<init>(RDBMSStoreManager.java:367)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
        at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        at
org.datanucleus.plugin.NonManagedPluginRegistry.createExecutableExtension(NonManagedPluginRegistry.java:677)
        at
org.datanucleus.plugin.PluginManager.createExecutableExtension(PluginManager.java:287)
        at
org.datanucleus.NucleusContext.createStoreManagerForProperties(NucleusContext.java:446)
        at
org.datanucleus.NucleusContext.initialise(NucleusContext.java:257)
        at
org.datanucleus.api.jdo.JDOPersistenceManagerFactory.freezeConfiguration(JDOPersistenceManagerFactory.java:527)
        at
org.datanucleus.api.jdo.JDOPersistenceManagerFactory.createPersistenceManagerFactory(JDOPersistenceManagerFactory.java:295)
        at
org.datanucleus.api.jdo.JDOPersistenceManagerFactory.getPersistenceManagerFactory(JDOPersistenceManagerFactory.java:191)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at javax.jdo.JDOHelper$16.run(JDOHelper.java:1965)
        at java.security.AccessController.doPrivileged(Native Method)
        at javax.jdo.JDOHelper.invoke(JDOHelper.java:1960)
        at
javax.jdo.JDOHelper.invokeGetPersistenceManagerFactoryOnImplementation(JDOHelper.java:1166)
        at
javax.jdo.JDOHelper.getPersistenceManagerFactory(JDOHelper.java:808)
        at
javax.jdo.JDOHelper.getPersistenceManagerFactory(JDOHelper.java:701)
        at
org.nightlabs.test.JDOTestRunner.createPersistenceManager(JDOTestRunner.java:118)
        at
org.nightlabs.test.JDOTestRunner.getPersistenceManager(JDOTestRunner.java:64)
        at
org.nightlabs.test.JDOTestRunner.createResources(JDOTestRunner.java:56)
        at org.nightlabs.test.JDOTestRunner.<init>(JDOTestRunner.java:36)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
        at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        at
org.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.java:31)
        at
org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:24)
        at
org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:57)
        at
org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:29)
        at
org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:57)
        at
org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:24)
        at
org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:51)
        at
org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:119)
        at
org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:101)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at
org.apache.maven.surefire.booter.ProviderFactory$ClassLoaderProxy.invoke(ProviderFactory.java:103)
        at $Proxy0.invoke(Unknown Source)
        at
org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:150)
        at
org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcess(SurefireStarter.java:91)
        at
org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:69)


Sort Order: Ascending order - Click to sort in descending order
Marco Schulze added a comment - 01/Jul/11 03:18 PM
I added a null-check, because ((RDBMSStoreManager)storeMgr).getSQLController() might return null as long as the initialisation is not complete (and the error here happened during initialisation).