0

I'm working through the Appfuse tutorial for version 3.5 (as previously advised by Matt Raible in response to another question).

I'm on this step: http://appfuse.org/display/APF/Using+Spring+MVC#UsingSpringMVC-listview

But when I build (mvn package).. I get the following error:

Running gov.nysed.archives.Nimbus.dao.PersonDaoTest Running gov.nysed.archives.Nimbus.webapp.controller.UpdatePasswordControllerTest

WARN [main] GenericApplicationContext.refresh(487) | Exception encountered during context initialization - cancelling refresh attempt org.springframework.beans.factory.BeanCreationException: Error creating bean wit h name 'userManager': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire method: public void gov.nysed.archives.Nimbus.service.impl.UserManagerImpl.set MailMessage(org.springframework.mail.SimpleMailMessage); nested exception is java.lang.NoClassDefFoundError: [Lorg/hibernate/engine/FilterDefinition; at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:334) ~[spring-beans-4.1.3.RELEASE.jar:4.1.3.RELEASE] ...

Could my adding the "persons" section (Entity and controller etc) cause this problem? It passed the tests prior to adding the new entity... so of course, yes... but how?

Armon Inez
  • 23
  • 3
  • It looks like you might have an older (or newer) version of Hibernate in your classpath. What version do you see when running "mvn dependency:tree | grep hibernate"? – Matt Raible Mar 16 '15 at 16:15
  • appfuse-hibernate:jar:3.5.0-SNAPSHOT hibernate-core:jar:4.3.6 hibernate-commons-annotations:jar:4.0.5 hibernate-ehcache:jar:4.3.6 hibernate-search:jar:4.5.1 – Armon Inez Mar 16 '15 at 16:45
  • This looks like a similar issue: http://stackoverflow.com/questions/21241210/compatability-of-spring-4-0-0-with-hibernate-4-30 – Matt Raible Mar 16 '15 at 18:20
  • This did help. After updating to the correct hibernate, it got passed the error. I then ran into other errors. I needed to add a personController bean to the dispatcher-servlet.xml. And then a personManager bean to applicationContext-service.xml. And then move the personDao bean from applicationContext.xml to applicationContext-dao.xml. Now, it passes tests. – Armon Inez Mar 17 '15 at 13:51

0 Answers0