How to Test DataSource connection in JBoss EAP 6.2 Managed Domain

Steve Cohen picture Steve Cohen · Aug 27, 2014 · Viewed 11.7k times · Source

I am trying to port an application from WebLogic to JBoss EAP 6.2.

When running the standalone server in JBoss, in the admin console there is a button and in the command line interface there is a command line option to check the data source connection.

/subsystem=datasources/data-source=myds:test-connection-in-pool

These options do not appear to exist in either place when running the "domain" server. Am I missing something? Is there some further setting I must make to enable it? I tried a technique which is sometimes an analog in the domain server and it doesn't work here.

/profile=full/subsystem=datasources/data-source=myds:test-connection-in-pool

JBoss docs are much weaker for "domain" model than for "standalone".

Answer

Kishore picture Kishore · Aug 28, 2014

You are absolutely correct that while running the standalone server in JBoss, in the admin console there is a button and in the command line interface there is a command line option to check the data source connection butThese options do not appear to exist in either place when running the "domain" server.

You still can use the command line of jboss-eap-6.x to test the configured data source connection in domain server. You need to navigate to $JBOSS_HOME/bin/ and execute script: jboss-cli.sh

Connect to the domain server controller with: connect :PORT_NO and execute the following commands:

For XA-DataSource:

/host=$Host_Controller_Name/server=$Server_Name/subsystem=datasources/xa-data-source=DataSource_JNDI_Name:test-connection-in-pool

For Non-XA-DataSource:

/host=$Host_Controller_Name/server=$Server_Name/subsystem=datasources/data-source=DataSource_JNDI_Name:test-connection-in-pool