Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

The Network Adapter could not establish the connection

Raul946612Apr 14 2014 — edited Apr 15 2014

Hi,

I am trying to connect to oracle db using my jdev connection.but its showing me this error each time.

Test failed: IO Error: The Network Adapter could not establish the connection

Even I tried with SQL Developer its also giving same same error.my username and password are correct as its working fine with SQL Plus.

I am using

HostName : localhost

Service Name : orcl

JDBC Port : 1521

I tried these in my command prompt :

C:\Users\HP>lsnrctl status

LSNRCTL for 32-bit Windows: Version 11.2.0.1.0 - Production on 14-APR-2014 17:52

:47

Copyright (c) 1991, 2010, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))

STATUS of the LISTENER

------------------------

Alias                     LISTENER

Version                   TNSLSNR for 32-bit Windows: Version 11.2.0.1.0 - Produ

ction

Start Date                14-APR-2014 17:10:50

Uptime                    0 days 0 hr. 42 min. 22 sec

Trace Level               off

Security                  ON: Local OS Authentication

SNMP                      OFF

Listener Parameter File   C:\app\HP\product\11.2.0\dbhome_1\network\admin\listen

er.ora

Listener Log File         c:\app\hp\diag\tnslsnr\HP-HP\listener\alert\log.xml

Listening Endpoints Summary...

  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC1521ipc)))

  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521)))

Services Summary...

Service "CLRExtProc" has 1 instance(s).

  Instance "CLRExtProc", status UNKNOWN, has 1 handler(s) for this service...

The command completed successfully

C:\Users\HP>tnsping orcl

TNS Ping Utility for 32-bit Windows: Version 11.2.0.1.0 - Production on 14-APR-2

014 17:59:33

Copyright (c) 1997, 2010, Oracle.  All rights reserved.

Used parameter files:

C:\app\HP\product\11.2.0\dbhome_1\network\admin\sqlnet.ora

Used TNSNAMES adapter to resolve the alias

Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = localhos

t)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl)))

OK (0 msec)

My jdev version is 11.1.2.4.0 and using oracle 11 g

Any idea what i am doing wrong.

Thanks,

Raul

Comments

vinaykumar2

try lsnrctl start

vinaykumar2

Following can be the cause.

Check all cases

Whenever you see a Network Adapter could not establish the connection, you have either the wrong SQL Developer URL or you have a basic SQL*Net connectivity issue!  This error is most likely caused by one of these factors:

- You are using the wrong URL

- The wrong port number or IP address (or DNS host name) was used

- The listener is not configured properly

- The listener process (service) is not running.  You can re-start it with the "lsnrctl start" command or on Windows by starting the listener service.

dvohra21

The Network Adapter could not establish the connection exception is caused by one or more of the following configuration errors:

  1. The database host name, port number, or database instance name is wrong.
  2. The database TNSListener has not been started. The TNSListener may be started with the lsnrctl utility.

Use hostname as 127.0.0.1 instead of localhost.

Skh-Oracle

This error is seen when either :

  1. The database isn't running
  2. You got the Connection URL wrong
  3. There is a firewall in the way.

Instead of using "localhost", try using the IP address or DNS name of Database machine.

SKH

Skh-Oracle

Is the Database on a remote machine? If yes, "telnet" the IP Address on port 1521 and check the result.

If the connection is working, the workaround is to force Oracle JDeveloper to use the IPv4 address.

That can be done using the following steps:

- Open the JDEV_HOME/jdeveloper/jdev/bin/jdev.conf

- Add the following flag:

- AddVMOption -Djava.net.preferIPv4Stack=true

- Restart JDeveloper.

SKH

Raul946612

Oracle is on my local machine not on remote server.so i also tried with IP address 127.0.0.1 but still giving me this error

Test failed: Listener refused the connection with the following error:

ORA-12514, TNS:listener does not currently know of service requested in connect descriptor


i also tried lsnrctl start command but still getting error.

when i run C:\Users\HP>tnsping orcl its returning me below result


Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = localhos

t)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl)))

where Host is localhost,Port is 1521 and service name is orcl same i am using.also its worked first time when i installed Oracle 11 g on my machine but after restart its behaving like like.

Raul

vinaykumar2

what error u getting after lsnrcrl start command? share that

Raul946612

I am not getting any error in case of lsnrcrl start its executing perfectly. But when i try to create connection again then its results same error
Test failed: IO Error: The Network Adapter could not establish the connection

unknown-7404
I am not getting any error in case of lsnrcrl start its executing perfectly. But when i try to create connection again then its results same error 
Test failed: IO Error: The Network Adapter could not establish the connection

The listener STATUS you show in the original post does NOT have an entry for 'orcl' - so that listener will never connect to it.

Force the database to register with the listener and then check the listener status again.,

ALTER SYSTEM REGISTER;

Raul946612

Hi rp,

i am new in oracle so can you tell me exactly how to register.also where to execute this command?

raul

Skh-Oracle

Goto SQL*Plus command prompt and enter the command , the you should see:

SQL> alter system register;


System altered.


SQL>


Hope this helps

1 - 11
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on May 13 2014
Added on Apr 14 2014
11 comments
1,714 views