Io exception: The Network Adapter could not establish the connection solution

Source: Internet
Author: User
Tags server port

Io exception: The Network Adapter could not establish the connection solutionJune 04, 2016 13:30:21Hits: 46589

Io exception: The Network Adapter could not establish the connection
The appearance of this anomaly is generally related to the database and your PC's settings

This anomaly appears in roughly the following ways:


1. IP error.
Error when setting URL, for example: Jdbc:oracle:thin:@192.168.0.36:1521:sharp
The database server is incorrect: Ping the server IP is correct. Incorrect, change the URL to the correct
Port number error: generally not error.
To do this: type Sqlplus on DOS to check if Oracle is turned on
One is normal, perform the 2nd step below.

2. Firewall
If a fire wall is installed on the machine, it may be caused by a server port number screen. After shutting down the firewall, try reconnecting.
Still not, take the 3rd step.

3. The database listener does not start modifying the ImagePath value in the registry on the PC.
I'm following the current mainstream database Oracle for example
Restart the database listener manually:
1: Start → run → input cmd→ into DOS command prompt interface
D:>lsnrctl
lsnrctl> status
Or
Lsnrctl> start
If it's similar to the information in the picture

Congratulations, your problem has been found, is the database listener did not start the cause.
Here's how to manually start a database:
Execute regedit at run to enter the registry to
Start → Run →regedit
Press the path below
Hkey_local_machine\system\currentcontrolset\services\oracleorahome90tnslistener
Find Oracleorahome90tnslistener (I'm using oracle9i other version of it should be Oracleorahomexxxtnslistener)

Once found, you will find that ImagePath key value does not exist, create it: (if there is, click to modify, the method is described below)
Right-click, pop-up menu select New Key (N) → string value (S)


Name it ImagePath
Select the ImagePath right-click and select Modify:

Enter your Oracle installation directory in the value \ora90 (the other is the oraxxx directory) \bin\tnslsnr

If Oracle 10G, the installation directory is F:\oracle\product\10.1.0\Db_2\BIN\tnslsnr

When you are sure, exit the registry:
Then type start in the DOS command
If the following screen appears, congratulations, the listener started successfully:

Shut down DOS, start your program to test, should return to normal.
These are the reasons why the Network Adapter could not establish the connection exception is common in 3.


Article Source: DIY Tribe (http://www.diybl.com/course/3_program/java/javashl/20071126/87790.html)

Exceptions are as follows:

Org.apache.commons.dbcp.SQLNestedException:Cannot Create Poolableconnectionfactory (Io exception: the Network Adapter could Not establish the connection)
At Org.apache.commons.dbcp.BasicDataSource.createDataSource (basicdatasource.java:1225)
At Org.apache.commons.dbcp.BasicDataSource.getConnection (basicdatasource.java:880)
Caused By:java.sql.SQLException:Io exception: The Network Adapter could not establish the connection
At Oracle.jdbc.dbaccess.DBError.throwSqlException (dberror.java:180)
At Oracle.jdbc.dbaccess.DBError.throwSqlException (dberror.java:222)
At Oracle.jdbc.dbaccess.DBError.throwSqlException (dberror.java:335)

Main reasons:

1. There may be an error in the DataSource configuration of the Server.xml file.

(1). If you are using data from this computer, the local data source is partially configured as: Username= "pcisv62" password= "one" url= "Jdbc:oracle:thin: @localhost: 1521:orcl"
(2). If you are using data from the server, the data source is partially configured as: Username= "pcisv62" password= "url=" Jdbc:oracle:thin: @dbserver: 1521:corev6 "

(DBServer is the name of the server, COREV6 is the SID of Oracle on the server)

2. There may be an error in Oracle's Tnsnames.ora file configuration.

Tnsnames.ora:
Local configuration under the installation directory E:\oracle\ora92\network\admin for Oracle:
ORCL =
   (DESCRIPTION =
     (address_list =
       (ADDRESS = (PROTOCOL = TCP) (HOST =   Host name) (PORT = 1521))
    )
     (connect_data =
        (SERVER = dedicated)
       (service_name = ORCL)
    )
  )
or server configuration:
Corev6_dbserver =
   (DESCRIPTION =
     (address_list =
       (ADDRESS = (PROTOCOL = TCP) (HOST = dbserver) (PORT = 1521))
     )
     (connect_data =
       (SID =  COREV6)
       (SERVER = dedicated)
    )
   )

Posted on 2010-10-23 15:43 Li min Reading (8516) Comments (1) Edit collection belongs to Category: Development tool Configuration review:
    • # Re:io Exception: The Network Adapter could not establish the connection (go) [not logged in] Liu Posted @ 2012-08-13 15:50http Status 500 -Hibernate Operation:cannot Open connection; Uncategorized SQLException for SQL [???]; SQL state [NULL]; Error code [0]; Cannot create poolableconnectionfactory (IO error: The Network Adapter could not establish the connection); Nested exception is org.apache.commons.dbcp.SQLNestedException:Cannot create Poolableconnectionfactory (IO error: the Network Adapter could not establish the connection)
      Reply to more comments

Io exception: The Network Adapter could not establish the connection solution

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.