我最近已从wildfly 10迁移到wildfly13。从控制台部署模块时,出现此奇怪错误
ERROR [org.jboss.as.controller.management-operation] (External Management Request Threads -- 1) WFLYCTL0013: Operation ("read-attribute") failed - address: ([
("deployment" => "swp.admin.registry.war"),
("subsystem" => "jpa"),
("hibernate-persistence-unit" => "swp.admin.registry.war#primary")
]): javax.persistence.PersistenceException: Hibernate cannot unwrap
EntityManagerFactory as 'org.hibernate.SessionFactory'
at org.hibernate.jpa.internal.EntityManagerFactoryImpl.unwrap(EntityManagerFactoryImpl.java:496)
at org.jboss.as.jpa.hibernate5.management.HibernateStatistics.getStatistics(HibernateStatistics.java:216)
at org.jboss.as.jpa.hibernate5.management.HibernateStatistics$16.invoke(HibernateStatistics.java:361)
at org.jboss.as.jpa.hibernate5.management.HibernateAbstractStatistics.getValue(HibernateAbstractStatistics.java:99)
at org.jboss.as.jpa.management.ManagementResourceDefinition$1.handle(ManagementResourceDefinition.java:130)
at org.jboss.as.jpa.management.ManagementResourceDefinition$AbstractMetricsHandler.executeRuntimeStep(ManagementResourceDefinition.java:268)
at org.jboss.as.controller.AbstractRuntimeOnlyHandler$1.execute(AbstractRuntimeOnlyHandler.java:59)
at org.jboss.as.controller.AbstractOperationContext.executeStep(AbstractOperationContext.java:999)
at org.jboss.as.controller.AbstractOperationContext.processStages(AbstractOperationContext.java:743)
at org.jboss.as.controller.AbstractOperationContext.executeOperation(AbstractOperationContext.java:467)
at org.jboss.as.controller.OperationContextImpl.executeOperation(OperationContextImpl.java:1404)
at org.jboss.as.controller.ModelControllerImpl.internalExecute(ModelControllerImpl.java:423)
at org.jboss.as.controller.ModelControllerImpl.lambda$execute$1(ModelControllerImpl.java:243)
at org.wildfly.security.auth.server.SecurityIdentity.runAs(SecurityIdentity.java:263)
at org.wildfly.security.auth.server.SecurityIdentity.runAs(SecurityIdentity.java:229)
at org.jboss.as.controller.ModelControllerImpl.execute(ModelControllerImpl.java:243)
at org.jboss.as.domain.http.server.DomainApiHandler.handleRequest(DomainApiHandler.java:212)
at io.undertow.server.handlers.encoding.EncodingHandler.handleRequest(EncodingHandler.java:72)
at org.jboss.as.domain.http.server.DomainApiCheckHandler.handleRequest(DomainApiCheckHandler.java:93)
at org.jboss.as.domain.http.server.security.ElytronIdentityHandler.lambda$handleRequest$0(ElytronIdentityHandler.java:62)
at org.wildfly.security.auth.server.SecurityIdentity.runAs(SecurityIdentity.java:287)
at org.wildfly.security.auth.server.SecurityIdentity.runAs(SecurityIdentity.java:244)
at org.jboss.as.controller.AccessAuditContext.doAs(AccessAuditContext.java:254)
at org.jboss.as.controller.AccessAuditContext.doAs(AccessAuditContext.java:225)
at org.jboss.as.domain.http.server.security.ElytronIdentityHandler.handleRequest(ElytronIdentityHandler.java:61)
at io.undertow.server.handlers.BlockingHandler.handleRequest(BlockingHandler.java:56)
at io.undertow.server.Connectors.executeRootHandler(Connectors.java:360)
at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:830)
at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1985)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1487)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1378)
at java.lang.Thread.run(Thread.java:748)
at org.jboss.threads.JBossThread.run(JBossThread.java:485)
奇怪的是,应用程序经常运行,但是从控制台看不到部署。 下面是Wildfly上的模块休眠结构
├── 4.3
│ └── module.xml
├── 5.0
│ └── module.xml
├── 5.2
│ └── module.xml
├── 5.2.16.Final
│ ├── byte-buddy-1.6.14.jar
│ ├── hibernate-core-5.2.16.Final.jar
│ ├── hibernate-envers-5.2.16.Final.jar
│ └── module.xml
├── commons-annotations
│ └── main
│ ├── hibernate-commons-annotations-5.0.2.Final.jar
│ └── module.xml
├── envers
│ └── main
│ └── module.xml
├── hql
│ └── 1.5.0.Final
│ ├── antlr-runtime-3.4.jar
│ ├── hibernate-hql-lucene-1.5.0.Final.jar
│ ├── hibernate-hql-parser-1.5.0.Final.jar
│ └── module.xml
├── infinispan
│ ├── 5.2
│ │ └── module.xml
│ ├── 5.2.16.Final
│ │ ├── hibernate-infinispan-5.2.16.Final.jar
│ │ └── module.xml
│ └── main
│ └── module.xml
├── jipijapa-hibernate4-3
│ └── main
│ ├── jipijapa-hibernate4-3-13.0.0.Final.jar
│ └── module.xml
├── jipijapa-hibernate5
│ ├── 5.2
│ │ └── module.xml
│ ├── 5.2.16.Final
│ │ ├── jipijapa-hibernate5-11.0.0.Final.jar
│ │ └── module.xml
│ └── main
│ ├── jipijapa-hibernate5-13.0.0.Final.jar
│ ├── jipijapa-hibernate5-3-13.0.0.Final.jar
│ ├── jipijapa-hibernate5-3-legacy-13.0.0.Final.jar
│ ├── jipijapa-hibernate5-legacy-13.0.0.Final.jar
│ └── module.xml
├── main
│ ├── hibernate-core-5.1.14.Final.jar
│ ├── hibernate-core-5.3.1.Final.jar
│ ├── hibernate-entitymanager-5.1.14.Final.jar
│ ├── hibernate-envers-5.1.14.Final.jar
│ ├── hibernate-envers-5.3.1.Final.jar
│ ├── hibernate-java8-5.1.14.Final.jar
│ └── module.xml
├── ogm
│ ├── 5.3
│ │ ├── hibernate-ogm-core-5.3.1.Final.jar
│ │ └── module.xml
│ ├── infinispan-embedded
│ │ ├── 5.3
│ │ │ ├── hibernate-ogm-infinispan-embedded-5.3.1.Final.jar
│ │ │ └── module.xml
│ │ └── main
│ │ └── module.xml
│ ├── infinispan-remote
│ │ ├── 5.3
│ │ │ ├── hibernate-ogm-infinispan-remote-5.3.1.Final.jar
│ │ │ └── module.xml
│ │ └── main
│ │ └── module.xml
│ ├── internal
│ │ └── parboiled
│ │ └── 5.3
│ │ ├── asm-5.2.jar
│ │ ├── asm-analysis-5.2.jar
│ │ ├── asm-tree-5.2.jar
│ │ ├── asm-util-5.2.jar
│ │ ├── module.xml
│ │ ├── parboiled-core-1.1.8.jar
│ │ └── parboiled-java-1.1.8.jar
│ ├── jipijapa
│ │ └── 5.3.1.Final
│ │ ├── hibernate-ogm-jipijapa-5.3.1.Final.jar
│ │ └── module.xml
│ ├── main
│ │ └── module.xml
│ ├── mongodb
│ │ ├── 5.3
│ │ │ ├── hibernate-ogm-mongodb-5.3.1.Final.jar
│ │ │ ├── module.xml
│ │ │ └── mongo-java-driver-3.6.3.jar
│ │ └── main
│ │ └── module.xml
任何帮助将不胜感激。谢谢
答案 0 :(得分:0)
对于可能会遇到同样情况的人,我回答我自己的问题。经过数小时的努力,并遇到了一些类似的wldfly问题,我读到这可能是由于Wildlfy随附的休眠版本的错误所致。由于我已经将hibernate 5.2放入了ogm规范中,因此我通过在pesistence.xml
中发出此属性来指示wildfly也使用hibernate 5.2。<property name="jboss.as.jpa.providerModule" value="org.hibernate:5.2"/>
问题已解决