users@glassfish.java.net

EJB3 creation of database tables issue

From: <glassfish_at_javadesktop.org>
Date: Sun, 13 Jan 2008 00:10:39 PST

The following error occurs when trying to deploy an application to the Glassfish container.
----- Begin Error ---
Deploying application in domain failed; Internal Exception: java.sql.SQLException: This pool is not registered with the runtime environment Error Code: 0 Internal Exception: java.sql.SQLException: This pool is not registered with the runtime environment Error Code: 0
---- End Error ---

The application is an ear file deployed to the server using the admin UI.

The required datasoure is configured using "sun-resources.xml" in the ear file's META-INF folder.

The application fails to deploy.

The resource configuration is listed below

--- sun-resources.xml ---

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE resources PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 9.0 Resource Definitions //EN" "http://www.sun.com/software/appserver/dtds/sun-resources_1_3.dtd">
<resources>
  <jdbc-resource enabled="true" jndi-name="jdbc/myDs" object-type="user" pool-name="myDBPool">
    <description>jndi access for bwi audit data</description>
  </jdbc-resource>
  <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="org.apache.derby.jdbc.ClientXADataSource" 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="myDBPool"
    non-transactional-connections="false" pool-resize-quantity="2" res-type="javax.sql.XADataSource"
    statement-timeout-in-seconds="-1" steady-pool-size="8" validate-atmost-once-period-in-seconds="0"
    validation-table-name="dummy" wrap-jdbc-objects="false">
    <description>BWI Unified Datasourec</description>
    <property name="User" value="APP" />
    <property name="Password" value="APP" />
    <property name="serverName" value="localhost" />
    <property name="PortNumber" value="1527" />
    <property name="DatabaseName" value="my-db" />
    <property name="connectionAttributes" value=";create=true" />
  </jdbc-connection-pool>
</reources>

-- end sun-resources.xml --




The Source of the persistence.xml is listed below



--- persistence.xml --
<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_1_0.xsd"
  version="1.0" xmlns="http://java.sun.com/xml/ns/persistence">
  <persistence-unit name="my-pu" transaction-type="JTA">
    <!-- Provider class name is required in Java SE -->
    <jta-data-source>jdbc/myDs</jta-data-source>
    <properties>
      <property name="toplink.logging.level" value="FINE" />
      <property name="toplink.ddl-generation" value="drop-and-create-tables"/>
    </properties>
  </persistence-unit>
</persistence>


-- end persistence.xml ---
Is there anything wrong of missing with the above configurations?

Thanks,
U
[Message sent by forum member 'u200801' (u200801)]

http://forums.java.net/jive/thread.jspa?messageID=253582