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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

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…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
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.

726 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