在play framework 2.2 java中重新加载,在与spring数据jpa和hibernate一起使用时给出异常

在play framework 2.2 java中重新加载,在与spring数据jpa和hibernate一起使用时给出异常,spring,jpa,playframework-2.0,spring-data-jpa,Spring,Jpa,Playframework 2.0,Spring Data Jpa,我使用PlayFramework2.2、Hibernate作为JPA提供者(4.2.8.Final)、Spring(4.0.1.RELEASE)和SpringDataJPA(1.4.3.RELEASE) 我使用spring来实例化控制器,并在应用程序加载时使用context:component scan来收集和配置所有必需的依赖项(存储库等) 我用play框架配置spring的方式是 public class Global extends GlobalSettings { priva

我使用PlayFramework2.2、Hibernate作为JPA提供者(4.2.8.Final)、Spring(4.0.1.RELEASE)和SpringDataJPA(1.4.3.RELEASE)

我使用spring来实例化控制器,并在应用程序加载时使用context:component scan来收集和配置所有必需的依赖项(存储库等)

我用play框架配置spring的方式是

public class Global extends GlobalSettings {

     private ApplicationContext applicationContext;

     @Override
     public void onStart(Application arg0) {
           String configLocation = Play.application().configuration().getString("spring.context.location");
           applicationContext = new ClassPathXmlApplicationContext(configLocation);
     }

     @Override
     public <A> A getControllerInstance(Class<A> type) throws Exception {
           return applicationContext.getBean(type);
     }

}

虽然一般来说这不是一个问题,但重新启动工作正常,如果有人能够提供任何输入,以便在播放重新加载时完全重新加载应用程序上下文,我将不胜感激。

我也遇到过同样的问题。将弹簧数据JPA 1.4.3.RELEASE更改为1.4.2.RELEASE解决了此问题。我没有时间进一步研究这个问题,所以我不知道原因是什么


这个项目是一个很好的起点:但它使用了SpringDataJPA的1.3版本

非常感谢,它解决了问题。我使用相同的项目启动模板,但升级了Spring4和spring数据以及基于xml的配置。
Caused by: java.lang.IllegalArgumentException: Not an managed type: class models.User