I created a Web project in eclipse and adding a glassfish-resource.xml init and configure it with my database url. also I added a persistence.xml unit in my project and add a jta-datasource for my datasource defined in glassfish-resource.xml but when the application is being deployed on glassfish in ide I got error that : Lookup failed for 'java:module/jdbc/sportal' in SerialContext
my glassfish-resource.xml:
<resources>
<jdbc-connection-pool name="java:module/jdbc/sportalPool"
res-type="javax.sql.DataSource" datasource-classname="com.mysql.jdbc.jdbc2.optional.MysqlDataSource"
pool-resize-quantity="1" max-pool-size="5" steady-pool-size="0"
statement-timeout-in-seconds="30">
<property name="User" value="root"></property>
<property name="Password" value="1234"></property>
<property name="portNumber" value="3306"></property>
<property name="dataBaseName" value="sportal"></property>
<property name="serverName" value="192.168.2.7"></property>
</jdbc-connection-pool>
<jdbc-resource pool-name="java:module/jdbc/sportalPool"
jndi-name="java:module/jdbc/sportal"></jdbc-resource>
and my persistence.xml is:
<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="PU" transaction-type="JTA">
<jta-data-source>java:module/jdbc/sportal</jta-data-source>
<properties>
<property name="eclipselink.ddl-generation" value="create-tables" />
<property name="eclipselink.logging.level" value="FINE" />
</properties>
</persistence-unit>
I get the same error with "java:app/..." instead of "java:module/..." too.
My glassfish version is Open edition 3.0.1, JPA2, eclipse Helios
RGDS