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,165 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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Glassfish admin console not working 1 32
servlet and mdb, jms error 1 27
Java basic valueOf question 1 29
Eclipse Java import and method not resolved 4 43
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Many developers have database experience, but are new to PostgreSQL. It has some truly inspiring capabilities. I have several years' experience with Microsoft's SQL Server. When I began working with MySQL, I wanted a quick-reference to MySQL (htt…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Steps to create a PostgreSQL RDS instance in the Amazon cloud. We will cover some of the default settings and show how to connect to the instance once it is up and running.

765 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