Error when running java ee projet:
Severe: Exception while deploying the app [K2Fitness-war] : javax.resource.ResourceException: javax.resource.ResourceException: Attribute value (pool-name = java:app/k2fitness) is not found in list of jdbc connection pools.
glassfish-ressources.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE resources PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 Resource Definitions//EN" "http://glassfish.org/dtds/glassfish-resources_1_5.dtd">
<resources>
<jdbc-connection-pool allow-non-component-callers="false" associate-with-thread="false" connection-creation-retry-attempts="0" connection-creation-retry-interval-in-seconds="10" connection-leak-reclaim="false" connection-leak-timeout-in-seconds="0" connection-validation-method="auto-commit" datasource-classname="com.mysql.jdbc.jdbc2.optional.MysqlDataSource" fail-all-connections="false" idle-timeout-in-seconds="300" is-connection-validation-required="false" is-isolation-level-guaranteed="true" lazy-connection-association="false" lazy-connection-enlistment="false" match-connections="false" max-connection-usage-count="0" max-pool-size="32" max-wait-time-in-millis="60000" name="mysql_k2fitness_rootPool" non-transactional-connections="false" pool-resize-quantity="2" res-type="javax.sql.DataSource" statement-timeout-in-seconds="-1" steady-pool-size="8" validate-atmost-once-period-in-seconds="0" wrap-jdbc-objects="false">
<property name="serverName" value="localhost"/>
<property name="portNumber" value="3306"/>
<property name="databaseName" value="k2fitness"/>
<property name="User" value="root"/>
<property name="Password" value="root"/>
<property name="URL" value="jdbc:mysql://localhost:3306/k2fitness?zeroDateTimeBehavior=convertToNull"/>
<property name="driverClass" value="com.mysql.jdbc.Driver"/>
</jdbc-connection-pool>
<jdbc-resource enabled="true" jndi-name="java:apps/jdbc:mysql://localhost:3306/k2fitness" object-type="user" pool-name="k2fitness"/>
</resources>
On the glassfish admin panel I have the following:
JDBC RESOURCES
-> jdbc/k2fitness (JNDI-NAME | Connected to k2fitness pool )
JDBC CONNECTION POOLS
-> k2fitness (POOL NAME | Ping successful )
k2fitness url: jdbc:mysql://localhost:3306/k2fitness
Why is it unable to find the pool name "k2fitness" in the list of connection pools when it clearly exists. Any clarity on this would be helpful.
I've attempted to change the jndi-name (unsure if it's related to the pool-name issue) without success:
The name of the pool is mysql_k2fitness_rootPool
, see the name attribute of the jdbc-connection-pool
element.