5 Replies Latest reply on Jul 20, 2011 6:08 AM by Are Tysnes

    AS7 and Joda-Time Hibernate support

    Are Tysnes Newbie

      Is it just me or is the Joda-Time Hibernate support broken in AS7 ?

       

      Works fine in AS6 and when I try to do the same JPA call in AS7 I get this stacktrace.

       

      When i remove the @Type annotation and uses java.util.Date everything works again.. but I want to map to joda-time

       

      12:28:21,226 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/xxxxxxx].[xxxxxxx.JaxRsActivator]] (http--127.0.0.1-8080-1) Servl

      et.service() for servlet xxxxxxxx.JaxRsActivator threw exception: org.jboss.resteasy.spi.UnhandledException: java.lang.AbstractMethodError: org.joda.time.contrib.hibernate.Persi

      stentDateTime.nullSafeGet(Ljava/sql/ResultSet;[Ljava/lang/String;Lorg/hibernate/engine/spi/SessionImplementor;Ljava/lang/Object;)Ljava/lang/Object;

              at org.jboss.resteasy.core.SynchronousDispatcher.unwrapException(SynchronousDispatcher.java:345) [resteasy-jaxrs-2.2.1.GA.jar:]

              at org.jboss.resteasy.core.SynchronousDispatcher.unwrapException(SynchronousDispatcher.java:341) [resteasy-jaxrs-2.2.1.GA.jar:]

              at org.jboss.resteasy.core.SynchronousDispatcher.handleApplicationException(SynchronousDispatcher.java:321) [resteasy-jaxrs-2.2.1.GA.jar:]

              at org.jboss.resteasy.core.SynchronousDispatcher.handleException(SynchronousDispatcher.java:214) [resteasy-jaxrs-2.2.1.GA.jar:]

              at org.jboss.resteasy.core.SynchronousDispatcher.handleInvokerException(SynchronousDispatcher.java:190) [resteasy-jaxrs-2.2.1.GA.jar:]

              at org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:534) [resteasy-jaxrs-2.2.1.GA.jar:]

              at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:496) [resteasy-jaxrs-2.2.1.GA.jar:]

              at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:119) [resteasy-jaxrs-2.2.1.GA.jar:]

              at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208) [resteasy-jaxrs-2.2.1.GA.jar:]

              at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55) [resteasy-jaxrs-2.2.1.GA.jar:]

              at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50) [resteasy-jaxrs-2.2.1.GA.jar:]

              at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]

              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]

              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]

              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]

              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]

              at org.jboss.as.web.NamingValve.invoke(NamingValve.java:57) [jboss-as-web-7.0.0.Final.jar:7.0.0.Final]

              at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:49) [jboss-as-jpa-7.0.0.Final.jar:7.0.0.Final]

              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:154) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]

              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]

              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]

              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]

              at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]

              at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:667) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]

              at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:951) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]

              at java.lang.Thread.run(Thread.java:619) [:1.6.0_21]

      Caused by: java.lang.AbstractMethodError: org.joda.time.contrib.hibernate.PersistentDateTime.nullSafeGet(Ljava/sql/ResultSet;[Ljava/lang/String;Lorg/hibernate/engine/spi/SessionImplementor;Ljava/lang/

      Object;)Ljava/lang/Object;

              at org.hibernate.type.CustomType.nullSafeGet(CustomType.java:126) [hibernate-core-4.0.0.Beta1.jar:4.0.0.Beta1]

              at org.hibernate.type.AbstractType.hydrate(AbstractType.java:105) [hibernate-core-4.0.0.Beta1.jar:4.0.0.Beta1]

              at org.hibernate.persister.entity.AbstractEntityPersister.hydrate(AbstractEntityPersister.java:2344) [hibernate-core-4.0.0.Beta1.jar:4.0.0.Beta1]

              at org.hibernate.loader.Loader.loadFromResultSet(Loader.java:1562) [hibernate-core-4.0.0.Beta1.jar:4.0.0.Beta1]

              at org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:1494) [hibernate-core-4.0.0.Beta1.jar:4.0.0.Beta1]

              at org.hibernate.loader.Loader.getRow(Loader.java:1394) [hibernate-core-4.0.0.Beta1.jar:4.0.0.Beta1]

              at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:640) [hibernate-core-4.0.0.Beta1.jar:4.0.0.Beta1]

              at org.hibernate.loader.Loader.doQuery(Loader.java:868) [hibernate-core-4.0.0.Beta1.jar:4.0.0.Beta1]

              at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:289) [hibernate-core-4.0.0.Beta1.jar:4.0.0.Beta1]

              at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259) [hibernate-core-4.0.0.Beta1.jar:4.0.0.Beta1]

              at org.hibernate.loader.Loader.loadEntityBatch(Loader.java:2150) [hibernate-core-4.0.0.Beta1.jar:4.0.0.Beta1]

              at org.hibernate.loader.entity.BatchingEntityLoader.load(BatchingEntityLoader.java:97) [hibernate-core-4.0.0.Beta1.jar:4.0.0.Beta1]

              at org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:3331) [hibernate-core-4.0.0.Beta1.jar:4.0.0.Beta1]

              at org.hibernate.event.internal.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:454) [hibernate-core-4.0.0.Beta1.jar:4.0.0.Beta1]

              at org.hibernate.event.internal.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:435) [hibernate-core-4.0.0.Beta1.jar:4.0.0.Beta1]

              at org.hibernate.event.internal.DefaultLoadEventListener.load(DefaultLoadEventListener.java:212) [hibernate-core-4.0.0.Beta1.jar:4.0.0.Beta1]

              at org.hibernate.event.internal.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:259) [hibernate-core-4.0.0.Beta1.jar:4.0.0.Beta1]

              at org.hibernate.event.internal.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:156) [hibernate-core-4.0.0.Beta1.jar:4.0.0.Beta1]

              at org.hibernate.internal.SessionImpl.fireLoad(SessionImpl.java:1048) [hibernate-core-4.0.0.Beta1.jar:4.0.0.Beta1]

              at org.hibernate.internal.SessionImpl.internalLoad(SessionImpl.java:997) [hibernate-core-4.0.0.Beta1.jar:4.0.0.Beta1]

              at org.hibernate.type.EntityType.resolveIdentifier(EntityType.java:628) [hibernate-core-4.0.0.Beta1.jar:4.0.0.Beta1]

              at org.hibernate.type.EntityType.resolve(EntityType.java:436) [hibernate-core-4.0.0.Beta1.jar:4.0.0.Beta1]

              at org.hibernate.type.ComponentType.resolve(ComponentType.java:660) [hibernate-core-4.0.0.Beta1.jar:4.0.0.Beta1]

              at org.hibernate.engine.internal.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:150) [hibernate-core-4.0.0.Beta1.jar:4.0.0.Beta1]

              at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:1020) [hibernate-core-4.0.0.Beta1.jar:4.0.0.Beta1]

              at org.hibernate.loader.Loader.doQuery(Loader.java:897) [hibernate-core-4.0.0.Beta1.jar:4.0.0.Beta1]

              at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:289) [hibernate-core-4.0.0.Beta1.jar:4.0.0.Beta1]

              at org.hibernate.loader.Loader.doList(Loader.java:2459) [hibernate-core-4.0.0.Beta1.jar:4.0.0.Beta1]

              at org.hibernate.loader.Loader.doList(Loader.java:2445) [hibernate-core-4.0.0.Beta1.jar:4.0.0.Beta1]

              at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2283) [hibernate-core-4.0.0.Beta1.jar:4.0.0.Beta1]

              at org.hibernate.loader.Loader.list(Loader.java:2278) [hibernate-core-4.0.0.Beta1.jar:4.0.0.Beta1]

              at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:470) [hibernate-core-4.0.0.Beta1.jar:4.0.0.Beta1]

              at org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:355) [hibernate-core-4.0.0.Beta1.jar:4.0.0.Beta1]

              at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:196) [hibernate-core-4.0.0.Beta1.jar:4.0.0.Beta1]

              at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1206) [hibernate-core-4.0.0.Beta1.jar:4.0.0.Beta1]

              at org.hibernate.internal.QueryImpl.list(QueryImpl.java:100) [hibernate-core-4.0.0.Beta1.jar:4.0.0.Beta1]

              at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:252) [hibernate-entitymanager-4.0.0.Beta1.jar:4.0.0.Beta1]

              at xxxxx.getRecommendations(RecommendationsBean.java:61) [xxxxxx-ejb-0.15-SNAPSHOT.jar:]