Search code examples
javajbossjackrabbit

"Destroying connection that could not be successfully matched"


I have an application that seems to work fine, but if I browse the log files I see a lot of these kind of errors:

2015-06-04 08:23:55,656 WARN  [org.jboss.resource.connectionmanager.InternalManagedConnectionPool] [DA366C7824A976BA8D1121A6E9A4F1C1.Node23] Destroying connection that could not be successfully matched: org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener@5d115719[state=NORMAL mc=org.apache.jackrabbit.jca.JCAManagedConnection@3aed875b handles=0 lastUse=1433398630770 permit=false trackByTx=false mcp=org.jboss.resource.connectionmanager.JBossManagedConnectionPool$OnePool@45ccbfb9 context=org.jboss.resource.connectionmanager.InternalManagedConnectionPool@53f2e7c xaResource=org.apache.jackrabbit.jca.TransactionBoundXAResource@40518596 txSync=null]

I am very curious what the error "Destroying connection that could not be successfully matched" exactly means. Google doesn't seem to help me too much on this one.

We work with JBoss 4.0.5.GA and JackRabbit 1.4 (I know it's old, but that's the way it is).


Solution

  • Just Googled and got the below link of 4.2 brancode

    Based on code, while retrieving connection from pool, first it checks

    1. Does it has managed Connection
      1a. if that has Managed Connection, it checks it is in good shape to return by doing matching algorithm.
      1b. if it found it is not in valid state ( not matched ) . it is destroy the Managed connection and create new connection ( or retrieve another Managed connection ) and return it.
    2. if it doesnt found any managed connection, create new connection and return it
    

    And this is Warning message from thier source code

     //Match did not succeed but no exception was thrown.
                         //Either we have the matching strategy wrong or the
                         //connection died while being checked.  We need to
                         //distinguish these cases, but for now we always
                         //destroy the connection.
                         log.warn("Destroying connection that could not be successfully matched: " + cl);
    

    At any case , have you overridden GWConnectionRequestInfo equals method ?

    Your application may work fine, but it is not effectively using connection pool, since it is destroying lot of managed connection due to different reason. i would analysis more and find reason behind why it is not matching

    Ad per thier comment , you connection may already closed / matching not working due to different reason.