<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">
<div>
<table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
<tbody>
<tr>
<td>
<table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
<tbody>
<tr>
<td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
<h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
<!-- To have a header image/logo replace the name below with your img tag -->
<!-- Email clients will render the images when the message is read so any image -->
<!-- must be made available on a public server, so that all recipients can load the image. -->
<a href="https://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
</td>
</tr>
<tr>
<td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px; -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
Jackrabbit shows 'Destroying connection that could not successfully matched' warnings and runs out of connections
</h3>
<span style="margin-bottom: 10px;">
created by <a href="https://community.jboss.org/people/mabako">Marcus Bauer</a> in <i>IronJacamar</i> - <a href="https://community.jboss.org/message/782996#782996">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">
<div class="jive-rendered-content"><p>Hey,</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>I've recently written a small application which's storing things in the Content Repository provided by JackRabbit. Since I ran into the bug described in <a class="jive-link-external-small" href="https://issues.apache.org/jira/browse/JCR-3425">JCR-3425</a>, I'm using a recent 2.6-SNAPSHOT release built directly from source, deployed as *.rar. The whole thing runs on JBoss AS 7.1.1.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>My code is the following, with exception handling stripped:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><pre class="jive-pre"><code class="jive-code jive-java">Repository repo = (Repository) <font color="navy"><b>new</b></font> InitialContext().lookup(<font color="red">"java:/project/jcr"</font>);
Session session = repo.login(<font color="navy"><b>new</b></font> SimpleCredentials(user, <font color="red">"*"</font>.toCharArray()));
 
Node dir = session.getRootNode();
doSomethingWithTheInputStream(dir.getNode(...).getNode(Property.JCR_CONTENT).getProperty(Property.JCR_DATA).getBinary().getStream());
 
session.logout();
</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Upon calling session.logout, the following message appears in my log file whatsoever:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><pre class="jive-pre"><code class="jive-code">09:10:00,701 WARN  [org.jboss.jca.core.connectionmanager.pool.strategy.OnePool] (http--127.0.0.1-8000-14) IJ000612: Destroying connection that could not be successfully matched: org.jboss.jca.core.connectionmanager.listener.TxConnectionListener@6710ee[state=NORMAL managed connection=org.apache.jackrabbit.jca.JCAManagedConnection@13ccdd8 connection handles=0 lastUse=1355299797231 trackByTx=false pool=org.jboss.jca.core.connectionmanager.pool.strategy.OnePool@1b24dbd pool internal context=SemaphoreArrayListManagedConnectionPool@6afb99[pool=jackrabbit-jca-pool] xaResource=XAResourceWrapperImpl@ee436b[xaResource=session-anonym-148 pad=false overrideRmValue=false productName=Jackrabbit productVersion=2.6-SNAPSHOT jndiName=java:/themis/jcr] txSync=null
</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>And eventually, the following (may or may not have to do with how many connections I open) problem occurs.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><pre class="jive-pre"><code class="jive-code">09:11:37,141 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/project].[Faces Servlet]] (http--127.0.0.1-8000-14) Servlet.service() for servlet Faces Servlet threw exception: javax.resource.ResourceException: IJ000655: No managed connections available within configured blocking timeout (30000 [ms])
          at org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreArrayListManagedConnectionPool.getConnection(SemaphoreArrayListManagedConnectionPool.java:377)
          at org.jboss.jca.core.connectionmanager.pool.AbstractPool.getSimpleConnection(AbstractPool.java:397)
          at org.jboss.jca.core.connectionmanager.pool.AbstractPool.getConnection(AbstractPool.java:365)
          at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.getManagedConnection(AbstractConnectionManager.java:329)
          at org.jboss.jca.core.connectionmanager.tx.TxConnectionManagerImpl.getManagedConnection(TxConnectionManagerImpl.java:368)
          at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.allocateConnection(AbstractConnectionManager.java:464)
          at org.apache.jackrabbit.jca.JCARepositoryHandle.login(JCARepositoryHandle.java:75)
          at org.apache.jackrabbit.commons.AbstractRepository.login(AbstractRepository.java:123)
