Announcement Announcement Module
Collapse
No announcement yet.
Datanucleus Configuration Problem Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Datanucleus Configuration Problem

    Hello all.

    I've a working configuration with JDO datanucleus:

    Code:
    	<bean id="pmf" class="org.springframework.orm.jdo.LocalPersistenceManagerFactoryBean">
            <property name="jdoProperties">
                <props>
                    <prop key="javax.jdo.PersistenceManagerFactoryClass">org.datanucleus.api.jdo.JDOPersistenceManagerFactory</prop>
    				<!-- <prop key="javax.jdo.option.ConnectionFactoryName">java:comp/env/jdbc/TestDB</prop> -->
    				<!-- <prop key="javax.jdo.option.ConnectionFactory2Name">java:comp/env/jdbc/TestDB</prop> -->
                     <prop key="javax.jdo.option.ConnectionURL">jdbc:sqlserver://localhost:1433;databaseName=MyTestDB;</prop>
                     <prop key="javax.jdo.option.ConnectionUserName">myUser</prop>
                     <prop key="javax.jdo.option.ConnectionPassword">myPassword</prop>
                     <prop key="javax.jdo.option.ConnectionDriverName">com.microsoft.sqlserver.jdbc.SQLServerDriver</prop>
                </props> 
            </property>
        </bean>
    If i uncomment the javax.jdo.option.ConnectionFactoryName properties to use jndi datasource defined in my web app doing like this:

    Code:
    	<bean id="pmf" class="org.springframework.orm.jdo.LocalPersistenceManagerFactoryBean">
            <property name="jdoProperties">
                <props>
                    <prop key="javax.jdo.PersistenceManagerFactoryClass">org.datanucleus.api.jdo.JDOPersistenceManagerFactory</prop>
    				 <prop key="javax.jdo.option.ConnectionFactoryName">java:comp/env/jdbc/TestDB</prop>
    				 <prop key="javax.jdo.option.ConnectionFactory2Name">java:comp/env/jdbc/TestDB</prop>
                </props> 
            </property>
        </bean>
    The application stop working leaving this exception on start:

    Code:
    GRAVE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pmf' defined in ServletContext resource [/WEB-INF/spring/root-context.xml]: Invocation of init method failed; nested exception is javax.jdo.JDOFatalInternalException: 0
    NestedThrowables:
    java.lang.ArrayIndexOutOfBoundsException: 0
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1420)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
    	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
    	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
    	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:563)
    	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
    	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
    	at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276)
    	at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)
    	at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
    	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4723)
    	at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5226)
    	at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5221)
    	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    	at java.lang.Thread.run(Thread.java:662)
    Caused by: javax.jdo.JDOFatalInternalException: 0
    NestedThrowables:
    java.lang.ArrayIndexOutOfBoundsException: 0
    	at org.datanucleus.api.jdo.NucleusJDOHelper.getJDOExceptionForNucleusException(NucleusJDOHelper.java:528)
    	at org.datanucleus.api.jdo.JDOPersistenceManagerFactory.freezeConfiguration(JDOPersistenceManagerFactory.java:545)
    	at org.datanucleus.api.jdo.JDOPersistenceManagerFactory.createPersistenceManagerFactory(JDOPersistenceManagerFactory.java:300)
    	at org.datanucleus.api.jdo.JDOPersistenceManagerFactory.getPersistenceManagerFactory(JDOPersistenceManagerFactory.java:196)
    	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:721)
    	at org.springframework.orm.jdo.LocalPersistenceManagerFactoryBean.newPersistenceManagerFactory(LocalPersistenceManagerFactoryBean.java:271)
    	at org.springframework.orm.jdo.LocalPersistenceManagerFactoryBean.afterPropertiesSet(LocalPersistenceManagerFactoryBean.java:234)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1477)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1417)
    	... 20 more
    Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
    	at org.datanucleus.plugin.PluginManager.getConfigurationElementsForExtension(PluginManager.java:183)
    	at org.datanucleus.plugin.PluginManager.getConfigurationElementForExtension(PluginManager.java:145)
    	at org.datanucleus.plugin.PluginManager.getConfigurationElementForExtension(PluginManager.java:110)
    	at org.datanucleus.plugin.PluginManager.createExecutableExtension(PluginManager.java:293)
    	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:532)
    	... 36 more
    I'm searching for documentation about but I can't find nothing.

    Someone can help?

    Thanks.
Working...
X