Jadira usertype no class def found

不问归期 提交于 2019-12-11 10:12:15

问题


I'm trying to persist a JODA LocalDate attribute using Hibernate.

@Column(nullable = false)
@Type(type = "org.jadira.usertype.dateandtime.joda.PersistentDateTime")
private DateTime scheduledDepartureTime;

I downloaded the following jars:

usertype.jodatime-2.0.1.jar
usertype.spi-3.0.0.GA.jar
usertype.core-3.0.0.GA.jar

and added them to my classpath.

When trying to execute my application, I get

java.lang.ClassNotFoundException: org.jadira.usertype.dateandtime.shared.spi.AbstractSingleColumnUserType

When searching for this class in Eclipse, I can find it, but it is located in org.jadira.usertype.shared.spi, which explains the Exception

Any idea why this class is searched in the wrong package ? Since I'm using the latest version of these jars, I doubt this comes from version problem.

Thanks for your help !


回答1:


usertype.core-3.0.0.GA.jar contains org.jadira.usertype.dateandtime.joda.PersistentDateTime that you need.
Use only two dependencies:

usertype.spi-3.0.0.GA.jar
usertype.core-3.0.0.GA.jar


来源:https://stackoverflow.com/questions/14916752/jadira-usertype-no-class-def-found

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!