无法配置EntityManagerFactory - JPA

时间:2014-07-02 10:18:48

标签: java postgresql gwt jpa openshift

我在GWT + Errai中开发了一个应用程序,使用Postgres作为后端,部署在jboss7中。 我最近使用rhc客户端将整个应用程序从一个Openshift(Origin)实例迁移到另一个实例。然后使用sftp手动恢复数据库转储。应用程序已成功迁移,但我无法登录到我的应用程序。

我在服务器上添加了日志,它给了我以下异常。

    org.jboss.errai.bus.client.api.base.MessageDeliveryFailure: error invoking endpoint
at org.jboss.errai.bus.server.io.AbstractRPCMethodCallback.invokeMethodFromMessage(AbstractRPCMethodCallback.java:61)
at org.jboss.errai.bus.server.io.ValueReplyRPCEndpointCallback.callback(ValueReplyRPCEndpointCallback.java:22)
at org.jboss.errai.bus.server.io.RemoteServiceCallback.callback(RemoteServiceCallback.java:54)
at org.jboss.errai.cdi.server.CDIExtensionPoints$2.callback(CDIExtensionPoints.java:494)
at org.jboss.errai.bus.server.DeliveryPlan.deliver(DeliveryPlan.java:47)
at org.jboss.errai.bus.server.ServerMessageBusImpl.sendGlobal(ServerMessageBusImpl.java:293)
at org.jboss.errai.bus.server.SimpleDispatcher.dispatchGlobal(SimpleDispatcher.java:46)
at org.jboss.errai.bus.server.service.ErraiServiceImpl.store(ErraiServiceImpl.java:97)
at org.jboss.errai.bus.server.service.ErraiServiceImpl.store(ErraiServiceImpl.java:114)
at org.jboss.errai.bus.server.servlet.DefaultBlockingServlet.doPost(DefaultBlockingServlet.java:140)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:754)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
at org.jboss.weld.servlet.ConversationPropagationFilter.doFilter(ConversationPropagationFilter.java:62)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)
at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365)
at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)
at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)
at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383)
at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362)
at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)
at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50)
at org.jboss.web.rewrite.RewriteValve.invoke(RewriteValve.java:466)
at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930)
at java.lang.Thread.run(Thread.java:744)
Caused by: com.google.common.collect.ComputationException: java.lang.RuntimeException: javax.persistence.PersistenceException: Unable to configure EntityManagerFactory
at com.google.common.collect.ComputingConcurrentHashMap$ComputingMapAdapter.get(ComputingConcurrentHashMap.java:400)
Caused by: java.lang.IllegalArgumentException: No SchemaFactory that implements the schema language specified by: http://www.w3.org/2001/XMLSchema could be loaded
at javax.xml.validation.SchemaFactory.newInstance(SchemaFactory.java:204)
at org.hibernate.ejb.packaging.PersistenceXmlLoader.loadURL(PersistenceXmlLoader.java:91)
at org.hibernate.ejb.packaging.PersistenceXmlLoader.deploy(PersistenceXmlLoader.java:171)
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:324)
 81 more
*** Message delivery failure ***
 Bus: org.jboss.errai.bus.server.ServerMessageBusImpl@20e1bbe6
 Message: CommandType=getStrategyForUser:com.magick.models.shared.User:, ErrorTo=app.client.shared.service.StrategyService:RPC.getStrategyForUser:com.magick.models.shared.User::4:Errors:RPC, ReplyTo=app.client.shared.service.StrategyService:RPC.getStrategyForUser:com.magick.models.shared.User::4:RespondTo:RPC, ToSubject=app.client.shared.service.StrategyService:RPC, MethodParms=[null]
errorMessage: Error calling remote service: app.client.shared.service.StrategyService:RPC
exception: org.jboss.errai.bus.client.api.base.MessageDeliveryFailure: error invoking endpoint
disconnect: false

更新了更多信息:

我们在新的Openshift实例上尝试了以下内容

  • 创建新的OpenShift应用程序
  • 克隆相同的实例

的persistence.xml

<persistence xmlns="http://java.sun.com/xml/ns/persistence"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
             version="2.0">
   <persistence-unit name="pu-magick" transaction-type="RESOURCE_LOCAL"> <!-- TODO: JTA -->
      <provider>org.hibernate.ejb.HibernatePersistence</provider>

     <jta-data-source>java:jboss/datasources/magick</jta-data-source>

      <class>com.magick.models.shared.User</class>
      <properties>
         <property name="hibernate.hbm2ddl.auto" value="update"/>
         <property name="hibernate.connection.autocommit" value="false" /> 
      </properties>
   </persistence-unit>
</persistence>

我使用JPA作为数据访问层。对此有何想法? 谢谢

0 个答案:

没有答案