views:

651

answers:

3

I have a project using these technologies and I'm getting a number of issues. The first is this error:-

org.apache.tapestry5.ioc.internal.util.TapestryException: Exception constructing service 'ValueEncoderSource': Error invoking service builder method org.apache.tapestry5.services.TapestryModule.buildValueEncoderSource(Map, InvalidationEventHub) (at TapestryModule.java:1910) (for service 'ValueEncoderSource'): Error invoking service contribution method org.apache.tapestry5.hibernate.HibernateModule.contributeValueEncoderSource(MappedConfiguration, boolean, HibernateSessionSource, Session, TypeCoercer, PropertyAccess, LoggerSource): Exception constructing service 'HibernateSessionSource': Error invoking service builder method org.apache.tapestry5.hibernate.HibernateCoreModule.buildHibernateSessionSource(Logger, List, RegistryShutdownHub) (at HibernateCoreModule.java:123) (for service 'HibernateSessionSource'): org.hibernate.validator.event.ValidateEventListener cannot be cast to org.hibernate.event.PreInsertEventListener [at classpath:org/apache/tapestry5/corelib/components/ExceptionDisplay.tml, line 3]

This is using the latest hibernate annotaions (version 3.4.0 GA). In the Maven pom.xml if I change the org.hibernate dependency to be:-

org.hibernate hibernate-annotations 3.2.1.ga

the error goes away, but we lose the bug fixes from the newer versions of annotations. Does anyone know a way around this?

A: 

I've used spring, hibernate and CXF. The CXF is used to turn my interfaces services into web services. Much easier to use than any of the other web services frameworks I looked at.

Martlark
+1  A: 

Do you, by any chance, deploy to an application server which comes with its own Hibernate library, such as JBoss? In that case, you may be mixing incompatible versions of Hibernate Core and Hibernate Annotations.

Try removing the Hibernate JARs that come with your application server and see if that works.

Henning
+1  A: 

Yes, I have built a web application using all those technologies. I don't use the tapestry-hibernate module, though, just tapestry-spring, and let Spring handle all the database / hibernate / transaction stuff.

Your problem, and especially the fix you describe for it, really sounds like a library compatibility issue. What version of Tapestry are you using?

For the 5.1 version of tapestry-hibernate, it says

This library is compiled against version 3.3.1.GA of Hibernate (and version 3.4.0.GA of hibernate-annotations), but should work with more recent versions.

on the Tapestry web site, so you should be fine with that.

lutzh