ashishanand
asked on
JBOSS/Tomcat --Listener refused connection
When I call a JSP/Servlet deployed in JBOSS/Tomcat , I encounter the following error. The JSP/Servlet connects to Oracle 10g Express Edition installed locally. The error is not consistant.
at oracle.jdbc.driver.Databas eError.thr owSqlExcep tion(Datab aseError.j ava:112)
at oracle.jdbc.driver.Databas eError.thr owSqlExcep tion(Datab aseError.j ava:261)
at oracle.jdbc.driver.T4CConn ection.log on(T4CConn ection.jav a:387)
at oracle.jdbc.driver.Physica lConnectio n.<init>(P hysicalCon nection.ja va:420)
at oracle.jdbc.driver.T4CConn ection.<in it>(T4CCon nection.ja va:165)
at oracle.jdbc.driver.T4CDriv erExtensio n.getConne ction(T4CD riverExten sion.java: 35)
at oracle.jdbc.driver.OracleD river.conn ect(Oracle Driver.jav a:801)
at java.sql.DriverManager.get Connection (DriverMan ager.java: 525)
at java.sql.DriverManager.get Connection (DriverMan ager.java: 171)
at org.apache.jsp.jsp.templat eView_jsp. _jspServic e(template View_jsp.j ava:65)
at org.apache.jasper.runtime. HttpJspBas e.service( HttpJspBas e.java:97)
at javax.servlet.http.HttpSer vlet.servi ce(HttpSer vlet.java: 810)
at org.apache.jasper.servlet. JspServlet Wrapper.se rvice(JspS ervletWrap per.java:3 32)
at org.apache.jasper.servlet. JspServlet .serviceJs pFile(JspS ervlet.jav a:314)
at org.apache.jasper.servlet. JspServlet .service(J spServlet. java:264)
at javax.servlet.http.HttpSer vlet.servi ce(HttpSer vlet.java: 810)
at org.apache.catalina.core.A pplication FilterChai n.internal DoFilter(A pplication FilterChai n.java:252 )
at org.apache.catalina.core.A pplication FilterChai n.doFilter (Applicati onFilterCh ain.java:1 73)
at org.jboss.web.tomcat.filte rs.ReplyHe aderFilter .doFilter( ReplyHeade rFilter.ja va:96)
at org.apache.catalina.core.A pplication FilterChai n.internal DoFilter(A pplication FilterChai n.java:202 )
at org.apache.catalina.core.A pplication FilterChai n.doFilter (Applicati onFilterCh ain.java:1 73)
at org.apache.catalina.core.S tandardWra pperValve. invoke(Sta ndardWrapp erValve.ja va:213)
at org.apache.catalina.core.S tandardCon textValve. invoke(Sta ndardConte xtValve.ja va:178)
at org.jboss.web.tomcat.secur ity.Securi tyAssociat ionValve.i nvoke(Secu rityAssoci ationValve .java:175)
at org.jboss.web.tomcat.secur ity.JaccCo ntextValve .invoke(Ja ccContextV alve.java: 74)
at org.apache.catalina.core.S tandardHos tValve.inv oke(Standa rdHostValv e.java:126 )
at org.apache.catalina.valves .ErrorRepo rtValve.in voke(Error ReportValv e.java:105 )
at org.apache.catalina.core.S tandardEng ineValve.i nvoke(Stan dardEngine Valve.java :107)
at org.apache.catalina.connec tor.Coyote Adapter.se rvice(Coyo teAdapter. java:148)
at org.apache.coyote.http11.H ttp11Proce ssor.proce ss(Http11P rocessor.j ava:869)
at org.apache.coyote.http11.H ttp11BaseP rotocol$Ht tp11Connec tionHandle r.processC onnection( Http11Base Protocol.j ava:664)
at org.apache.tomcat.util.net .PoolTcpEn dpoint.pro cessSocket (PoolTcpEn dpoint.jav a:527)
at org.apache.tomcat.util.net .MasterSla veWorkerTh read.run(M asterSlave WorkerThre ad.java:11 2)
at java.lang.Thread.run(Threa d.java:595 )
Browser error
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperEx ception: Listener refused the connection with the following error:
ORA-12519, TNS:no appropriate service handler found
The Connection descriptor used by the client was:
10.0.0.67:1521:XE
org.apache.jasper.servlet. JspServlet Wrapper.ha ndleJspExc eption(Jsp ServletWra pper.java: 510)
org.apache.jasper.servlet. JspServlet Wrapper.se rvice(JspS ervletWrap per.java:3 75)
org.apache.jasper.servlet. JspServlet .serviceJs pFile(JspS ervlet.jav a:314)
org.apache.jasper.servlet. JspServlet .service(J spServlet. java:264)
javax.servlet.http.HttpSer vlet.servi ce(HttpSer vlet.java: 810)
org.jboss.web.tomcat.filte rs.ReplyHe aderFilter .doFilter( ReplyHeade rFilter.ja va:96)
root cause
javax.servlet.ServletExcep tion: Listener refused the connection with the following error:
ORA-12519, TNS:no appropriate service handler found
The Connection descriptor used by the client was:
10.0.0.67:1521:XE
org.apache.jasper.runtime. PageContex tImpl.doHa ndlePageEx ception(Pa geContextI mpl.java:8 58)
org.apache.jasper.runtime. PageContex tImpl.hand lePageExce ption(Page ContextImp l.java:791 )
org.apache.jsp.jsp.templat eView_jsp. _jspServic e(template View_jsp.j ava:305)
org.apache.jasper.runtime. HttpJspBas e.service( HttpJspBas e.java:97)
javax.servlet.http.HttpSer vlet.servi ce(HttpSer vlet.java: 810)
org.apache.jasper.servlet. JspServlet Wrapper.se rvice(JspS ervletWrap per.java:3 32)
org.apache.jasper.servlet. JspServlet .serviceJs pFile(JspS ervlet.jav a:314)
org.apache.jasper.servlet. JspServlet .service(J spServlet. java:264)
javax.servlet.http.HttpSer vlet.servi ce(HttpSer vlet.java: 810)
org.jboss.web.tomcat.filte rs.ReplyHe aderFilter .doFilter( ReplyHeade rFilter.ja va:96)
root cause
java.sql.SQLException: Listener refused the connection with the following error:
ORA-12519, TNS:no appropriate service handler found
The Connection descriptor used by the client was:
10.0.0.67:1521:XE
oracle.jdbc.driver.Databas eError.thr owSqlExcep tion(Datab aseError.j ava:112)
oracle.jdbc.driver.Databas eError.thr owSqlExcep tion(Datab aseError.j ava:261)
oracle.jdbc.driver.T4CConn ection.log on(T4CConn ection.jav a:387)
oracle.jdbc.driver.Physica lConnectio n.<init>(P hysicalCon nection.ja va:420)
oracle.jdbc.driver.T4CConn ection.<in it>(T4CCon nection.ja va:165)
oracle.jdbc.driver.T4CDriv erExtensio n.getConne ction(T4CD riverExten sion.java: 35)
oracle.jdbc.driver.OracleD river.conn ect(Oracle Driver.jav a:801)
java.sql.DriverManager.get Connection (DriverMan ager.java: 525)
java.sql.DriverManager.get Connection (DriverMan ager.java: 171)
org.apache.jsp.jsp.templat eView_jsp. _jspServic e(template View_jsp.j ava:65)
org.apache.jasper.runtime. HttpJspBas e.service( HttpJspBas e.java:97)
javax.servlet.http.HttpSer vlet.servi ce(HttpSer vlet.java: 810)
org.apache.jasper.servlet. JspServlet Wrapper.se rvice(JspS ervletWrap per.java:3 32)
org.apache.jasper.servlet. JspServlet .serviceJs pFile(JspS ervlet.jav a:314)
org.apache.jasper.servlet. JspServlet .service(J spServlet. java:264)
javax.servlet.http.HttpSer vlet.servi ce(HttpSer vlet.java: 810)
org.jboss.web.tomcat.filte rs.ReplyHe aderFilter .doFilter( ReplyHeade rFilter.ja va:96)
note The full stack trace of the root cause is available in the Apache Tomcat/5.5.17 logs.
Any help is appreciated.
Regards,
at oracle.jdbc.driver.Databas
at oracle.jdbc.driver.Databas
at oracle.jdbc.driver.T4CConn
at oracle.jdbc.driver.Physica
at oracle.jdbc.driver.T4CConn
at oracle.jdbc.driver.T4CDriv
at oracle.jdbc.driver.OracleD
at java.sql.DriverManager.get
at java.sql.DriverManager.get
at org.apache.jsp.jsp.templat
at org.apache.jasper.runtime.
at javax.servlet.http.HttpSer
at org.apache.jasper.servlet.
at org.apache.jasper.servlet.
at org.apache.jasper.servlet.
at javax.servlet.http.HttpSer
at org.apache.catalina.core.A
at org.apache.catalina.core.A
at org.jboss.web.tomcat.filte
at org.apache.catalina.core.A
at org.apache.catalina.core.A
at org.apache.catalina.core.S
at org.apache.catalina.core.S
at org.jboss.web.tomcat.secur
at org.jboss.web.tomcat.secur
at org.apache.catalina.core.S
at org.apache.catalina.valves
at org.apache.catalina.core.S
at org.apache.catalina.connec
at org.apache.coyote.http11.H
at org.apache.coyote.http11.H
at org.apache.tomcat.util.net
at org.apache.tomcat.util.net
at java.lang.Thread.run(Threa
Browser error
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperEx
ORA-12519, TNS:no appropriate service handler found
The Connection descriptor used by the client was:
10.0.0.67:1521:XE
org.apache.jasper.servlet.
org.apache.jasper.servlet.
org.apache.jasper.servlet.
org.apache.jasper.servlet.
javax.servlet.http.HttpSer
org.jboss.web.tomcat.filte
root cause
javax.servlet.ServletExcep
ORA-12519, TNS:no appropriate service handler found
The Connection descriptor used by the client was:
10.0.0.67:1521:XE
org.apache.jasper.runtime.
org.apache.jasper.runtime.
org.apache.jsp.jsp.templat
org.apache.jasper.runtime.
javax.servlet.http.HttpSer
org.apache.jasper.servlet.
org.apache.jasper.servlet.
org.apache.jasper.servlet.
javax.servlet.http.HttpSer
org.jboss.web.tomcat.filte
root cause
java.sql.SQLException: Listener refused the connection with the following error:
ORA-12519, TNS:no appropriate service handler found
The Connection descriptor used by the client was:
10.0.0.67:1521:XE
oracle.jdbc.driver.Databas
oracle.jdbc.driver.Databas
oracle.jdbc.driver.T4CConn
oracle.jdbc.driver.Physica
oracle.jdbc.driver.T4CConn
oracle.jdbc.driver.T4CDriv
oracle.jdbc.driver.OracleD
java.sql.DriverManager.get
java.sql.DriverManager.get
org.apache.jsp.jsp.templat
org.apache.jasper.runtime.
javax.servlet.http.HttpSer
org.apache.jasper.servlet.
org.apache.jasper.servlet.
org.apache.jasper.servlet.
javax.servlet.http.HttpSer
org.jboss.web.tomcat.filte
note The full stack trace of the root cause is available in the Apache Tomcat/5.5.17 logs.
Any help is appreciated.
Regards,
It looks like the exception is being thrown during the process of logging on to to the database, so check (and doblecheck) that a valid set of credentials is being used to perform the log on., and that the users have 'connect' access to the schema that they are trying to connect to.
What type of driver are you using? Are you using a Type IV thin driver?
ASKER
Hii Daveyess,
We are using ojdbc14.jar driver for oracle 10g.
Any help is appreciated.
Regards,
We are using ojdbc14.jar driver for oracle 10g.
Any help is appreciated.
Regards,
Change the username and/or password that you use to connect to the DB to an invalid one. Do you get a different exception?
ASKER
Hi,
As suggested above, we have checked the settings, username/password, jsbc driver, etc. Ever thought everything seems to be in place, we still have this problem.
Regards,
As suggested above, we have checked the settings, username/password, jsbc driver, etc. Ever thought everything seems to be in place, we still have this problem.
Regards,
ASKER
If I change the "PROCESSES" setting on the oracle database server, it minimizes the frequency of the error. However, it does not stop from happening.
I used the following command to do so:
ALTER SYSTEM SET PROCESSES=250 SCOPE=SPFILE
I believe by increasing the value of PROCESSES it would further minimize it however, I'm concerned about any impact it would have on the database server.
Any suggestions
Regards,
I used the following command to do so:
ALTER SYSTEM SET PROCESSES=250 SCOPE=SPFILE
I believe by increasing the value of PROCESSES it would further minimize it however, I'm concerned about any impact it would have on the database server.
Any suggestions
Regards,
Any advance on this problem? I have encountered the same issue with JBoss 4.0.4.GA and an Oracle RAC on our production environment only. Have tried adding connection checking to the oracle-xa-ds.xml config with no change, and I added min-pool-size to 5, and now the error changes to below:
10:14:21,022 INFO [ConnectionFactoryBindingS ervice] Bound ConnectionManager 'jboss.jca:service=DataSou rceBinding ,name=XAOr acleDS' to JNDI name 'java:XAOracleDS'
10:14:21,937 WARN [JBossManagedConnectionPoo l] Unable to fill pool
org.jboss.resource.JBossRe sourceExce ption: Could not create connection; - nested throwable: (java.sql.SQLException: Io exception: Socket is not connected)
at org.jboss.resource.adapter .jdbc.xa.X AManagedCo nnectionFa ctory.crea teManagedC onnection( XAManagedC onnectionF actory.jav a:153)
at org.jboss.resource.connect ionmanager .InternalM anagedConn ectionPool .createCon nectionEve ntListener (InternalM anagedConn ectionPool .java:539)
at org.jboss.resource.connect ionmanager .InternalM anagedConn ectionPool .fillToMin (InternalM anagedConn ectionPool .java:486)
at org.jboss.resource.connect ionmanager .PoolFille r.run(Pool Filler.jav a:74)
at java.lang.Thread.run(Threa d.java:595 )
Caused by: java.sql.SQLException: Io exception: Socket is not connected
at oracle.jdbc.driver.Databas eError.thr owSqlExcep tion(Datab aseError.j ava:112)
at oracle.jdbc.driver.Databas eError.thr owSqlExcep tion(Datab aseError.j ava:146)
at oracle.jdbc.driver.Databas eError.thr owSqlExcep tion(Datab aseError.j ava:255)
at oracle.jdbc.driver.T4CConn ection.log on(T4CConn ection.jav a:387)
at oracle.jdbc.driver.Physica lConnectio n.<init>(P hysicalCon nection.ja va:420)
at oracle.jdbc.driver.T4CConn ection.<in it>(T4CCon nection.ja va:165)
at oracle.jdbc.driver.T4CDriv erExtensio n.getConne ction(T4CD riverExten sion.java: 35)
at oracle.jdbc.driver.OracleD river.conn ect(Oracle Driver.jav a:801)
at oracle.jdbc.pool.OracleDat aSource.ge tPhysicalC onnection( OracleData Source.jav a:297)
at oracle.jdbc.xa.client.Orac leXADataSo urce.getPo oledConnec tion(Oracl eXADataSou rce.java:4 72)
at oracle.jdbc.xa.client.Orac leXADataSo urce.getXA Connection (OracleXAD ataSource. java:159)
at oracle.jdbc.xa.client.Orac leXADataSo urce.getXA Connection (OracleXAD ataSource. java:133)
at org.jboss.resource.adapter .jdbc.xa.X AManagedCo nnectionFa ctory.crea teManagedC onnection( XAManagedC onnectionF actory.jav a:145)
... 4 more
10:14:21,022 INFO [ConnectionFactoryBindingS
10:14:21,937 WARN [JBossManagedConnectionPoo
org.jboss.resource.JBossRe
at org.jboss.resource.adapter
at org.jboss.resource.connect
at org.jboss.resource.connect
at org.jboss.resource.connect
at java.lang.Thread.run(Threa
Caused by: java.sql.SQLException: Io exception: Socket is not connected
at oracle.jdbc.driver.Databas
at oracle.jdbc.driver.Databas
at oracle.jdbc.driver.Databas
at oracle.jdbc.driver.T4CConn
at oracle.jdbc.driver.Physica
at oracle.jdbc.driver.T4CConn
at oracle.jdbc.driver.T4CDriv
at oracle.jdbc.driver.OracleD
at oracle.jdbc.pool.OracleDat
at oracle.jdbc.xa.client.Orac
at oracle.jdbc.xa.client.Orac
at oracle.jdbc.xa.client.Orac
at org.jboss.resource.adapter
... 4 more
ashishanand - Did you get this issue resolved?
ASKER
Yes, I was able to solve the problem, I used the following command to do so:
ALTER SYSTEM SET PROCESSES=250 SCOPE=SPFILE
After making the able changes, if you still get the error, I would suggest you further increase the PROCESSES to 500 or 1000 and see if it helps.
I initially set the PROCESSES to 250 and the error became less frequent. Next I changed it to 500 and after that I did not encounter any error.
PS:
I believe by increasing the value of PROCESSES it would further minimize it however, I'm concerned about any impact it would have on the database server's performance.
Any one, any comments.
Regards,
ALTER SYSTEM SET PROCESSES=250 SCOPE=SPFILE
After making the able changes, if you still get the error, I would suggest you further increase the PROCESSES to 500 or 1000 and see if it helps.
I initially set the PROCESSES to 250 and the error became less frequent. Next I changed it to 500 and after that I did not encounter any error.
PS:
I believe by increasing the value of PROCESSES it would further minimize it however, I'm concerned about any impact it would have on the database server's performance.
Any one, any comments.
Regards,
It looks like this is probably the fix for the problem.
I believe that you are getting the error about being unable to fill the connection pool if Oracle cannot provide enough connections to service all the applications connected to it - not just JBoss.
So, when you increased the number of processes to 250 the problem initially vanished. I would guess that there are other users/applications using your Oracle server and the total number of connections exceeded 250. When a connection was then thrown out of the JBoss pool and JBoss tried to acquire another connection, it failed with the reported error message.
Given that you ar erunning Oracle 10 Express, its probably worth checking the oracle documentation to see how many process it can handle for a given server configuration. Also, make sure that your min and max pool sizes in JBoss are reasonable. Depending on the size of the application, a small pool size of about 10 may suffice.
I believe that you are getting the error about being unable to fill the connection pool if Oracle cannot provide enough connections to service all the applications connected to it - not just JBoss.
So, when you increased the number of processes to 250 the problem initially vanished. I would guess that there are other users/applications using your Oracle server and the total number of connections exceeded 250. When a connection was then thrown out of the JBoss pool and JBoss tried to acquire another connection, it failed with the reported error message.
Given that you ar erunning Oracle 10 Express, its probably worth checking the oracle documentation to see how many process it can handle for a given server configuration. Also, make sure that your min and max pool sizes in JBoss are reasonable. Depending on the size of the application, a small pool size of about 10 may suffice.
Max pool size is 20 on 2 JBoss servers in my cluster and our Oracle RAC PROCESSES are set to 500, with only about 12 used.
The socket connection error still occurs, randomly but too frequently for a production environment. Any more ideas?
Regards...
The socket connection error still occurs, randomly but too frequently for a production environment. Any more ideas?
Regards...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Keep all dependency jar files in the classpath, like database jars etc...
make sure all the settings are setup properly, restart the server(s), and test it.
R.K