You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cayenne.apache.org by Michael Lepine <mi...@gmail.com> on 2007/08/20 23:10:12 UTC

Strange Oracle Connection Issue

Hello all, I am running into a perplexing issue. I am trying to run an
application I've written (using Cayenne) on a Solaris 10 box and keep
getting connection errors. During development, I modified the Cayenne
driver.xml file many times with different database connection parameters and
have never had a problem until now. The app was tested on Windows and this
is the first time it's being run on Solaris. The database version is Oracle
10g and the error is:

ORA-12505, TNS:listener does not currently know of SID given in connect
descriptor

(I've pasted a more detailed stacktrace with the error below.)

This is odd because I am using the same service_name/sid, host and port data
to connect to the database via TOAD. I have also tested the connection by
creating another (Java) connection pool with the same connection parameters.
I even changed the connection parameters to reference another database that
I've connected to as well and get the same error.

So, I'm at a loss and hope that somebody out there has some ideas. Thanks
for any help.



The error I'm seeing is:

     [java] ERROR [Thread-3] - [v.2.0.3 May 6 2007] Error detecting database
type
     [java] org.apache.cayenne.CayenneRuntimeException: [v.2.0.3 May 6 2007]
Error detecting database type
     [java]     at org.apache.cayenne.dba.AutoAdapter.loadAdapter(
AutoAdapter.java:159)
     [java]     at org.apache.cayenne.dba.AutoAdapter.getAdapter(
AutoAdapter.java:129)
     [java]     at org.apache.cayenne.dba.AutoAdapter.getExtendedTypes(
AutoAdapter.java:239)
     [java]     at org.apache.cayenne.access.DataNode.performQueries(
DataNode.java:246)
     [java]     at org.apache.cayenne.access.DataDomainQueryAction.runQuery(
DataDomainQueryAction.java:301)
     [java]     at
org.apache.cayenne.access.DataDomainQueryAction.access$000(
DataDomainQueryAction.java:60)
     [java]     at
org.apache.cayenne.access.DataDomainQueryAction$1.transform(
DataDomainQueryAction.java:273)
     [java]     at org.apache.cayenne.access.DataDomain.runInTransaction(
DataDomain.java:836)
     [java]     at
org.apache.cayenne.access.DataDomainQueryAction.runQueryInTransaction(
DataDomainQueryAction.java:270)
     [java]     at
org.apache.cayenne.access.DataDomainQueryAction.interceptOIDQuery(
DataDomainQueryAction.java:138)
     [java]     at org.apache.cayenne.access.DataDomainQueryAction.execute(
DataDomainQueryAction.java:107)
     [java]     at org.apache.cayenne.access.DataDomain.onQuery(
DataDomain.java:746)
     [java]     at org.apache.cayenne.util.ObjectContextQueryAction.runQuery
(ObjectContextQueryAction.java:217)
     [java]     at org.apache.cayenne.access.DataContextQueryAction.execute(
DataContextQueryAction.java:54)
     [java]     at org.apache.cayenne.access.DataContext.onQuery(
DataContext.java:1387)
     [java]     at org.apache.cayenne.access.DataContext.performQuery(
DataContext.java:1376)
     [java]     at org.apache.cayenne.DataObjectUtils.objectForQuery(
DataObjectUtils.java:254)
     [java]     at org.apache.cayenne.DataObjectUtils.objectForPK(
DataObjectUtils.java:240)
     [java]     at org.apache.cayenne.DataObjectUtils.objectForPK(
DataObjectUtils.java:149)
     [java]     at
com.goperiscope.dataaccess.cayenne.CayennePersistenceManager.findObject(
CayennePersistenceManager.java:26)
     [java]     at com.goperiscope.dao.ProcessStatusCodes.getInstance(
ProcessStatusCodes.java:65)
     [java]     at
com.goperiscope.alaska.SynchronizationProcess.createSynchJob(
SynchronizationProcess.java:540)
     [java]     at com.goperiscope.alaska.SynchronizationProcess.execute(
SynchronizationProcess.java:144)
     [java]     at com.wsc.process.Process.runProcess(Process.java:176)
     [java]     at com.wsc.process.Process$1.run(Process.java:343)
     [java]     at java.util.TimerThread.mainLoop(Timer.java:432)
     [java]     at java.util.TimerThread.run(Timer.java:382)
Caused by: java.sql.SQLException: Listener refused the connection with the
following error:
     [java] ORA-12505, TNS:listener does not currently know of SID given in
connect descriptor

Re: Strange Oracle Connection Issue

Posted by Andrus Adamchik <an...@objectstyle.org>.
I just did a quick test with Oracle 10.2 on Linux. Both variants of  
the URL work. But since the one with slashes seems to be the future,  
I updated 3.0 Modeler to suggest it by default.

Andrus


On Aug 21, 2007, at 9:35 PM, Michael Lepine wrote:

> I did figure out the reason for this issue. It was the JDBC URL.  
> From what
> I've read, it appears that the supported format for the JDBC URL in  
> Oracle
> 10g is slightly different than with previous versions.
>
> http://download-east.oracle.com/docs/cd/B19306_01/java.102/b14355/ 
> urls.htm#BEIDHCBA
>
> The old format (one generated by Cayenne 2.x):
>
> jdbc:oracle:thin:@localhost:1521:orcl
>
> new format (notice the inserted slashes especially between the port  
> and
> service name):
>
> jdbc:oracle:thin:@//localhost:1521/orcl
>
> The new format works for me.
>
> The odd thing is that my tests against other 10g database instances  
> (both on
> Windows and Solaris) worked fine with the older format. I'm really  
> not sure
> what the underlying reason is, but this is how I got around it.
>
> Thanks to everyone for their responses.
>
> On 8/20/07, Mike Kienenberger <mk...@gmail.com> wrote:
>>
>> I'm no expert, so I'm probably not the best person to ask, but here's
>> some things that come to mind:
>>
>> 1) Using a different driver in Cayenne config.
>> 2) Using a different path (or maybe home directory) for Cayenne  
>> config.
>> 3) Using a different driver url for Cayenne config.
>>
>> On 8/20/07, Michael Lepine <mi...@gmail.com> wrote:
>>> My assumption was that this had been created, but I am trying to  
>>> verify
>>> this. I do not have full control over this Solaris environment which
>> adds to
>>> the fun.
>>>
>>> The issue I'm having a hard time understanding is why a  
>>> connection is
>> made
>>> successfully in my Java test code (via a homegrown connection  
>>> polling
>>> mechanism), but Cayenne cannot connect to the same database. It  
>>> seems
>> like
>>> these should either both work or both fail.
>>>
>>>
>>> On 8/20/07, Mike Kienenberger <mk...@gmail.com> wrote:
>>>>
>>>> Your windows box has a configured tnsnames.ora file somewhere,
>>>> probably somewhere like
>>>> \Oracle\product\10.1.0\Client_1\network\ADMIN\tnsnames.ora.
>>>>
>>>> You probably need to configure the same file on your Solaris box.
>>>> Either that or use the fully-qualified domain name to your  
>>>> server (and
>>>> you still might have issues).
>>>>
>>>> On 8/20/07, Michael Lepine <mi...@gmail.com> wrote:
>>>>> Hello all, I am running into a perplexing issue. I am trying to  
>>>>> run
>> an
>>>>> application I've written (using Cayenne) on a Solaris 10 box and
>> keep
>>>>> getting connection errors. During development, I modified the
>> Cayenne
>>>>> driver.xml file many times with different database connection
>> parameters
>>>> and
>>>>> have never had a problem until now. The app was tested on Windows
>> and
>>>> this
>>>>> is the first time it's being run on Solaris. The database  
>>>>> version is
>>>> Oracle
>>>>> 10g and the error is:
>>>>>
>>>>> ORA-12505, TNS:listener does not currently know of SID given in
>> connect
>>>>> descriptor
>>>>>
>>>>> (I've pasted a more detailed stacktrace with the error below.)
>>>>>
>>>>> This is odd because I am using the same service_name/sid, host and
>> port
>>>> data
>>>>> to connect to the database via TOAD. I have also tested the
>> connection
>>>> by
>>>>> creating another (Java) connection pool with the same connection
>>>> parameters.
>>>>> I even changed the connection parameters to reference another
>> database
>>>> that
>>>>> I've connected to as well and get the same error.
>>>>>
>>>>> So, I'm at a loss and hope that somebody out there has some ideas.
>>>> Thanks
>>>>> for any help.
>>>>>
>>>>>
>>>>>
>>>>> The error I'm seeing is:
>>>>>
>>>>>      [java] ERROR [Thread-3] - [v.2.0.3 May 6 2007] Error  
>>>>> detecting
>>>> database
>>>>> type
>>>>>      [java] org.apache.cayenne.CayenneRuntimeException: [v. 
>>>>> 2.0.3 May
>> 6
>>>> 2007]
>>>>> Error detecting database type
>>>>>      [java]     at org.apache.cayenne.dba.AutoAdapter.loadAdapter(
>>>>> AutoAdapter.java:159)
>>>>>      [java]     at org.apache.cayenne.dba.AutoAdapter.getAdapter(
>>>>> AutoAdapter.java:129)
>>>>>      [java]     at
>> org.apache.cayenne.dba.AutoAdapter.getExtendedTypes(
>>>>> AutoAdapter.java:239)
>>>>>      [java]     at  
>>>>> org.apache.cayenne.access.DataNode.performQueries
>> (
>>>>> DataNode.java:246)
>>>>>      [java]     at
>>>> org.apache.cayenne.access.DataDomainQueryAction.runQuery(
>>>>> DataDomainQueryAction.java:301)
>>>>>      [java]     at
>>>>> org.apache.cayenne.access.DataDomainQueryAction.access$000(
>>>>> DataDomainQueryAction.java:60)
>>>>>      [java]     at
>>>>> org.apache.cayenne.access.DataDomainQueryAction$1.transform(
>>>>> DataDomainQueryAction.java:273)
>>>>>      [java]     at
>> org.apache.cayenne.access.DataDomain.runInTransaction
>>>> (
>>>>> DataDomain.java:836)
>>>>>      [java]     at
>>>>>
>> org.apache.cayenne.access.DataDomainQueryAction.runQueryInTransaction 
>> (
>>>>> DataDomainQueryAction.java:270)
>>>>>      [java]     at
>>>>> org.apache.cayenne.access.DataDomainQueryAction.interceptOIDQuery(
>>>>> DataDomainQueryAction.java:138)
>>>>>      [java]     at
>>>> org.apache.cayenne.access.DataDomainQueryAction.execute(
>>>>> DataDomainQueryAction.java:107)
>>>>>      [java]     at org.apache.cayenne.access.DataDomain.onQuery(
>>>>> DataDomain.java:746)
>>>>>      [java]     at
>>>> org.apache.cayenne.util.ObjectContextQueryAction.runQuery
>>>>> (ObjectContextQueryAction.java:217)
>>>>>      [java]     at
>>>> org.apache.cayenne.access.DataContextQueryAction.execute(
>>>>> DataContextQueryAction.java:54)
>>>>>      [java]     at org.apache.cayenne.access.DataContext.onQuery(
>>>>> DataContext.java:1387)
>>>>>      [java]     at
>> org.apache.cayenne.access.DataContext.performQuery(
>>>>> DataContext.java:1376)
>>>>>      [java]     at  
>>>>> org.apache.cayenne.DataObjectUtils.objectForQuery
>> (
>>>>> DataObjectUtils.java:254)
>>>>>      [java]     at org.apache.cayenne.DataObjectUtils.objectForPK(
>>>>> DataObjectUtils.java:240)
>>>>>      [java]     at org.apache.cayenne.DataObjectUtils.objectForPK(
>>>>> DataObjectUtils.java:149)
>>>>>      [java]     at
>>>>>
>> com.goperiscope.dataaccess.cayenne.CayennePersistenceManager.findObje 
>> ct(
>>>>> CayennePersistenceManager.java:26)
>>>>>      [java]     at
>> com.goperiscope.dao.ProcessStatusCodes.getInstance(
>>>>> ProcessStatusCodes.java:65)
>>>>>      [java]     at
>>>>> com.goperiscope.alaska.SynchronizationProcess.createSynchJob(
>>>>> SynchronizationProcess.java:540)
>>>>>      [java]     at
>> com.goperiscope.alaska.SynchronizationProcess.execute
>>>> (
>>>>> SynchronizationProcess.java:144)
>>>>>      [java]     at com.wsc.process.Process.runProcess(Process.java
>> :176)
>>>>>      [java]     at com.wsc.process.Process$1.run(Process.java:343)
>>>>>      [java]     at java.util.TimerThread.mainLoop(Timer.java:432)
>>>>>      [java]     at java.util.TimerThread.run(Timer.java:382)
>>>>> Caused by: java.sql.SQLException: Listener refused the connection
>> with
>>>> the
>>>>> following error:
>>>>>      [java] ORA-12505, TNS:listener does not currently know of SID
>> given
>>>> in
>>>>> connect descriptor
>>>>>
>>>>
>>>
>>


Re: Strange Oracle Connection Issue

Posted by Michael Lepine <mi...@gmail.com>.
I did figure out the reason for this issue. It was the JDBC URL. From what
I've read, it appears that the supported format for the JDBC URL in Oracle
10g is slightly different than with previous versions.

http://download-east.oracle.com/docs/cd/B19306_01/java.102/b14355/urls.htm#BEIDHCBA

The old format (one generated by Cayenne 2.x):

jdbc:oracle:thin:@localhost:1521:orcl

new format (notice the inserted slashes especially between the port and
service name):

jdbc:oracle:thin:@//localhost:1521/orcl

The new format works for me.

The odd thing is that my tests against other 10g database instances (both on
Windows and Solaris) worked fine with the older format. I'm really not sure
what the underlying reason is, but this is how I got around it.

Thanks to everyone for their responses.

On 8/20/07, Mike Kienenberger <mk...@gmail.com> wrote:
>
> I'm no expert, so I'm probably not the best person to ask, but here's
> some things that come to mind:
>
> 1) Using a different driver in Cayenne config.
> 2) Using a different path (or maybe home directory) for Cayenne config.
> 3) Using a different driver url for Cayenne config.
>
> On 8/20/07, Michael Lepine <mi...@gmail.com> wrote:
> > My assumption was that this had been created, but I am trying to verify
> > this. I do not have full control over this Solaris environment which
> adds to
> > the fun.
> >
> > The issue I'm having a hard time understanding is why a connection is
> made
> > successfully in my Java test code (via a homegrown connection polling
> > mechanism), but Cayenne cannot connect to the same database. It seems
> like
> > these should either both work or both fail.
> >
> >
> > On 8/20/07, Mike Kienenberger <mk...@gmail.com> wrote:
> > >
> > > Your windows box has a configured tnsnames.ora file somewhere,
> > > probably somewhere like
> > > \Oracle\product\10.1.0\Client_1\network\ADMIN\tnsnames.ora.
> > >
> > > You probably need to configure the same file on your Solaris box.
> > > Either that or use the fully-qualified domain name to your server (and
> > > you still might have issues).
> > >
> > > On 8/20/07, Michael Lepine <mi...@gmail.com> wrote:
> > > > Hello all, I am running into a perplexing issue. I am trying to run
> an
> > > > application I've written (using Cayenne) on a Solaris 10 box and
> keep
> > > > getting connection errors. During development, I modified the
> Cayenne
> > > > driver.xml file many times with different database connection
> parameters
> > > and
> > > > have never had a problem until now. The app was tested on Windows
> and
> > > this
> > > > is the first time it's being run on Solaris. The database version is
> > > Oracle
> > > > 10g and the error is:
> > > >
> > > > ORA-12505, TNS:listener does not currently know of SID given in
> connect
> > > > descriptor
> > > >
> > > > (I've pasted a more detailed stacktrace with the error below.)
> > > >
> > > > This is odd because I am using the same service_name/sid, host and
> port
> > > data
> > > > to connect to the database via TOAD. I have also tested the
> connection
> > > by
> > > > creating another (Java) connection pool with the same connection
> > > parameters.
> > > > I even changed the connection parameters to reference another
> database
> > > that
> > > > I've connected to as well and get the same error.
> > > >
> > > > So, I'm at a loss and hope that somebody out there has some ideas.
> > > Thanks
> > > > for any help.
> > > >
> > > >
> > > >
> > > > The error I'm seeing is:
> > > >
> > > >      [java] ERROR [Thread-3] - [v.2.0.3 May 6 2007] Error detecting
> > > database
> > > > type
> > > >      [java] org.apache.cayenne.CayenneRuntimeException: [v.2.0.3 May
> 6
> > > 2007]
> > > > Error detecting database type
> > > >      [java]     at org.apache.cayenne.dba.AutoAdapter.loadAdapter(
> > > > AutoAdapter.java:159)
> > > >      [java]     at org.apache.cayenne.dba.AutoAdapter.getAdapter(
> > > > AutoAdapter.java:129)
> > > >      [java]     at
> org.apache.cayenne.dba.AutoAdapter.getExtendedTypes(
> > > > AutoAdapter.java:239)
> > > >      [java]     at org.apache.cayenne.access.DataNode.performQueries
> (
> > > > DataNode.java:246)
> > > >      [java]     at
> > > org.apache.cayenne.access.DataDomainQueryAction.runQuery(
> > > > DataDomainQueryAction.java:301)
> > > >      [java]     at
> > > > org.apache.cayenne.access.DataDomainQueryAction.access$000(
> > > > DataDomainQueryAction.java:60)
> > > >      [java]     at
> > > > org.apache.cayenne.access.DataDomainQueryAction$1.transform(
> > > > DataDomainQueryAction.java:273)
> > > >      [java]     at
> org.apache.cayenne.access.DataDomain.runInTransaction
> > > (
> > > > DataDomain.java:836)
> > > >      [java]     at
> > > >
> org.apache.cayenne.access.DataDomainQueryAction.runQueryInTransaction(
> > > > DataDomainQueryAction.java:270)
> > > >      [java]     at
> > > > org.apache.cayenne.access.DataDomainQueryAction.interceptOIDQuery(
> > > > DataDomainQueryAction.java:138)
> > > >      [java]     at
> > > org.apache.cayenne.access.DataDomainQueryAction.execute(
> > > > DataDomainQueryAction.java:107)
> > > >      [java]     at org.apache.cayenne.access.DataDomain.onQuery(
> > > > DataDomain.java:746)
> > > >      [java]     at
> > > org.apache.cayenne.util.ObjectContextQueryAction.runQuery
> > > > (ObjectContextQueryAction.java:217)
> > > >      [java]     at
> > > org.apache.cayenne.access.DataContextQueryAction.execute(
> > > > DataContextQueryAction.java:54)
> > > >      [java]     at org.apache.cayenne.access.DataContext.onQuery(
> > > > DataContext.java:1387)
> > > >      [java]     at
> org.apache.cayenne.access.DataContext.performQuery(
> > > > DataContext.java:1376)
> > > >      [java]     at org.apache.cayenne.DataObjectUtils.objectForQuery
> (
> > > > DataObjectUtils.java:254)
> > > >      [java]     at org.apache.cayenne.DataObjectUtils.objectForPK(
> > > > DataObjectUtils.java:240)
> > > >      [java]     at org.apache.cayenne.DataObjectUtils.objectForPK(
> > > > DataObjectUtils.java:149)
> > > >      [java]     at
> > > >
> com.goperiscope.dataaccess.cayenne.CayennePersistenceManager.findObject(
> > > > CayennePersistenceManager.java:26)
> > > >      [java]     at
> com.goperiscope.dao.ProcessStatusCodes.getInstance(
> > > > ProcessStatusCodes.java:65)
> > > >      [java]     at
> > > > com.goperiscope.alaska.SynchronizationProcess.createSynchJob(
> > > > SynchronizationProcess.java:540)
> > > >      [java]     at
> com.goperiscope.alaska.SynchronizationProcess.execute
> > > (
> > > > SynchronizationProcess.java:144)
> > > >      [java]     at com.wsc.process.Process.runProcess(Process.java
> :176)
> > > >      [java]     at com.wsc.process.Process$1.run(Process.java:343)
> > > >      [java]     at java.util.TimerThread.mainLoop(Timer.java:432)
> > > >      [java]     at java.util.TimerThread.run(Timer.java:382)
> > > > Caused by: java.sql.SQLException: Listener refused the connection
> with
> > > the
> > > > following error:
> > > >      [java] ORA-12505, TNS:listener does not currently know of SID
> given
> > > in
> > > > connect descriptor
> > > >
> > >
> >
>

Re: Strange Oracle Connection Issue

Posted by Mike Kienenberger <mk...@gmail.com>.
I'm no expert, so I'm probably not the best person to ask, but here's
some things that come to mind:

1) Using a different driver in Cayenne config.
2) Using a different path (or maybe home directory) for Cayenne config.
3) Using a different driver url for Cayenne config.

