[mule-user] Getting Exception while Retrieving Image from JCR using Mule

22 views
Skip to first unread message

HSI Singh

unread,
Jul 6, 2011, 10:48:09 AM7/6/11
to us...@mule.codehaus.org
Working with Mule Intgration with JCR. I am successfully able to store an image in JCR, while retrieving that image I am getting the below exception.
Kindly suggest.


********************************************************************************
Message : No ManagedConnections available within configured blocking timeout ( 30000 [ms] ) (javax.jcr.RepositoryException)
Code : MULE_ERROR--2
--------------------------------------------------------------------------------
Exception stack is:
1. No ManagedConnections available within configured blocking timeout ( 30000 [ms] ) (javax.resource.ResourceException)
org.jboss.resource.connectionmanager.InternalManagedConnectionPool:305 (http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/resource/ResourceException.html)
2. No ManagedConnections available within configured blocking timeout ( 30000 [ms] ) (javax.jcr.RepositoryException)
org.apache.jackrabbit.jca.JCARepositoryHandle:111 (http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/jcr/RepositoryException.html)
3. No ManagedConnections available within configured blocking timeout ( 30000 [ms] ) (javax.jcr.RepositoryException) (org.mule.transport.ConnectException)
org.mule.transport.AbstractTransportMessageHandler:308 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/transport/ConnectException.html)
--------------------------------------------------------------------------------
Root Exception stack trace:
javax.resource.ResourceException: No ManagedConnections available within configured blocking timeout ( 30000 [ms] )
at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPool.java:305)
at org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool.getConnection(JBossManagedConnectionPool.java:622)
at org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedConnection(BaseConnectionManager2.java:404)
+ 3 more (set debug level logging or '-Dmule.verbose.exceptions=true' for everything)
********************************************************************************

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


David Dossot

unread,
Jul 6, 2011, 11:45:17 AM7/6/11
to us...@mule.codehaus.org
Mule version? Configuration? Context? ie. is this problem happening under load? After a while? Immediately?

HSI Singh

unread,
Jul 7, 2011, 6:25:14 AM7/7/11
to us...@mule.codehaus.org
Sorry for not to mention version information earlier.

Mule version:- 3.1.1
Configuration :-

for datasource and Repository for JCR:-

<jee:jndi-lookup id="jcrRepository" jndi-name="jcr" />

<spring:bean id="jcrRepositoryInitializer"
class="<My Class name>"
init-method="initialize">
<spring:property name="repository" ref="jcrRepository"/>
<spring:property name="username" value="<userName>" />
<spring:property name="password" value="<password>" />
<spring:property name="rootNodeName" value="<rootNode>" />
</spring:bean>

<jcr:connector name="jcrConnector"
repository-ref="jcrRepository"
username="<userName>"
password="<password>"
workspaceName="default" />

<jcr:endpoint name="<jcrEndpoint>"
path="/userImages"
alwaysCreate="true"
nodeTypeName="nt:file"
exchange-pattern="request-response"
connector-ref="jcrConnector"
/>

<vm:endpoint name="<RetrieveEndPoint>"
path="<RetrievePath>"
exchange-pattern="request-response"
connector-ref="vmSync"/>

<servlet:endpoint name="<servletEndPoint>"
path="/jcr/retrieve" />
I am also getting an INFO message in JBOSS log :- [org.jboss.resource.connectionmanager.CachedConnectionManager] (http-127.0.0.1-8080-2) Could not find a close method on alleged connection objects. Please close your own connections.

I am using repository intializer example from org.mule.examples.jcr.documentprocessor.JcrRepositoryInitializer.
where we are doing session.save and session.logout in last lines, but where we are closing the session?

yes error is coming Immediately when i tried to retrieve any attachment (Image) via a HTTP post from this servlet.

David Dossot

unread,
Jul 7, 2011, 12:55:57 PM7/7/11
to us...@mule.codehaus.org
I am using repository intializer example from org.mule.examples.jcr.documentprocessor.JcrRepositoryInitializer.
where we are doing session.save and session.logout in last lines, but where we are closing the session?

This class, which btw is now named JcrContentLoader in the JCR transport for Mule 3, is really used only for integration testing. It's not production grade and may well miss some clean-up code.
 
yes error is coming Immediately when i tried to retrieve any attachment (Image) via a HTTP post from this servlet.

What I am thinking is the following: the JCR transport has never been tried with an application-server manager JCR container. Therefore it is possible that the way the transport works is not compatible with application-server managed JCR connections.

D.

HSI Singh

unread,
Jul 12, 2011, 8:45:38 AM7/12/11
to us...@mule.codehaus.org
If this is not the prorper approach to use it with Application server Manage transection container, then how can i take a proper approach for it. Kindly suggest.

After adding pooling parameter in my datasource configuration file, i am not getting this exception, because of min-pool makes the session objects at the time of starting the server, for now i have added this connection pool configuration in the data source file and i am not getting exception, but in the server log i am still getting log messsages:-

2011-07-11 17:28:40,538 WARN [org.jboss.resource.connectionmanager.JBossManagedConnectionPool] (http-127.0.0.1-8080-1) Destroying connection that could not be successfully matched: org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener@5be463[state=NORMAL mc=org.apache.jackrabbit.jca.JCAManagedConnection@ef5101 handles=0 lastUse=1310385395641 permit=false trackByTx=false mcp=org.jboss.resource.connectionmanager.JBossManagedConnectionPool$OnePool@1430830 context=org.jboss.resource.connectionmanager.InternalManagedConnectionPool@1cea8c9 xaResource=org.apache.jackrabbit.jca.TransactionBoundXAResource@1af31c0 txSync=null]

2011-07-11 17:29:49,705 INFO [org.jboss.resource.connectionmanager.CachedConnectionManager] (http-127.0.0.1-8080-1) Could not find a close method on alleged connection objects. Please close your own connections.

It means problem can be persist any time, Kindly suggest how can i change my approach, how should i intialized repository and work property on session object? Is my configuration wrong?

David Dossot

unread,
Jul 12, 2011, 1:50:13 PM7/12/11
to us...@mule.codehaus.org
You could configure JackRabbit with Spring beans.

In jcr-example-beans.xml, a transient repo is created:

<bean id="jcrRepository" class="org.apache.jackrabbit.core.TransientRepository" destroy-method="shutdown" />

You can try with such a config on your local workstation. But you will certainly need a persistent repo, configured much like that:

  <bean name="jcrConfiguration" class="org.apache.jackrabbit.core.config.RepositoryConfig" factory-method="create">
    <constructor-arg index="0" type="java.io.InputStream" value="classpath:repository.xml">
    <constructor-arg index="1" type="java.lang.String" value="/tmp/repository">
  </constructor-arg></constructor-arg></bean>

  <bean name="jcrRepository" factory-method="create" class="org.apache.jackrabbit.core.RepositoryImpl">
    <constructor-arg>
      <ref bean="jcrConfiguration" />
    </constructor-arg>
  </bean>

Refer to JackRabbit's doc for more info.

D.
Reply all
Reply to author
Forward
0 new messages