users@glassfish.java.net

Sun Glassfish - Defining A Persistence Manager

From: Carlo Camerino <carlo.camerino_at_gmail.com>
Date: Sun, 6 Dec 2009 22:18:31 +0800

Hi,

how do i define a persistence manager in sun glassfish version 2.1.1?
I try to define one in jdbc-resource but i always get this error.

[#|2009-12-06T22:14:16.025+0800|WARNING|sun-appserver2.1|javax.enterprise.system.stream.err|_ThreadID=21;_ThreadName=httpSSLWorkerThread-8085-2;_RequestID=45145658-c377-4d9d-ba54-c4befdcd232b;|java.rmi.ServerException:
RemoteException occurred in server thread; nested exception is:
        java.rmi.RemoteException: null; nested exception is:
        com.bdo.core.util.BDOException: Exception thrown from bean; nested
exception is: com.bdo.core.util.BDOException: Could not create Entity
EJB; nested exception is:
com.sun.jdo.api.persistence.support.JDOFatalUserException: JDO76604:
JNDI lookup for cmp-resource 'jdo/bdoPM' failed.
NestedException: javax.naming.NameNotFoundException
        at com.sun.corba.ee.impl.javax.rmi.CORBA.Util.wrapException(Util.java:747)
        at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.privateInvoke(StubInvocationHandlerImpl.java:243)
        at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.invoke(StubInvocationHandlerImpl.java:152)
        at com.sun.corba.ee.impl.presentation.rmi.bcel.BCELStubBase.invoke(BCELStubBase.java:225)
        at com.bdo.logininfo.ejb._LoginInfoFacade_DynamicStub.loginRibUser(com/bdo/logininfo/ejb/_LoginInfoFacade_DynamicStub.java)
        at com.bdo.ribuser.web.RibUserBD.loginRibUser(RibUserBD.java:103)

Here is my configuration file.

<resources>

    <jdbc-resource enabled="true" jndi-name="jdbc/sample"
object-type="user" pool-name="SamplePool"/>
    <jdbc-resource enabled="true" jndi-name="jdbc/__TimerPool"
object-type="system-admin" pool-name="__TimerPool"/>
    <jdbc-resource enabled="true" jndi-name="jdbc/__CallFlowPool"
object-type="system-all" pool-name="__CallFlowPool"/>
    <jdbc-resource enabled="true" jndi-name="jdbc/__default"
object-type="user" pool-name="DerbyPool"/>
    <jdbc-resource enabled="true" jndi-name="jdbc/bdoDS"
object-type="user" pool-name="oracle_pool"/>
    <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.EmbeddedXADataSource"
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="__CallFlowPool" 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" wrap-jdbc-objects="false">
      <property name="databaseName"
value="${com.sun.aas.instanceRoot}/lib/databases/sun-callflow"/>
      <property name="connectionAttributes" value=";create=true"/>
    </jdbc-connection-pool>
    <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.EmbeddedXADataSource"
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="__TimerPool"
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"
wrap-jdbc-objects="false">
      <property name="databaseName"
value="${com.sun.aas.instanceRoot}/lib/databases/ejbtimer"/>
    </jdbc-connection-pool>
    <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.ClientDataSource"
fail-all-connections="false" idle-timeout-in-seconds="300"
is-connection-validation-required="false"
is-isolation-level-guaranteed="false"
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="DerbyPool"
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="PortNumber" value="1527"/>
      <property name="Password" value="APP"/>
      <property name="User" value="APP"/>
      <property name="serverName" value="localhost"/>
      <property name="DatabaseName" value="sun-appserv-samples"/>
      <property name="connectionAttributes" value=";create=true"/>
    </jdbc-connection-pool>
    <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.ClientDataSource"
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="SamplePool"
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="DatabaseName" value="sample"/>
      <property name="User" value="app"/>
      <property name="Password" value="app"/>
      <property name="URL" value="jdbc:derby://localhost:1527/sample"/>
      <property name="PortNumber" value="1527"/>
      <property name="serverName" value="localhost"/>
    </jdbc-connection-pool>
    <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="table"
datasource-classname="oracle.jdbc.pool.OracleDataSource"
fail-all-connections="false" idle-timeout-in-seconds="300"
is-connection-validation-required="true"
is-isolation-level-guaranteed="false"
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="oracle_pool"
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"
validation-table-name="DUAL" wrap-jdbc-objects="false">
      <property name="url" value="jdbc:oracle:thin:@localhost:1521:orcl"/>
      <property name="password" value="password"/>
      <property name="username" value="bdodevt"/>
    </jdbc-connection-pool>
    <persistence-manager-factory-resource enabled="true" factory-class
= "com.sun.jdo.spi.persistence.support.sqlstore.impl.PersistenceManagerFactoryImpl"
 jdbc-resource-jndi-name="jdbc/bdoDS" jndi-name="jdo/bdoPM"
object-type="system-all"/>
  </resources>

Is there anything special that I have to do?

Please help me..

thanks