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
318 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
  • 2
  • 2
5 Comments
 
LVL 24

Accepted Solution

by:
sciuriware earned 250 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 250 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

746 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now