I can't think of any reason why that would fail. My only thoughts would be around class loading, if there was a race condition or thread-visibility issue in loading the list of converters.
Perhaps your code could perform a dummy conversion using this constructor before calling the hibernate code for initialisation? Stephen On 8 July 2010 09:08, andrea antonello <[email protected]> wrote: > Hello, I have a problem I can't find the reason to. > > I am using hibernate to store datetime. Mi annotation is the following: > > �...@column(name = "timestamp", nullable = false) > �...@type(type = "org.joda.time.contrib.hibernate.PersistentDateTime") > private DateTime creationDateTime; > > I internally use DateTime so when it come to persist, I should really > have no problem, since the constructor of DateTime should have no > problem with a DateTime. > > Instead I get the following exception when I try to save: > > java.lang.IllegalArgumentException: No instant converter found for > type: org.joda.time.DateTime > at > org.joda.time.convert.ConverterManager.getInstantConverter(ConverterManager.java:165) > at org.joda.time.base.BaseDateTime.<init>(BaseDateTime.java:169) > at org.joda.time.DateTime.<init>(DateTime.java:168) > at > org.joda.time.contrib.hibernate.PersistentDateTime.deepCopy(PersistentDateTime.java:110) > at org.hibernate.type.CustomType.deepCopy(CustomType.java:202) > at org.hibernate.type.TypeFactory.deepCopy(TypeFactory.java:397) > at > org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:303) > at > org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:204) > at > org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:130) > at > org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:210) > at > org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:56) > at > org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:195) > at > org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:50) > at > org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:93) > at org.hibernate.impl.SessionImpl.fireSave(SessionImpl.java:563) > at org.hibernate.impl.SessionImpl.save(SessionImpl.java:551) > at org.hibernate.impl.SessionImpl.save(SessionImpl.java:547) > ... > > In my understanding it is trying to convert a DateTime into a > DateTime, so I can't see the problem. FYI the passed DateTime object > is created through a simple "new DateTime()". > > I am writing in this list, since I am tempted to say that I am doing > something odd on the Jodatime side and not in hibernate. > Also this used to work and all in a sudden it stopped. I have no clue > on where to start. Any idea on where to start/debug/read/learn would > be very appreciated. > > Best regards, > Andrea > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > _______________________________________________ > Joda-interest mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/joda-interest > ------------------------------------------------------------------------------ This SF.net email is sponsored by Sprint What will you do first with EVO, the first 4G phone? Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first _______________________________________________ Joda-interest mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/joda-interest
