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
1,148 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
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 500 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 is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
printing a file in reverse order is easy in recursion rather than in iteration 3 56
xampp tool 12 49
null output 3 25
What's wrong with this code? 4 23
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

770 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