users@glassfish.java.net

Embedded GF - adding H2 connection pool error

From: <glassfish_at_javadesktop.org>
Date: Thu, 25 Feb 2010 19:03:10 PST

Hi all,

I have a problem when using Embedded GF API to register new jdbc connection pool.
I'm using H2 database running as TCP server.

Here is what I do in my code:
1. Create server
2. Use API to invoke asadmin commands for adding jdbc connection pool & resource
3. Try to ping the connection pool

The asadmin command for adding the connection pool & resource works fine.
I could even see the new connection pool when listing the available pools.
However, when pinging the connection, it comes out with error:

javax.resource.ResourceException: Ping failed Exception - This pool is not registered with the runtime environment : H2Pool Please check the server.log for more details.

The stacktrace is this:
Feb 26, 2010 11:03:06 AM com.sun.enterprise.connectors.util.ConnectorDDTransformUtils getConnectorDescriptor
SEVERE: rardeployment.connector_descriptor_read_error
Feb 26, 2010 11:03:06 AM com.sun.enterprise.connectors.util.ConnectorDDTransformUtils getConnectorDescriptor
SEVERE:
com.sun.appserv.connectors.internal.api.ConnectorRuntimeException: Failed to read the connector deployment descriptors
        at com.sun.enterprise.connectors.util.ConnectorDDTransformUtils.getConnectorDescriptor(ConnectorDDTransformUtils.java:198)
        at com.sun.enterprise.connectors.service.ResourceAdapterAdminServiceImpl.createActiveResourceAdapter(ResourceAdapterAdminServiceImpl.java:329)
        at com.sun.enterprise.connectors.ConnectorRuntime.createActiveResourceAdapter(ConnectorRuntime.java:330)
        at com.sun.enterprise.connectors.service.ConnectorService.loadDeferredResourceAdapter(ConnectorService.java:164)
        at com.sun.enterprise.connectors.service.ConnectorService.loadResourcesAndItsRar(ConnectorService.java:133)
        at com.sun.enterprise.connectors.service.ConnectorService.checkAndLoadPool(ConnectorService.java:307)
        at com.sun.enterprise.connectors.service.ConnectorConnectionPoolAdminServiceImpl.getManagedConnectionFactory(ConnectorConnectionPoolAdminServiceImpl.java:541)
        at com.sun.enterprise.connectors.service.ConnectorConnectionPoolAdminServiceImpl.getUnpooledConnection(ConnectorConnectionPoolAdminServiceImpl.java:627)
        at com.sun.enterprise.connectors.service.ConnectorConnectionPoolAdminServiceImpl.testConnectionPool(ConnectorConnectionPoolAdminServiceImpl.java:442)
        at com.sun.enterprise.connectors.ConnectorRuntime.pingConnectionPool(ConnectorRuntime.java:898)
        at org.glassfish.connectors.admin.cli.PingConnectionPool.execute(PingConnectionPool.java:94)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:305)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:320)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1176)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$900(CommandRunnerImpl.java:83)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1235)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1224)
        at com.lifeisgreat.rpos.appserver.AppServer.invokeCommand(AppServer.java:88)
        at com.lifeisgreat.rpos.appserver.AppServer.pingJdbcConnectionPool(AppServer.java:132)
        at com.lifeisgreat.rpos.appserver.AppServer.configure(AppServer.java:96)
        at com.lifeisgreat.rpos.appserver.AppServer.start(AppServer.java:56)
        at com.lifeisgreat.rpos.Main.main(Main.java:30)
Caused by: java.io.FileNotFoundException: /D:/MyProjects/Regional_POS/POC/instance/lib/install/applications/__xa_jdbc_ra
        at com.sun.enterprise.deploy.shared.FileArchive.open(FileArchive.java:72)
        at com.sun.enterprise.connectors.util.ConnectorDDTransformUtils.getConnectorDescriptor(ConnectorDDTransformUtils.java:183)
        ... 21 more
Feb 26, 2010 11:03:06 AM com.sun.enterprise.connectors.service.ConnectorService loadResourcesAndItsRar
SEVERE: failed.to.load.deferred.ra
Feb 26, 2010 11:03:06 AM com.sun.enterprise.connectors.service.ConnectorConnectionPoolAdminServiceImpl getManagedConnectionFactory
WARNING: jdbc.pool_not_reachable
Feb 26, 2010 11:03:06 AM com.sun.enterprise.connectors.service.ConnectorConnectionPoolAdminServiceImpl testConnectionPool
WARNING: test.connection.pool.failed

Is there any special things that I need to do before registering the new connection pool?
If so, how to use API to do those things?

I attach my source code for reference as well.

Thanks.
[Message sent by forum member 'henry_ken' (henry_ken10_at_hotmail.com)]

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