Java, JPA, Glassfish, Invalid resource : jdbc/__default__pm
我使用Glassfish 3.1.2.2(build 5),JPA,EclipseLink,MySQL
我通过Glassfish管理面板创建了MySQL池。从GF管理面板Ping到MySQL是可以的。
我创建了具有持久性的应用.xml:
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence" version="2.0">
<persistence-unit name="myUnit">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<properties>
<property name="javax.persistence.jdbc.url" value="jdbc:mysql://localhost:3306/myDBName"/>
<property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver"/>
<property name="javax.persistence.jdbc.user" value="root"/>
<property name="javax.persistence.jdbc.password" value="myPass"/>
<property name="javax.persistence.ddl-generation" value="drop-and-create-tables"/>
</properties>
</persistence-unit>
我试图部署它,但得到错误:
Invalid resource : jdbc/__default__pm
[#|2012-11-16T02:20:59.480+0400|SEVERE|glassfish3.1.2|javax.enterprise.system.core.com.sun.enterprise.v3.server|_ThreadID=43;_ThreadName=Thread-2;|Invalid resource : jdbc/__default__pm
java.lang.RuntimeException: Invalid resource : jdbc/__default__pm
GF 日志中的堆栈跟踪非常庞大。开始于
at com.sun.enterprise.connectors.ConnectorRuntime.lookupDataSourceInDAS(ConnectorRuntime.java:540)
at com.sun.enterprise.connectors.ConnectorRuntime.lookupPMResource(ConnectorRuntime.java:469)
at org.glassfish.persistence.common.PersistenceHelper.lookupPMResource(PersistenceHelper.java:63)
at org.glassfish.persistence.jpa.ProviderContainerContractInfoBase.lookupDataSource(ProviderContainerContractInfoBase.java:71)
....
有没有人知道发生了什么以及该怎么办?