我通过maven设置了PlayORM。
我的主要课程基本上是从示例here复制的。
每件事情都设置得很好,看起来很好但是我得到了某种日期转换错误。
下面的Stacktrace:
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)
答案 0 :(得分:0)
您能否请复制粘贴代码并在此处填写错误日志。从您粘贴的日志中,似乎要么:
在你的类路径中有一些不同版本的JodaTime的jar,它没有这种方法
或
您复制的堆栈跟踪不完整,问题类似于Can PlayORM take advantage of sequential data layout?,因为它在(UniqueKeyGenerator.java的第32行)抛出错误
答案 1 :(得分:0)
我有同样的问题。 原因是“jruby-complete-1.6.5”库出现了“joda time 1.6.2”。