1

我通过 Maven 设置了 PlayORM。

我的主要课程基本上是从这里的示例中复制而来的。

每件事都设置正确并且看起来很好但是我得到了某种日期转换错误。


下面的堆栈跟踪:

Exception in thread "main" java.lang.NoSuchMethodError: org.joda.time.LocalDateTime.toDate()Ljava/util/Date;
at com.alvazan.orm.api.base.spi.UniqueKeyGenerator.<clinit>(UniqueKeyGenerator.java:32)
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 java.lang.Class.newInstance0(Class.java:355)
at java.lang.Class.newInstance(Class.java:308)
at com.alvazan.orm.api.z8spi.meta.ReflectionUtil.create(ReflectionUtil.java:11)
at com.alvazan.orm.impl.meta.scan.ScannerForField.processId(ScannerForField.java:94)
at com.alvazan.orm.impl.meta.scan.ScannerForClass.processIdFieldWorks(ScannerForClass.java:235)
at com.alvazan.orm.impl.meta.scan.ScannerForClass.inspectFieldImpl(ScannerForClass.java:207)
at com.alvazan.orm.impl.meta.scan.ScannerForClass.inspectField(ScannerForClass.java:194)
at com.alvazan.orm.impl.meta.scan.ScannerForClass.scanFields(ScannerForClass.java:189)
at com.alvazan.orm.impl.meta.scan.ScannerForClass.scanSingle(ScannerForClass.java:112)
at com.alvazan.orm.impl.meta.scan.ScannerForClass.addClass(ScannerForClass.java:69)
at com.alvazan.orm.layer0.base.MyClassAnnotationDiscoveryListener.scanClass(MyClassAnnotationDiscoveryListener.java:42)
at com.alvazan.orm.layer0.base.MyClassAnnotationDiscoveryListener.discovered(MyClassAnnotationDiscoveryListener.java:34)
at com.impetus.annovention.Discoverer.discoverAndIntimateForClassAnnotations(Discoverer.java:197)
at com.impetus.annovention.Discoverer.discover(Discoverer.java:155)
at com.alvazan.orm.layer0.base.BaseEntityManagerFactoryImpl.rescan(BaseEntityManagerFactoryImpl.java:80)
at com.alvazan.orm.layer0.base.BaseEntityManagerFactoryImpl.setup(BaseEntityManagerFactoryImpl.java:131)
at com.alvazan.orm.impl.bindings.BootstrapImpl.createInstanceImpl(BootstrapImpl.java:64)
at com.alvazan.orm.impl.bindings.BootstrapImpl.createInstance(BootstrapImpl.java:35)
at com.alvazan.orm.api.base.Bootstrap.create(Bootstrap.java:57)
at com.alvazan.orm.api.base.Bootstrap.create(Bootstrap.java:52)
at com.sample.cass.store.Example.main(Example.java:22)
4

2 回答 2

0

您能否在此处复制粘贴您的代码并完成错误日志。从您粘贴的日志来看,似乎是:

您的类路径中有一些不同版本的 JodaTime jar 没有此方法。
或者
您复制的堆栈跟踪不完整,问题类似于PlayORM 可以利用顺序数据布局吗?因为它在(UniqueKeyGenerator.java 的第 32 行)抛出错误

于 2013-05-15T07:58:24.433 回答
0

我遇到过同样的问题。原因是“jruby-complete-1.6.5”库附带“joda time 1.6.2”。

于 2013-06-19T20:17:40.433 回答