• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Jboss to Oracle Connectivity Problem

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We have Oracle as the back end and Java-Jsp-Struts as the front end for our project.For the last few days we are facing a strange problem and although we tried a lot we were not able to find even the cause of the problem
We have Oracle server and Webserver running on seperate machine. As this is a webbased solution , clients can take the pages by putting the URL in the browser. The problem is that the connection to the database is lost sometimes and we need to restart our jboss server to get the connection again. Once it is restarted the pages work fine for sometime and after sometime the problem comes again. Sometimes the problem occures frequently and sometimes rarely.
1.The firewall is set to OFF both in server and client machine.
2. when the connection error occurs, we can ping from client machine to the server.
3.we can do tnsping also
4.we can connect through SQL*PLUS.
5. Listener is also running properly.
6. In the URL, we are using only IP .
7. The server IP is also constant.
8. changed the port number from 8080 to 8086 and checked.
9.database connection closing in java code is also properely done.

we have tried all these things, still we cannot resolve this error.

==========Error=============
description The server encountered an internal error () that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: Io exception: The Network Adapter could not establish the connection
org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:545)
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:486)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)


root cause

java.sql.SQLException: Io exception: The Network Adapter could not establish the connection
oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:124)
oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:161)
oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:273)
oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:318)
oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:343)
oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:147)
oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:31)
oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:545)
java.sql.DriverManager.getConnection(DriverManager.java:525)
java.sql.DriverManager.getConnection(DriverManager.java:171)
com.HCL.bean.Db.<init>(Db.java:22)
com.HCL.struts.login.LoginAction.execute(LoginAction.java:62)
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)



Thanks in advance,
Manju Mohanan
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And what is your Connection Pool settings?

Mark
 
manju mohanan
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The pool size in Jboss - hsqldb-ds.xml is
<min-pool-size>5</min-pool-size>
<max-pool-size>20</max-pool-size>

The init file in Oracle database 10g in linux is

db_recovery_file_dest=/u01/app/oracle/flash_recovery_area
db_recovery_file_dest_size=2147483648
# Job Queues
job_queue_processes=10

# Miscellaneous
compatible=10.1.0.2.0

# Pools
java_pool_size=50331648
large_pool_size=8388608
shared_pool_size=99614720

# Processes and Sessions
processes=250

# Security and Auditing
remote_login_passwordfile=EXCLUSIVE

# Shared Server
dispatchers="(PROTOCOL=TCP) (SERVICE=orclXDB)"

# Sort, Hash Joins, Bitmap Indexes
pga_aggregate_target=25165824
sort_area_size=65536

# System Managed Undo and Rollback Segments
undo_management=AUTO
undo_tablespace=UNDOTBS1


Thanks in advance
Manju Mohanan
 
Mark Spritzler
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"hsqldb-ds.xml"

Isn't that a datasource that connects to Hypersonic and not Oracle?

You need a datasource that points to Oracle. You can find an example in the jboss installation directory under the docs\examples\jca directory.

Check out this web page
http://wiki.jboss.org/wiki/Wiki.jsp?page=SetUpAOracleDatasource

Mark
 
manju mohanan
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
i have moved this file oracle-ds.xml to server/default/deploy directory and made changes according to our Oracle Database. in this file i have given connection pooling as
<min-pool-size>5</min-pool-size>
<max-pool-size>100</max-pool-size>
Till now i didnt get "Network Adapter could not establish connection" Error.will that error araise in future? Is there any other cause for this error other than this.

Thanks and regards
Manju Mohanan
 
Mark Spritzler
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Basically that error is just stating that there is a configuration problem and the data that it got was not correct to establish a connection. Either the IP, the port, the URL, could be the issue.

Mark
 
manju mohanan
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i have pasted oracle-ds.xml file into default/deploy directory and configured database connection coding with JNDI naming.
till now i didnt get "Network Adapter could not establish connection" error.
Thank you very much for the support.

regards,
Manju Mohanan.
reply
    Bookmark Topic Watch Topic
  • New Topic