Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

I am getting this error suddenly.Till now the application was working fine from sterday i am getting this error java.sql.SQLException: Closed Connection

Posted on 2006-10-31
5
Medium Priority
?
326 Views
Last Modified: 2008-02-01
Hi ,

  I was testing my application in the cluster environment and it was working fine for 1 hr and suddenly i got the following error please help me out

2006-10-30 20:25:51,927 ERROR [com.carrier.arm.common.utils.JDBCUtil] Closed Connection
com.carrier.arm.common.exceptions.ARMException: java.sql.SQLException: Closed Connection
      at com.carrier.arm.common.utils.JDBCUtil.getPreparedStatement(JDBCUtil.java:560)
      at com.carrier.arm.common.utils.JDBCUtil.executeQuery(JDBCUtil.java:695)
      at com.carrier.arm.common.utils.JDBCUtil.executeQuery(JDBCUtil.java:668)
      at com.carrier.arm.integration.dataaccess.common.MasterDAO.getUserContext(MasterDAO.java:100)
      at com.carrier.arm.business.common.ejb.MasterSBean.getUserContext(MasterSBean.java:88)
      at com.carrier.arm.business.common.ejb.MasterSBean_k8fmao_EOImpl.getUserContext(MasterSBean_k8fmao_EOImpl.java:260)
      at com.carrier.arm.business.sessionfacade.MasterSFacade.getUserContext(MasterSFacade.java:390)
      at com.carrier.arm.business.sessionfacade.MasterSFacade_xj4o2o_EOImpl.getUserContext(MasterSFacade_xj4o2o_EOImpl.java:424)
      at com.carrier.arm.client.bd.MasterBD.getUserContext(MasterBD.java:315)
      at com.carrier.arm.client.web.actions.LoginAction.armexecute(LoginAction.java:405)
      at com.carrier.arm.client.web.actions.ARMBaseAction.execute(ARMBaseAction.java:100)
      at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)
      at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
      at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
      at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1072)
      at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:465)
      at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:28)
      at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
      at com.carrier.arm.client.web.actions.common.filterAction.doFilter(filterAction.java:63)
      at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
      at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6987)
      at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
      at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
      at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3892)
      at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2766)
      at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224)
      at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183)
Caused by: java.sql.SQLException: Closed Connection
      at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
      at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:162)
      at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:227)
      at oracle.jdbc.driver.PhysicalConnection.prepareStatement(PhysicalConnection.java:735)
      at oracle.jdbc.driver.PhysicalConnection.prepareStatement(PhysicalConnection.java:652)
      at weblogic.jdbc.common.internal.ConnectionEnv.makeStatement(ConnectionEnv.java:1206)
      at weblogic.jdbc.common.internal.ConnectionEnv.getCachedStatement(ConnectionEnv.java:994)
      at weblogic.jdbc.common.internal.ConnectionEnv.getCachedStatement(ConnectionEnv.java:933)
      at weblogic.jdbc.wrapper.Connection.prepareStatement(Connection.java:359)
      at com.carrier.arm.common.utils.JDBCUtil.getPreparedStatement(JDBCUtil.java:553)
      ... 29 more


Thanks
0
Comment
Question by:gocoool
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 24

Accepted Solution

by:
sciuriware earned 1000 total points
ID: 17842132
Is your server still up and running?
Then is the server process on the server still running?

If possible you might reboot the server machine.

..... unless it's just a loose cable ......

;JOOP!
0
 
LVL 9

Expert Comment

by:owenli27
ID: 17842411
- Check your database server to see if any problems happened

- Exception thrown from JDBCUtil.java Line 560; There is a line code, something like  conn.prepareStatement()
The DB connection also could be closed by code in some line. So, you can add a couple of line code before it
if (conn == null || conn.isClosed())
    conn = JDBCUtil.getConnection....to reconnect database.
0
 
LVL 9

Assisted Solution

by:owenli27
owenli27 earned 1000 total points
ID: 17842620
Also, DB connection could be dropped by timeout
0
 

Author Comment

by:gocoool
ID: 17845796
Thanks a lot guys...

  I restarted the server and it is working fine till now.. I also think tht it may be dropped out by the timeout....But when i restarted the server it worked fine...


Thanks

0
 
LVL 24

Expert Comment

by:sciuriware
ID: 17847762
:)
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
The viewer will learn how to implement Singleton Design Pattern in Java.
Suggested Courses

661 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question