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,103 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 20

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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
hash value 2 39
Increment alphanumeric sequence 6 81
changePi Challenge 15 77
create column from selection as interger in postgres 7 38
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

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

12 Experts available now in Live!

Get 1:1 Help Now