Tomcat 6.0.18+oracle11g configuration data source Connection pool problems

Source: Internet
Author: User
Tags tomcat oracle database

Due to the time relationship I only write the first time I configured the problem encountered, start tomcat the following exception:

Cannot create poolableconnectionfactory (the network Adapter could not establish the connection)

The result is a failure to create a connection pool, on the internet to see a lot of this exception to the post, the results are not resolved, most of them say that the jar package is not imported into Tomcat's Lib directory, or the jar package is incorrect, these two points are also error-prone reasons, There are a lot of posts on the web that configure the data source in Tomcat, copy the configuration, change the corresponding parameters, the key does not care what each parameter really represents. But the reason I came up with that kind of error is here, the following is the

<context path= "/test" docbase= "test"
             debug= "5" reloadable= "true" crosscontext= "true"    workdir= ""
       < resource   name= "Jdbc/test"
                   auth= "Container"
         type= " Javax.sql.DataSource "
                   maxactive= "maxidle=" maxwait= "10000"
                   username= "root" password= "root"
          driverclassname= "Oracle.jdbc.driver.OracleDriver"
          Url= "Jdbc:oracle:thin: @localhost: 1521:orcl"/>
    </Context>

The problem is the configuration of that URL: that localhost should not be simply understood as a native of Tomcat, but should be an address that the Oracle database listener listens to, such as:

# Listener.ora Network Configuration File:e:/app/administrator/product/11.1.0/db_1/network/admin/listener.ora
# Generated by Oracle configuration tools.

LISTENER =
(Description_list =
(DESCRIPTION =
(address = (PROTOCOL = IPC) (KEY = EXTPROC1521))
(address = (PROTOCOL = TCP) (HOST = 192.168.1.100) (PORT = 1521))
)
)
The configuration of URLs in Tomcat should be: Url= "JDBC:ORACLE:THIN:@192.168.1.100:1521:ORCL"

"192.168.1.100" is the default access address after oracle11g is installed, and 1521 is the default access port number.

Finally note: When configuring Oracle's data source connection pool in Tomcat, be aware of the database address and port number that the database listener listens to. Location of the listener: E:/app/administrator/product/11.1.0/db_1/network/admin/listener.ora

Remind again: Like me the first use of people notice what the above URL refers to, thank my classmates and friends-liu help me solve this problem for a long time, and I hope that friends like me to see this article can successfully solve such problems.

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.