JNDI Connection refused error

HI

I am new to Java so please excuse my stupid questions and general lack of ignorance. I am trying to connect to an Oracle database using JNDI to retrieve a Datasource using a 'data-source.xml' file but I get a 'Connection refused' error I am at a total loss at what this can be, I just have a simple Java Class which gets an InitialContext then does a lookup from here but this is were it fails.

Could anybody give me any idea as to where to look. Could it be a problem with the JNDI server itself?. I'm using JDeveloper 10.1.3 and am just trying to run it in the embedded server.

Sorry for the general rambling nature of this post and please ask me to provide any extra information required.

Any help would be much appreciated as I'm going nowhere with this at the moment and very frustrated as have searched everywhere with no results.

Thanks

Andy

[900 byte] By [riflevolunteera] at [2007-11-26 21:46:36]
# 1
The error "Connection refused" tells that the application is not able to establish the connection with the DB. Check if your DB instance is up and also check the connection URL in 'data-source.xml'.
Srini_Kandulaa at 2007-7-10 3:36:13 > top of Java-index,Core,Core APIs...
# 2

Hi

Thanks for the reply. I have checked my data-sources.xml and this all seems fine. I can even connect to the DB using DriverManager rather than the JNDI method. One thing that confuses me is which data-sources.xml it is using as there appear to be many. In JDeveloper you can specify the data sources in 'embeeded oc4j preferences' plus create your own under meta-inf. Which is being used when run in embedded, maybe thats obvious the first one?

thanks once again

riflevolunteera at 2007-7-10 3:36:14 > top of Java-index,Core,Core APIs...
# 3
OK feel a bit silly now. Found my problem it is running as a standalone application ! therefore not in app server, so no JNDI service! ok lesson learn'tThanks anyway
riflevolunteera at 2007-7-10 3:36:14 > top of Java-index,Core,Core APIs...
# 4

I think I'll need to look at your code. In fact it's better to post your code so that you'll be assured right& immediate help on forums.

See the datasource properties defined in data-sources.xml which is having the one being used by your JNDI lookup. Ideally you shouldn't have more than one definition for your data source in all the data-sources.xml files that are there in your application call path.

Srini_Kandulaa at 2007-7-10 3:36:14 > top of Java-index,Core,Core APIs...
# 5
Good you got it working. Sigh...
Srini_Kandulaa at 2007-7-10 3:36:14 > top of Java-index,Core,Core APIs...