I created a new connection pool following steps from here (
http://technology.amis.nl/blog/1276/configuring-a-oracle-datasource-on-glassfish). I clicked the Ping button after the connection pool creation and the result is "Ping Succeeded". Then I created a JDBC resource.
I saw this in the server.log file:
[#|2009-01-04T19:40:38.382-0500|WARNING|sun-appserver9.1|javax.enterprise.system.stream.err|_ThreadID=18;_ThreadName=pool-8-thread-1;_RequestID=03d6d170-3fb9-4d50-af4e-8a7b9fd6d53b;|Local Exception Stack:
Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2.0.1 (Build b04-fcs (04/11/2008))): oracle.toplink.essentials.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: Error in allocating a connection. Cause: Connection could not be allocated because: java.net.ConnectException : Error connecting to server localhost on port 1527 with message Connection refused.
Error Code: 0
at oracle.toplink.essentials.exceptions.DatabaseException.sqlException(DatabaseException.java:305)
at oracle.toplink.essentials.jndi.JNDIConnector.connect(JNDIConnector.java:150)
at oracle.toplink.essentials.sessions.DatasourceLogin.connectToDatasource(DatasourceLogin.java:184)
at oracle.toplink.essentials.internal.sessions.DatabaseSessionImpl.loginAndDetectDatasource(DatabaseSessionImpl.java:582)
at oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.login(EntityManagerFactoryProvider.java:280)
at oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:229)
at oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerFactoryImpl.getServerSession(EntityManagerFactoryImpl.java:93)
at oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:126)
at oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:120)
at oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:91)
at com.sun.slynkr.impl.ServiceImpl.createTransaction(ServiceImpl.java:71)
at com.sun.slynkr.impl.QueryImpl.getList(QueryImpl.java:142)
at com.sun.slynkr.Query.getList(Query.java:65)
at com.sun.slynkr.impl.providers.FreshnessAttrProvider.run(FreshnessAttrProvider.java:83)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.sql.SQLException: Error in allocating a connection. Cause: Connection could not be allocated because: java.net.ConnectException : Error connecting to server localhost on port 1527 with message Connection refused.
at com.sun.gjc.spi.base.DataSource.getConnection(DataSource.java:115)
at oracle.toplink.essentials.jndi.JNDIConnector.connect(JNDIConnector.java:145)
... 21 more
Does that mean TopLink cannot connect to my database?
[Message sent by forum member 'dxxvi' (dxxvi)]
http://forums.java.net/jive/thread.jspa?messageID=324004