Skip to main content

Problem in the JDBC connection pools with Glassfish 3.1.2.2 and Oracle XE 11gR2

2 replies [Last post]
ievris
Offline
Joined: 2012-10-23
Points: 0

Hello,
I am experiencing an issue with pinging a JDBC connection Pool.
I installed the following without any warnings or errors:

Operating System: Oracle Enterprise Linux 5
Oracle XE 11gR2 (11.2.0.2.0) database
Open Source Glassfish 3.1.2.2 (build 5)

I will refer to the steps I did after the installations

1) In the .profile file of the OS I add the following:

JRE_HOME=/usr/java/jre1.6.0_31; export JRE_HOME
JAVA_HOME=/usr/java/jdk1.6.0_31; export JAVA_HOME
GLASSFISH_DIR=/u01/glassfish3
GLASSFISH_HOME=/u01/glassfish3/glassfish
DERBY_HOME=$GLASSFISH_DIR/javadb
OPEN_MQ_HOME=$GLASSFISH_DIR/mq

PATH=:$JAVA_HOME/bin:$JRE_HOME/bin:$PATH:$HOME/bin:$GLASSFISH_HOME/bin:$DERBY_HOME/bin:$OPEN_MQ_HOME/bin
export GLASSFISH_HOME
export DERBY_HOME
export OPEN_MQ_HOME
export PATH

LD_LIBRARY_PATH=/u01/app/oracle/product/11.2.0/xe/lib; export LD_LIBRARY_PATH
. /u01/app/oracle/product/11.2.0/xe/bin/oracle_env.sh

2) I copied the ojdbc6.jar to the $GLASSFISH_HOME/domains/domain1/lib

3) I login to the Glassfish admin console and created a new JDBC Connection Pool.

Pool Name: ds_orasys
Resource Type: javax.sql.DataSource
Datasource Classname: oracle.jdbc.pool.OracleDataSource

User: [myschema]
Password: [myschema password]
URL: jdbc:oracle:thin:@localhost:1521:xe

When I ping the connection pool I get the following message in the server log:

[#|2012-10-23T12:14:37.069+0300|WARNING|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.enterprise.connectors.service|_ThreadID=22;_ThreadName=Thread-2;|RAR8054: Exception while creating an unpooled [test] connection for pool [ ds_orasys ], Connection could not be allocated because: Invalid Oracle URL specified|#]

[#|2012-10-23T12:14:37.071+0300|SEVERE|glassfish3.1.2|org.glassfish.admingui|_ThreadID=19;_ThreadName=Thread-2;|RestResponse.getResponse() gives FAILURE. endpoint = 'http://212.205.62.217:4848/management/domain/resources/ping-connection-pool.json'; attrs = '{id=ds_orasys}'|#]

I tried to use different jar files. I used ojdbc6dms.jar and ojdbc14.jar.

I also copied the jar files in the $GLASSFISH_HOME/domains/domain1/lib/ext directory as some people suggested. Still no luck. I keep getting the same error messages in the server.log

Can anybody help me out or point me to the right direction.

Thank you in advance

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Kevin Schmidt

The error you are getting is about an invalid URL. Have you verified it is
correct?

Syntax is:

jdbc:oracle:thin:@//:/ServiceName
or
jdbc:oracle:thin:@::

NOTE: The Oracle thin driver requires the SID or ServiceName of the
database in the JDBC URL as opposed to the database alias. Consult your
Oracle documentation for more details.

On Tue, Oct 23, 2012 at 1:49 AM, wrote:

> Hello, I am experiencing an issue with pinging a JDBC connection Pool. I
> installed the following without any warnings or errors: Operating System:
> Oracle Enterprise Linux 5 Oracle XE 11gR2 (11.2.0.2.0) database Open Source
> Glassfish 3.1.2.2 (build 5) I will refer to the steps I did after the
> installations 1) In the .profile file of the OS I add the following:
> JRE_HOME=/usr/java/jre1.6.0_**31; export JRE_HOME
> JAVA_HOME=/usr/java/jdk1.6.0_**31; export JAVA_HOME
> GLASSFISH_DIR=/u01/glassfish3 GLASSFISH_HOME=/u01/**glassfish3/glassfish
> DERBY_HOME=$GLASSFISH_DIR/**javadb OPEN_MQ_HOME=$GLASSFISH_DIR/mq
> PATH=:$JAVA_HOME/bin:$JRE_**HOME/bin:$PATH:$HOME/bin:$**
> GLASSFISH_HOME/bin:$DERBY_**HOME/bin:$OPEN_MQ_HOME/bin
> export GLASSFISH_HOME export DERBY_HOME export OPEN_MQ_HOME export PATH
> LD_LIBRARY_PATH=/u01/app/**oracle/product/11.2.0/xe/lib; export
> LD_LIBRARY_PATH
> . /u01/app/oracle/product/11.2.**0/xe/bin/oracle_env.sh 2) I copied the
> ojdbc6.jar to the $GLASSFISH_HOME/domains/**domain1/lib 3) I login to the
> Glassfish admin console and created a new JDBC Connection Pool. Pool Name:
> ds_orasys Resource Type: javax.sql.DataSource Datasource Classname:
> oracle.jdbc.pool.**OracleDataSource User: [myschema] Password: [myschema
> password] URL: jdbc:oracle:thin:@localhost:**1521:xe When I ping the
> connection
> pool I get the following message in the server log:
> [#|2012-10-23T12:14:37.069+**0300|WARNING|glassfish3.1.2|**
> javax.enterprise.resource.**resourceadapter.com.sun.**
> enterprise.connectors.service|**_ThreadID=22;_ThreadName=**
> Thread-2;|RAR8054:
> Exception while creating an unpooled [test] connection for pool [ ds_orasys
> ], Connection could not be allocated because: Invalid Oracle URL
> specified|#]
> [#|2012-10-23T12:14:37.071+**0300|SEVERE|glassfish3.1.2|**
> org.glassfish.admingui|_**ThreadID=19;_ThreadName=**
> Thread-2;|RestResponse.**getResponse()
> gives FAILURE. endpoint =
> 'http://212.205.62.217:4848/**management/domain/resources/**
> ping-connection-pool.json
> ';
> attrs = '{id=ds_orasys}'|#] I tried to use different jar files. I used
> ojdbc6dms.jar and ojdbc14.jar. I also copied the jar files in the
> $GLASSFISH_HOME/domains/**domain1/lib/ext directory as some people
> suggested.
> Still no luck. I keep getting the same error messages in the server.log Can
> anybody help me out or point me to the right direction. Thank you in
> advance
>
> --
>
> [Message sent by forum member 'ievris']
>
> View Post: http://forums.java.net/node/**891672
>
>
>

ievris
Offline
Joined: 2012-10-23
Points: 0

forumguest wrote:
The error you are getting is about an invalid URL. Have you verified it is
correct?

Syntax is:

jdbc:oracle:thin:@//:
/ServiceName
or
jdbc:oracle:thin:@:
:

NOTE: The Oracle thin driver requires the SID or ServiceName of the
database in the JDBC URL as opposed to the database alias. Consult your
Oracle documentation for more details.
>

Thank you so much for the reply. You are right, the error is indeed in the URL. It was in front of my eyes and I couldn't see the error. I skipped the ':' before the '@' when I created the pool. It is working fine now.