Jboss - "Unable to get managed connection for java: / AppDS"

4

The following exceptions are occurring in my application:

10:52:34,506 ERROR [br.com.app.dao.NotificacaoDAO] (http--0.0.0.0-8080-77) java.sql.SQLException: javax.resource.ResourceException: IJ000453: Unable to get managed connection for java:/AppDS
10:52:34,509 ERROR [br.com.app.dao.UsuarioDAO] (http--0.0.0.0-8080-55) java.sql.SQLException: javax.resource.ResourceException: IJ000453: Unable to get managed connection for java:/AppDS
10:52:34,513 ERROR [br.com.app.business.NotificacaoBS] (http--0.0.0.0-8080-77) br.com.app.exceptions.DAOException: java.sql.SQLException: javax.resource.ResourceException: IJ000453: Unable to get managed connection for java:/AppDS
10:52:34,513 ERROR [br.com.app.dao.MensagemDAO] (http--0.0.0.0-8080-6) java.sql.SQLException: javax.resource.ResourceException: IJ000453: Unable to get managed connection for java:/AppDS
10:52:34,520 ERROR [br.com.app.business.MensagemBS] (http--0.0.0.0-8080-6) br.com.app.exceptions.DAOException: java.sql.SQLException: javax.resource.ResourceException: IJ000453: Unable to get managed connection for java:/AppDS
10:52:34,522 ERROR [br.com.app.controller.serversent.ListarNovasNotificacoesController] (http--0.0.0.0-8080-77) br.com.app.exceptions.BusinessException: br.com.app.exceptions.DAOException: java.sql.SQLException: javax.resource.ResourceException: IJ000453: Unable to get managed connection for java:/AppDS
10:52:34,512 ERROR [br.com.app.business.UsuarioBS] (http--0.0.0.0-8080-55) br.com.app.exceptions.DAOException: java.sql.SQLException: javax.resource.ResourceException: IJ000453: Unable to get managed connection for java:/AppDS
10:52:34,530 ERROR [br.com.app.services.UsuarioService] (http--0.0.0.0-8080-55) br.com.app.exceptions.BusinessException: br.com.app.exceptions.DAOException: java.sql.SQLException: javax.resource.ResourceException: IJ000453: Unable to get managed connection for java:/AppDS
10:52:34,534 ERROR [br.com.app.controller.serversent.ListarNovasMensagensController] (http--0.0.0.0-8080-6) br.com.app.exceptions.BusinessException: br.com.app.exceptions.DAOException: java.sql.SQLException: javax.resource.ResourceException: IJ000453: Unable to get managed connection for java:/AppDS
10:52:34,585 ERROR [br.com.app.dao.UsuarioDAO] (http--0.0.0.0-8080-66) java.sql.SQLException: javax.resource.ResourceException: IJ000453: Unable to get managed connection for java:/AppDS

In one minute she fired several exceptions like this / \

It always happens about 5 days after starting the application and it stays 24 hours online.

I already researched, but I did not really find the problem, maybe it could be some open connection, but I close all the connections.

Does anyone know why?

Note: I use JBOSS 7.1.1

    
asked by anonymous 22.02.2014 / 00:53

2 answers

3

The most common cause for this type of error is that the bank no longer has connections to distribute. If you are releasing connections after use, it may be that some other part of your program or component is opening connections.

It can be a loading problem too. You may have to configure the database to support more open connections at the same time. But as you say that the problem occurs after some time, it seems cumulative.

What you can do to solve the problem is to check how many connections are open (and even monitor this, if necessary). This can be done by JBoss CLI or through monitoring tools. They will not fix the problem but will show you a connection leak and give you resources to try to fix the problem.

Here is information on how to get datasources statistics through the JBoss CLI (command line interface):

It will return various properties that you can use to find out what is happening. See the values that are in these here:

  • "ActiveCount" = > "50" - Total connections available and active in the moment
  • "AvailableCount" = > "50" - Total connections available for use
  • "CreatedCount" = > "30" - Total new connections created
  • "DestroyedCount" = > "0" - Total connections destroyed
  • "MaxUsedCount" = > "50" - Total connections used
  • Here are some examples of monitoring datasets data in JBoss: link

        
    23.02.2014 / 16:17
    0

    Friend, as the stacktrace itself says ... it was a mistake to make a "java: / AppDS" lookup within your NotificationData class. You probably have something like this: (you did not clarify the details very well)

    public class NotificacaoDAO {
    
    @Resource(lookup = "java:/AppDS")
    private Datasource ds
    
    ...
    }
    

    Defining the JNDI address in the JBoss case advises the default segunite (For Datasources):

    java:jboss/datasources/MEU_DS
    
    What happens is also that this DS is not properly registered OR you do not have the driver installed correctly: At DOCUMENTATION this process is clear.

        
    23.05.2014 / 18:45