1
我嘗試我的應用程序從喬納斯遷移到JBoss WildFly 8.我面對以下錯誤:遷移到JBoss wildfly
14:30:49,518 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 48) MSC000001: Failed to start service jboss.persistenceunit."myAppEar.ear/myAppMetier.jar#myApp": org.jboss.msc.service.StartException in service jboss.persistenceunit."myAppEar.ear/myAppMetier.jar#myApp": java.lang.NullPointerException
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:172) [wildfly-jpa-8.1.0.Final.jar:8.1.0.Final]
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:117) [wildfly-jpa-8.1.0.Final.jar:8.1.0.Final]
at java.security.AccessController.doPrivileged(Native Method) [rt.jar:1.7.0_25]
at org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:474)
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1.run(PersistenceUnitServiceImpl.java:182) [wildfly-jpa-8.1.0.Final.jar:8.1.0.Final]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_25]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_25]
at java.lang.Thread.run(Thread.java:724) [rt.jar:1.7.0_25]
at org.jboss.threads.JBossThread.run(JBossThread.java:122)
Caused by: java.lang.NullPointerException
at org.jboss.as.naming.WritableServiceBasedNamingStore.rebind(WritableServiceBasedNamingStore.java:120)
at org.jboss.as.naming.NamingContext.rebind(NamingContext.java:274)
at org.jboss.as.naming.InitialContext$DefaultInitialContext.rebind(InitialContext.java:269)
at javax.naming.InitialContext.rebind(InitialContext.java:431) [rt.jar:1.7.0_25]
at javax.naming.InitialContext.rebind(InitialContext.java:431) [rt.jar:1.7.0_25]
at org.hibernate.util.NamingHelper.bind(NamingHelper.java:97) [hibernate3.jar:3.6.10.Final]
at org.hibernate.impl.SessionFactoryObjectFactory.addInstance(SessionFactoryObjectFactory.java:113) [hibernate3.jar:3.6.10.Final]
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:367) [hibernate3.jar:3.6.10.Final]
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1872) [hibernate3.jar:3.6.10.Final]
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:906) [hibernate3.jar:3.6.10.Final]
at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:74) [hibernate3.jar:3.6.10.Final]
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.createContainerEntityManagerFactory(PersistenceUnitServiceImpl.java:318) [wildfly-jpa-8.1.0.Final.jar:8.1.0.Final]
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.access$1100(PersistenceUnitServiceImpl.java:67) [wildfly-jpa-8.1.0.Final.jar:8.1.0.Final]
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:167) [wildfly-jpa-8.1.0.Final.jar:8.1.0.Final]
... 8 more
我wildfly配置爲在persistence.xml使用休眠3.6
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0" 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">
<persistence-unit name="myApp" transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>nfsbdd</jta-data-source>
<exclude-unlisted-classes>true</exclude-unlisted-classes>
<properties>
<property name="hibernate.hbm2ddl.auto" value="validate"/>
<property name="hibernate.ejb.cfgfile" value="META-INF/hibernate.cfg.xml"/>
<property name="jboss.as.jpa.providerModule" value="org.hibernate:3"/>
</properties>
</persistence-unit>
與hibernate3.6,EJB3.0,JSF 2.1應用程序運行。有人可以幫助我嗎?
對不起,我沒有把問題標記爲解決。它工作得很好。這個問題是另一個開發人員無聲捕捉的。這不是休眠故障 – Scandinave 2015-03-01 09:03:37