问题描述
|
对于我们应用程序中的JUnit测试,我正在尝试初始化datanucleus以使用sqlite数据库。但是,当我尝试获取
PersistenceManager
时,它在尝试创建fails1 fails表时会失败(我不完全知道为什么还需要此表)。
由于某些标识符长度问题,它在truncate()期间似乎失败。我试图调整各种数据核的各种配置属性都无济于事。
谁能向我解释为什么datanucleus觉得有必要创建这些“ 2”表,以及什么可能导致sqlite(org.sqlite.JDBC)数据库而不是MysqL导致这种截断失败?
日志:
Apr 12,2011 1:30:16 PM org.datanucleus.store.rdbms.table.AbstractTable create
INFO: Creating table DELETEME1302640216142
Apr 12,2011 1:32:10 PM org.datanucleus.store.rdbms.RDBMsstoreManager <init>
SEVERE: Failed initialising database. Please check that your database JDBC driver is accessible,and the database URL and username/password are correct. Exception : The length argument (=-3) is less than HASH_LENGTH(=4)!
java.lang.IllegalArgumentException: The length argument (=-3) is less than HASH_LENGTH(=4)!
完整堆栈跟踪:
java.lang.IllegalArgumentException: The length argument (=-3) is less than HASH_LENGTH(=4)!
at org.datanucleus.store.mapped.identifier.AbstractIdentifierFactory.truncate(AbstractIdentifierFactory.java:314)
at org.datanucleus.store.mapped.identifier.AbstractIdentifierFactory.newPrimaryKeyIdentifier(AbstractIdentifierFactory.java:661)
at org.datanucleus.store.rdbms.key.PrimaryKey.<init>(PrimaryKey.java:37)
at org.datanucleus.store.rdbms.table.TableImpl.getPrimaryKey(TableImpl.java:128)
at org.datanucleus.store.rdbms.table.TableImpl.getsqlCreateStatements(TableImpl.java:1264)
at org.datanucleus.store.rdbms.table.AbstractTable.create(AbstractTable.java:419)
at org.datanucleus.store.rdbms.RDBMsstoreManager.initialiseSchema(RDBMsstoreManager.java:676)
at org.datanucleus.store.rdbms.RDBMsstoreManager.<init>(RDBMsstoreManager.java:350)
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:597)
at org.datanucleus.plugin.PluginManager.createExecutableExtension(PluginManager.java:300)
at org.datanucleus.ObjectManagerFactoryImpl.initialiseStoreManager(ObjectManagerFactoryImpl.java:227)
at org.datanucleus.jdo.JDOPersistenceManagerFactory.freezeConfiguration(JDOPersistenceManagerFactory.java:591)
at org.datanucleus.jdo.JDOPersistenceManagerFactory.createPersistenceManagerFactory(JDOPersistenceManagerFactory.java:293)
at org.datanucleus.jdo.JDOPersistenceManagerFactory.getPersistenceManagerFactory(JDOPersistenceManagerFactory.java:189)
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)
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)