eventlisteners using hibernate 4.0 with spring 3.1.0.release?

I had the same frustrating problem. Hibernate 4 appears to have fundamentally changed the way you register for events and the Spring group has not yet caught up. Here’s my annotation-based solution using an init method to register a listener: @Component public class HibernateEventWiring { @Autowired private SessionFactory sessionFactory; @Autowired private SomeHibernateListener listener; @PostConstruct public … Read more

How do you configure logging in Hibernate 4 to use SLF4J

Look to https://github.com/jboss-logging/jboss-logging/blob/master/src/main/java/org/jboss/logging/LoggerProviders.java: static final String LOGGING_PROVIDER_KEY = “org.jboss.logging.provider”; private static LoggerProvider findProvider() { // Since the impl classes refer to the back-end frameworks directly, if this classloader can’t find the target // log classes, then it doesn’t really matter if they’re possibly available from the TCCL because we won’t be // able to find … Read more

NoSuchMethodError in javax.persistence.Table.indexes()[Ljavax/persistence/Index

I’ve ran into the same problem. The question here is that play-java-jpa artifact (javaJpa key in the build.sbt file) depends on a different version of the spec (version 2.0 -> “org.hibernate.javax.persistence” % “hibernate-jpa-2.0-api” % “1.0.1.Final”). When you added hibernate-entitymanager 4.3 this brought the newer spec (2.1) and a different factory provider for the entitymanager. Basically … Read more