Vaadin为什么不能创建JPAContainer?

时间:2019-02-20 11:56:49

标签: java hibernate jpa vaadin

以下代码引发异常

JPAContainer<Users> userContainer =
                    JPAContainerFactory.make(Users.class, "erp");

其中用户是实体

打印以下堆栈跟踪

javax.servlet.ServletException: com.vaadin.server.ServiceException: java.lang.NoClassDefFoundError: Could not initialize class org.hibernate.ejb.Ejb3Configuration
    com.vaadin.server.VaadinServlet.service(VaadinServlet.java:239)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

根本原因

com.vaadin.server.ServiceException: java.lang.NoClassDefFoundError: Could not initialize class org.hibernate.ejb.Ejb3Configuration
    com.vaadin.server.VaadinService.handleExceptionDuringRequest(VaadinService.java:1463)
    com.vaadin.server.VaadinService.handleRequest(VaadinService.java:1417)
    com.vaadin.server.VaadinServlet.service(VaadinServlet.java:237)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

根本原因

java.lang.NoClassDefFoundError: Could not initialize class org.hibernate.ejb.Ejb3Configuration
    org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:57)
    javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:63)
    javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:47)
    com.vaadin.addon.jpacontainer.JPAContainerFactory.createEntityManagerForPersistenceUnit(JPAContainerFactory.java:122)
    com.vaadin.addon.jpacontainer.JPAContainerFactory.make(JPAContainerFactory.java:105)

我已经尝试过Stack Overflow上的其他答案。它们都不起作用。

0 个答案:

没有答案