问题
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