</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><strong>Is there any way to avoid aforementioned warnings/exception?</strong></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>The Jackrabbit resource adapter is configured as follows:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><pre class="jive-pre"><code class="jive-code jive-xml">         <span class="jive-xml-tag"><subsystem xmlns="urn:jboss:domain:jca:1.1"></span>
            <span class="jive-xml-tag"><archive-validation enabled="false" fail-on-error="true" fail-on-warn="false"/></span>
            <span class="jive-xml-tag"><bean-validation enabled="true"/></span>
            <span class="jive-xml-tag"><default-workmanager></span>
                <span class="jive-xml-tag"><short-running-threads></span>
                    <span class="jive-xml-tag"><core-threads count="50"/></span>
                    <span class="jive-xml-tag"><queue-length count="50"/></span>
                    <span class="jive-xml-tag"><max-threads count="50"/></span>
                    <span class="jive-xml-tag"><keepalive-time time="10" unit="seconds"/></span>
                <span class="jive-xml-tag"></short-running-threads></span>
                <span class="jive-xml-tag"><long-running-threads></span>
                    <span class="jive-xml-tag"><core-threads count="50"/></span>
                    <span class="jive-xml-tag"><queue-length count="50"/></span>
                    <span class="jive-xml-tag"><max-threads count="50"/></span>
                    <span class="jive-xml-tag"><keepalive-time time="10" unit="seconds"/></span>
                <span class="jive-xml-tag"></long-running-threads></span>
            <span class="jive-xml-tag"></default-workmanager></span>
            <span class="jive-xml-tag"><cached-connection-manager debug="false" error="false"/></span>
        <span class="jive-xml-tag"></subsystem></span>
          <span class="jive-xml-tag"><subsystem xmlns="urn:jboss:domain:resource-adapters:1.0"></span>
            <span class="jive-xml-tag"><resource-adapters></span>
                <span class="jive-xml-tag"><resource-adapter></span>
                    <span class="jive-xml-tag"><archive></span>
                        jackrabbit-jca-2.6-SNAPSHOT.rar
                    <span class="jive-xml-tag"></archive></span>
                    <span class="jive-xml-tag"><transaction-support></span>XATransaction<span class="jive-xml-tag"></transaction-support></span>
                    <span class="jive-xml-tag"><connection-definitions></span>
                        <span class="jive-xml-tag"><connection-definition class-name="org.apache.jackrabbit.jca.JCAManagedConnectionFactory" jndi-name="java:/project/jcr" enabled="true" use-java-context="true" pool-name="jackrabbit-jca-pool" use-ccm="true"></span>
                            <span class="jive-xml-tag"><config-property name="ConfigFile"></span>
                                ${jboss.server.config.dir}${/}jackrabbit.xml
                            <span class="jive-xml-tag"></config-property></span>
                            <span class="jive-xml-tag"><config-property name="BindSessionToTransaction"></span>
                                false
                            <span class="jive-xml-tag"></config-property></span>
                            <span class="jive-xml-tag"><config-property name="HomeDir"></span>
                                ${jboss.server.data.dir}${/}jackrabbit${/}
                            <span class="jive-xml-tag"></config-property></span>
                        <span class="jive-xml-tag"></connection-definition></span>
                    <span class="jive-xml-tag"></connection-definitions></span>
                <span class="jive-xml-tag"></resource-adapter></span>
            <span class="jive-xml-tag"></resource-adapters></span>
        <span class="jive-xml-tag"></subsystem></span>
</code></pre></div>
<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
<p style="margin: 0;">Reply to this message by <a href="https://community.jboss.org/message/782996#782996">going to Community</a></p>
<p style="margin: 0;">Start a new discussion in IronJacamar at <a href="https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2098">Community</a></p>
</div></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>