Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Reason for java.sql.SQLException: Attempting to obtain a connection from a pool that has already been shutdown

Posted on 2014-03-05
2
Medium Priority
?
1,360 Views
Last Modified: 2014-04-10
We have a Java program that uses a PostgreSQL database. At a customer site we received the following exception, and so far couldn't understand whats' the cause. We are looking for ideas about possible causes for this exception.

com.venotion.serviceware.core.exceptions.ServiceWareException: 2: [Error accessing the database] Error accessing the database
      at com.venotion.serviceware.core.DatabaseUtilities.a(SourceFile:139)
...
Caused by: java.sql.SQLException: Attempting to obtain a connection from a pool that has already been shutdown.
Stack trace of location where pool was shutdown follows:
 java.lang.Thread.getStackTrace(Thread.java:1479)
 com.jolbox.bonecp.BoneCP.captureStackTrace(BoneCP.java:543)
 com.jolbox.bonecp.BoneCP.shutdown(BoneCP.java:159)
 com.venotion.serviceware.core.DatabaseUtilities.c(SourceFile:167)
 com.venotion.serviceware.core.DatabaseUtilities.a(SourceFile:126)
 com.vnt.aK.s(SourceFile:51)
 com.venotion.serviceware.apm.D.a(SourceFile:319)
 com.venotion.serviceware.apm.tracers.e.a(SourceFile:38)
 com.venotion.serviceware.apm.tracers.n.a(SourceFile:140)
 com.venotion.serviceware.apm.tracers.n.<init>(SourceFile:115)
 com.venotion.serviceware.apm.tracers.e.<init>(SourceFile:27)
 com.venotion.serviceware.apm.tracers.n.a(SourceFile:67)
 com.venotion.serviceware.apm.D.a(SourceFile:190)
 com.venotion.serviceware.apm.D.d(SourceFile:638)
 com.venotion.serviceware.abm.Application.B(SourceFile:962)
 com.vnt.I.b(SourceFile:70)
 com.venotion.serviceware.architect.ui.components.EntityTreeCellRenderer.getTreeCellRendererComponent(SourceFile:42)
 javax.swing.plaf.basic.BasicTreeUI.paintRow(BasicTreeUI.java:1491)
 javax.swing.plaf.basic.BasicTreeUI.paint(BasicTreeUI.java:1203)
 javax.swing.plaf.ComponentUI.update(ComponentUI.java:143)
 javax.swing.JComponent.paintComponent(JComponent.java:760)
 javax.swing.JComponent.paint(JComponent.java:1037)
 javax.swing.JComponent.paintChildren(JComponent.java:870)
 javax.swing.JComponent.paint(JComponent.java:1046)
 javax.swing.JViewport.paint(JViewport.java:752)
 javax.swing.JComponent.paintChildren(JComponent.java:870)
 javax.swing.JComponent.paint(JComponent.java:1046)
 javax.swing.JComponent.paintChildren(JComponent.java:870)
 javax.swing.JComponent.paint(JComponent.java:1046)
 javax.swing.JComponent.paintChildren(JComponent.java:870)
 javax.swing.JComponent.paint(JComponent.java:1046)
 javax.swing.JComponent.paintChildren(JComponent.java:870)
 javax.swing.JSplitPane.paintChildren(JSplitPane.java:1030)
 javax.swing.JComponent.paint(JComponent.java:1046)
 javax.swing.JComponent.paintChildren(JComponent.java:870)
 javax.swing.JComponent.paint(JComponent.java:1046)
 javax.swing.JComponent.paintChildren(JComponent.java:870)
 javax.swing.JComponent.paint(JComponent.java:1046)
 javax.swing.JComponent.paintChildren(JComponent.java:870)
 javax.swing.JSplitPane.paintChildren(JSplitPane.java:1030)
 javax.swing.JComponent.paint(JComponent.java:1046)
 javax.swing.JComponent.paintChildren(JComponent.java:870)
 javax.swing.JComponent.paint(JComponent.java:1046)
 javax.swing.JComponent.paintChildren(JComponent.java:870)
 javax.swing.JComponent.paint(JComponent.java:1046)
 javax.swing.JLayeredPane.paint(JLayeredPane.java:567)
 javax.swing.JComponent.paintChildren(JComponent.java:870)
 javax.swing.JComponent.paintToOffscreen(JComponent.java:5139)
 javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(RepaintManager.java:1523)
 javax.swing.RepaintManager$PaintManager.paint(RepaintManager.java:1454)
 javax.swing.RepaintManager.paint(RepaintManager.java:1257)
 javax.swing.JComponent.paint(JComponent.java:1023)
 java.awt.GraphicsCallback$PaintCallback.run(GraphicsCallback.java:21)
 sun.awt.SunGraphicsCallback.runOneComponent(SunGraphicsCallback.java:60)
 sun.awt.SunGraphicsCallback.runComponents(SunGraphicsCallback.java:97)
 java.awt.Container.paint(Container.java:1778)
 java.awt.Window.paint(Window.java:3390)
 javax.swing.RepaintManager$3.run(RepaintManager.java:825)
 javax.swing.RepaintManager$3.run(RepaintManager.java:802)
 java.security.AccessController.doPrivileged(Native Method)
 java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
 javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:802)
 javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:745)
 javax.swing.RepaintManager.prePaintDirtyRegions(RepaintManager.java:725)
 javax.swing.RepaintManager.access$1000(RepaintManager.java:46)
 javax.swing.RepaintManager$ProcessingRunnable.run(RepaintManager.java:1668)
 java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
 java.awt.EventQueue.dispatchEventImpl(EventQueue.java:672)
 java.awt.EventQueue.access$400(EventQueue.java:81)
 java.awt.EventQueue$2.run(EventQueue.java:633)
 java.awt.EventQueue$2.run(EventQueue.java:631)
 java.security.AccessController.doPrivileged(Native Method)
 java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
 java.awt.EventQueue.dispatchEvent(EventQueue.java:642)
 java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
 java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
 java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
 java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
 java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
 java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

      at com.jolbox.bonecp.BoneCP.getConnection(BoneCP.java:467)
      at com.venotion.serviceware.core.DatabaseUtilities.a(SourceFile:119)
      ... 5 more
0
Comment
Question by:Miritm
[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 Comments
 
LVL 21

Expert Comment

by:Amitkumar Panchal
ID: 39907076
Check your codebase. Somewhere the connection might be closed manually rather than putting it back to the pool.
0
 
LVL 16

Accepted Solution

by:
Valeri earned 1500 total points
ID: 39908625
in SourceFile line:119 (com.venotion.serviceware.core.DatabaseUtilities.a) you are trying to get connection to db, but before that at line 167 (com.venotion.serviceware.core.DatabaseUtilities.c) you shutdown the pool of connections.
Connection pool shouldn't be shutdown!
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

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 learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Suggested Courses

636 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