On 8/20/07, Michael Lepine <mi...@gmail.com> wrote:
> My assumption was that this had been created, but I am trying to verify
> this. I do not have full control over this Solaris environment which adds to
> the fun.
>
> The issue I'm having a hard time understanding is why a connection is made
> successfully in my Java test code (via a homegrown connection polling
> mechanism), but Cayenne cannot connect to the same database. It seems like
> these should either both work or both fail.
>
>
> On 8/20/07, Mike Kienenberger <mk...@gmail.com> wrote:
> >
> > Your windows box has a configured tnsnames.ora file somewhere,
> > probably somewhere like
> > \Oracle\product\10.1.0\Client_1\network\ADMIN\tnsnames.ora.
> >
> > You probably need to configure the same file on your Solaris box.
> > Either that or use the fully-qualified domain name to your server (and
> > you still might have issues).
> >
> > On 8/20/07, Michael Lepine <mi...@gmail.com> wrote:
> > > Hello all, I am running into a perplexing issue. I am trying to run an
> > > application I've written (using Cayenne) on a Solaris 10 box and keep
> > > getting connection errors. During development, I modified the Cayenne
> > > driver.xml file many times with different database connection parameters
> > and
> > > have never had a problem until now. The app was tested on Windows and
> > this
> > > is the first time it's being run on Solaris. The database version is
> > Oracle
> > > 10g and the error is:
> > >
> > > ORA-12505, TNS:listener does not currently know of SID given in connect
> > > descriptor
> > >
> > > (I've pasted a more detailed stacktrace with the error below.)
> > >
> > > This is odd because I am using the same service_name/sid, host and port
> > data
> > > to connect to the database via TOAD. I have also tested the connection
> > by
> > > creating another (Java) connection pool with the same connection
> > parameters.
> > > I even changed the connection parameters to reference another database
> > that
> > > I've connected to as well and get the same error.
> > >
> > > So, I'm at a loss and hope that somebody out there has some ideas.
> > Thanks
> > > for any help.
> > >
> > >
> > >
> > > The error I'm seeing is:
> > >
> > >      [java] ERROR [Thread-3] - [v.2.0.3 May 6 2007] Error detecting
> > database
> > > type
> > >      [java] org.apache.cayenne.CayenneRuntimeException: [v.2.0.3 May 6
> > 2007]
> > > Error detecting database type
> > >      [java]     at org.apache.cayenne.dba.AutoAdapter.loadAdapter(
> > > AutoAdapter.java:159)
> > >      [java]     at org.apache.cayenne.dba.AutoAdapter.getAdapter(
> > > AutoAdapter.java:129)
> > >      [java]     at org.apache.cayenne.dba.AutoAdapter.getExtendedTypes(
> > > AutoAdapter.java:239)
> > >      [java]     at org.apache.cayenne.access.DataNode.performQueries(
> > > DataNode.java:246)
> > >      [java]     at
> > org.apache.cayenne.access.DataDomainQueryAction.runQuery(
> > > DataDomainQueryAction.java:301)
> > >      [java]     at
> > > org.apache.cayenne.access.DataDomainQueryAction.access$000(
> > > DataDomainQueryAction.java:60)
> > >      [java]     at
> > > org.apache.cayenne.access.DataDomainQueryAction$1.transform(
> > > DataDomainQueryAction.java:273)
> > >      [java]     at org.apache.cayenne.access.DataDomain.runInTransaction
> > (
> > > DataDomain.java:836)
> > >      [java]     at
> > > org.apache.cayenne.access.DataDomainQueryAction.runQueryInTransaction(
> > > DataDomainQueryAction.java:270)
> > >      [java]     at
> > > org.apache.cayenne.access.DataDomainQueryAction.interceptOIDQuery(
> > > DataDomainQueryAction.java:138)
> > >      [java]     at
> > org.apache.cayenne.access.DataDomainQueryAction.execute(
> > > DataDomainQueryAction.java:107)
> > >      [java]     at org.apache.cayenne.access.DataDomain.onQuery(
> > > DataDomain.java:746)
> > >      [java]     at
> > org.apache.cayenne.util.ObjectContextQueryAction.runQuery
> > > (ObjectContextQueryAction.java:217)
> > >      [java]     at
> > org.apache.cayenne.access.DataContextQueryAction.execute(
> > > DataContextQueryAction.java:54)
> > >      [java]     at org.apache.cayenne.access.DataContext.onQuery(
> > > DataContext.java:1387)
> > >      [java]     at org.apache.cayenne.access.DataContext.performQuery(
> > > DataContext.java:1376)
> > >      [java]     at org.apache.cayenne.DataObjectUtils.objectForQuery(
> > > DataObjectUtils.java:254)
> > >      [java]     at org.apache.cayenne.DataObjectUtils.objectForPK(
> > > DataObjectUtils.java:240)
> > >      [java]     at org.apache.cayenne.DataObjectUtils.objectForPK(
> > > DataObjectUtils.java:149)
> > >      [java]     at
> > > com.goperiscope.dataaccess.cayenne.CayennePersistenceManager.findObject(
> > > CayennePersistenceManager.java:26)
> > >      [java]     at com.goperiscope.dao.ProcessStatusCodes.getInstance(
> > > ProcessStatusCodes.java:65)
> > >      [java]     at
> > > com.goperiscope.alaska.SynchronizationProcess.createSynchJob(
> > > SynchronizationProcess.java:540)
> > >      [java]     at com.goperiscope.alaska.SynchronizationProcess.execute
> > (
> > > SynchronizationProcess.java:144)
> > >      [java]     at com.wsc.process.Process.runProcess(Process.java:176)
> > >      [java]     at com.wsc.process.Process$1.run(Process.java:343)
> > >      [java]     at java.util.TimerThread.mainLoop(Timer.java:432)
> > >      [java]     at java.util.TimerThread.run(Timer.java:382)
> > > Caused by: java.sql.SQLException: Listener refused the connection with
> > the
> > > following error:
> > >      [java] ORA-12505, TNS:listener does not currently know of SID given
> > in
> > > connect descriptor
> > >
> >
>

Re: Strange Oracle Connection Issue

Posted by Michael Lepine <mi...@gmail.com>.
My assumption was that this had been created, but I am trying to verify
this. I do not have full control over this Solaris environment which adds to
the fun.

The issue I'm having a hard time understanding is why a connection is made
successfully in my Java test code (via a homegrown connection polling
mechanism), but Cayenne cannot connect to the same database. It seems like
these should either both work or both fail.


On 8/20/07, Mike Kienenberger <mk...@gmail.com> wrote:
>
> Your windows box has a configured tnsnames.ora file somewhere,
> probably somewhere like
> \Oracle\product\10.1.0\Client_1\network\ADMIN\tnsnames.ora.
>
> You probably need to configure the same file on your Solaris box.
> Either that or use the fully-qualified domain name to your server (and
> you still might have issues).
>
> On 8/20/07, Michael Lepine <mi...@gmail.com> wrote:
> > Hello all, I am running into a perplexing issue. I am trying to run an
> > application I've written (using Cayenne) on a Solaris 10 box and keep
> > getting connection errors. During development, I modified the Cayenne
> > driver.xml file many times with different database connection parameters
> and
> > have never had a problem until now. The app was tested on Windows and
> this
> > is the first time it's being run on Solaris. The database version is
> Oracle
> > 10g and the error is:
> >
> > ORA-12505, TNS:listener does not currently know of SID given in connect
> > descriptor
> >
> > (I've pasted a more detailed stacktrace with the error below.)
> >
> > This is odd because I am using the same service_name/sid, host and port
> data
> > to connect to the database via TOAD. I have also tested the connection
> by
> > creating another (Java) connection pool with the same connection
> parameters.
> > I even changed the connection parameters to reference another database
> that
> > I've connected to as well and get the same error.
> >
> > So, I'm at a loss and hope that somebody out there has some ideas.
> Thanks
> > for any help.
> >
> >
> >
> > The error I'm seeing is:
> >
> >      [java] ERROR [Thread-3] - [v.2.0.3 May 6 2007] Error detecting
> database
> > type
> >      [java] org.apache.cayenne.CayenneRuntimeException: [v.2.0.3 May 6
> 2007]
> > Error detecting database type
> >      [java]     at org.apache.cayenne.dba.AutoAdapter.loadAdapter(
> > AutoAdapter.java:159)
> >      [java]     at org.apache.cayenne.dba.AutoAdapter.getAdapter(
> > AutoAdapter.java:129)
> >      [java]     at org.apache.cayenne.dba.AutoAdapter.getExtendedTypes(
> > AutoAdapter.java:239)
> >      [java]     at org.apache.cayenne.access.DataNode.performQueries(
> > DataNode.java:246)
> >      [java]     at
> org.apache.cayenne.access.DataDomainQueryAction.runQuery(
> > DataDomainQueryAction.java:301)
> >      [java]     at
> > org.apache.cayenne.access.DataDomainQueryAction.access$000(
> > DataDomainQueryAction.java:60)
> >      [java]     at
> > org.apache.cayenne.access.DataDomainQueryAction$1.transform(
> > DataDomainQueryAction.java:273)
> >      [java]     at org.apache.cayenne.access.DataDomain.runInTransaction
> (
> > DataDomain.java:836)
> >      [java]     at
> > org.apache.cayenne.access.DataDomainQueryAction.runQueryInTransaction(
> > DataDomainQueryAction.java:270)
> >      [java]     at
> > org.apache.cayenne.access.DataDomainQueryAction.interceptOIDQuery(
> > DataDomainQueryAction.java:138)
> >      [java]     at
> org.apache.cayenne.access.DataDomainQueryAction.execute(
> > DataDomainQueryAction.java:107)
> >      [java]     at org.apache.cayenne.access.DataDomain.onQuery(
> > DataDomain.java:746)
> >      [java]     at
> org.apache.cayenne.util.ObjectContextQueryAction.runQuery
> > (ObjectContextQueryAction.java:217)
> >      [java]     at
> org.apache.cayenne.access.DataContextQueryAction.execute(
> > DataContextQueryAction.java:54)
> >      [java]     at org.apache.cayenne.access.DataContext.onQuery(
> > DataContext.java:1387)
> >      [java]     at org.apache.cayenne.access.DataContext.performQuery(
> > DataContext.java:1376)
> >      [java]     at org.apache.cayenne.DataObjectUtils.objectForQuery(
> > DataObjectUtils.java:254)
> >      [java]     at org.apache.cayenne.DataObjectUtils.objectForPK(
> > DataObjectUtils.java:240)
> >      [java]     at org.apache.cayenne.DataObjectUtils.objectForPK(
> > DataObjectUtils.java:149)
> >      [java]     at
> > com.goperiscope.dataaccess.cayenne.CayennePersistenceManager.findObject(
> > CayennePersistenceManager.java:26)
> >      [java]     at com.goperiscope.dao.ProcessStatusCodes.getInstance(
> > ProcessStatusCodes.java:65)
> >      [java]     at
> > com.goperiscope.alaska.SynchronizationProcess.createSynchJob(
> > SynchronizationProcess.java:540)
> >      [java]     at com.goperiscope.alaska.SynchronizationProcess.execute
> (
> > SynchronizationProcess.java:144)
> >      [java]     at com.wsc.process.Process.runProcess(Process.java:176)
> >      [java]     at com.wsc.process.Process$1.run(Process.java:343)
> >      [java]     at java.util.TimerThread.mainLoop(Timer.java:432)
> >      [java]     at java.util.TimerThread.run(Timer.java:382)
> > Caused by: java.sql.SQLException: Listener refused the connection with
> the
> > following error:
> >      [java] ORA-12505, TNS:listener does not currently know of SID given
> in
> > connect descriptor
> >
>

Re: Strange Oracle Connection Issue

Posted by Mike Kienenberger <mk...@gmail.com>.
Your windows box has a configured tnsnames.ora file somewhere,
probably somewhere like
\Oracle\product\10.1.0\Client_1\network\ADMIN\tnsnames.ora.

You probably need to configure the same file on your Solaris box.
Either that or use the fully-qualified domain name to your server (and
you still might have issues).

On 8/20/07, Michael Lepine <mi...@gmail.com> wrote:
> Hello all, I am running into a perplexing issue. I am trying to run an
> application I've written (using Cayenne) on a Solaris 10 box and keep
> getting connection errors. During development, I modified the Cayenne
> driver.xml file many times with different database connection parameters and
> have never had a problem until now. The app was tested on Windows and this
> is the first time it's being run on Solaris. The database version is Oracle
> 10g and the error is:
>
> ORA-12505, TNS:listener does not currently know of SID given in connect
> descriptor
>
> (I've pasted a more detailed stacktrace with the error below.)
>
> This is odd because I am using the same service_name/sid, host and port data
> to connect to the database via TOAD. I have also tested the connection by
> creating another (Java) connection pool with the same connection parameters.
> I even changed the connection parameters to reference another database that
> I've connected to as well and get the same error.
>
> So, I'm at a loss and hope that somebody out there has some ideas. Thanks
> for any help.
>
>
>
> The error I'm seeing is:
>
>      [java] ERROR [Thread-3] - [v.2.0.3 May 6 2007] Error detecting database
> type
>      [java] org.apache.cayenne.CayenneRuntimeException: [v.2.0.3 May 6 2007]
> Error detecting database type
>      [java]     at org.apache.cayenne.dba.AutoAdapter.loadAdapter(
> AutoAdapter.java:159)
>      [java]     at org.apache.cayenne.dba.AutoAdapter.getAdapter(
> AutoAdapter.java:129)
>      [java]     at org.apache.cayenne.dba.AutoAdapter.getExtendedTypes(
> AutoAdapter.java:239)
>      [java]     at org.apache.cayenne.access.DataNode.performQueries(
> DataNode.java:246)
>      [java]     at org.apache.cayenne.access.DataDomainQueryAction.runQuery(
> DataDomainQueryAction.java:301)
>      [java]     at
> org.apache.cayenne.access.DataDomainQueryAction.access$000(
> DataDomainQueryAction.java:60)
>      [java]     at
> org.apache.cayenne.access.DataDomainQueryAction$1.transform(
> DataDomainQueryAction.java:273)
>      [java]     at org.apache.cayenne.access.DataDomain.runInTransaction(
> DataDomain.java:836)
>      [java]     at
> org.apache.cayenne.access.DataDomainQueryAction.runQueryInTransaction(
> DataDomainQueryAction.java:270)
>      [java]     at
> org.apache.cayenne.access.DataDomainQueryAction.interceptOIDQuery(
> DataDomainQueryAction.java:138)
>      [java]     at org.apache.cayenne.access.DataDomainQueryAction.execute(
> DataDomainQueryAction.java:107)
>      [java]     at org.apache.cayenne.access.DataDomain.onQuery(
> DataDomain.java:746)
>      [java]     at org.apache.cayenne.util.ObjectContextQueryAction.runQuery
> (ObjectContextQueryAction.java:217)
>      [java]     at org.apache.cayenne.access.DataContextQueryAction.execute(
> DataContextQueryAction.java:54)
>      [java]     at org.apache.cayenne.access.DataContext.onQuery(
> DataContext.java:1387)
>      [java]     at org.apache.cayenne.access.DataContext.performQuery(
> DataContext.java:1376)
>      [java]     at org.apache.cayenne.DataObjectUtils.objectForQuery(
> DataObjectUtils.java:254)
>      [java]     at org.apache.cayenne.DataObjectUtils.objectForPK(
> DataObjectUtils.java:240)
>      [java]     at org.apache.cayenne.DataObjectUtils.objectForPK(
> DataObjectUtils.java:149)
>      [java]     at
> com.goperiscope.dataaccess.cayenne.CayennePersistenceManager.findObject(
> CayennePersistenceManager.java:26)
>      [java]     at com.goperiscope.dao.ProcessStatusCodes.getInstance(
> ProcessStatusCodes.java:65)
>      [java]     at
> com.goperiscope.alaska.SynchronizationProcess.createSynchJob(
> SynchronizationProcess.java:540)
>      [java]     at com.goperiscope.alaska.SynchronizationProcess.execute(
> SynchronizationProcess.java:144)
>      [java]     at com.wsc.process.Process.runProcess(Process.java:176)
>      [java]     at com.wsc.process.Process$1.run(Process.java:343)
>      [java]     at java.util.TimerThread.mainLoop(Timer.java:432)
>      [java]     at java.util.TimerThread.run(Timer.java:382)
> Caused by: java.sql.SQLException: Listener refused the connection with the
> following error:
>      [java] ORA-12505, TNS:listener does not currently know of SID given in
> connect descriptor
>