You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Rainer Flicker <r....@airsight.de> on 2010/08/19 16:37:27 UTC

ResourceException when using Jackrabbit 2.1.1 and Glassfish 2.1.1

Hi,

we are using Jackrabbit 2.1.1 and JBoss 5.1 without any problems, but
we could not get Jackrabbit 2.1.1 working with Glassfish 2.1.1.

I installed Glassfish 2.1.1, created a directory "jackrabbit" with the
configuration file "repository.xml", used in JBoss. Added some libs to
"lib/ext", needed for our application (deployed as ear):
antlr-2.7.6.jar
cglib-nodep.jar
concurrent.jar
dom4j-1.6.1.jar
javassist-3.9.0.GA.jar
jcl-over-slf4j-1.5.8.jar
jcr-2.0.jar
jtds-1.2.5.jar
log4j-over-slf4j-1.5.8.jar
mysql-connector-java-5.1.12-bin.jar
ojdbc14.jar
orai18n.jar
slf4j-api-1.5.8.jar
slf4j-jdk14-1.5.8.jar
sqljdbc.jar

Then I deployed and configured Jackrabbit:
$ asadmin deploy --user admin --passwordfile passwdfile.txt
jackrabbit-jca-2.1.1.rar 
$ asadmin create-threadpool --user admin --passwordfile passwdfile.txt
jackrabbit-pool 
$ asadmin create-resource-adapter-config --user admin --passwordfile
passwdfile.txt --threadpools jackrabbit-pool jackrabbit-jca-2.1.1 
$ asadmin create-connector-connection-pool --user admin --passwordfile
passwdfile.txt --raname jackrabbit-jca-2.1.1 --connectiondefinition
javax.jcr.Repository --transactionsupport XATransaction --property
homeDir=c\:/programs/glassfish/domains/domain1/jackrabbit:configFile=c\:
/programs/glassfish/domains/domain1/jackrabbit/repository.xml
jackrabbit-connection-pool 
$ asadmin create-connector-resource --user admin --passwordfile
passwdfile.txt --poolname jackrabbit-connection-pool jcr/local 
$ asadmin stop-domain
$ asadmin start-domain

When I try to access the repository,
 Repository repository = (Repository) ctx.lookup("jcr/local");

I get this error:
javax.resource.ResourceException: Failed to create session: Unable to
access a repository with the following settings:
    org.apache.jackrabbit.repository.conf:
c:/programs/glassfish/domains/domain1/jackrabbit/repository.xml
    org.apache.jackrabbit.repository.home:
c:/programs/glassfish/domains/domain1/jackrabbit
The following RepositoryFactory classes were consulted:
Perhaps the repository you are trying to access is not available at the
moment.
	at
org.apache.jackrabbit.jca.JCAManagedConnectionFactory.createRepository(J
CAManagedConnectionFactory.java:280)
	at
org.apache.jackrabbit.jca.JCAManagedConnectionFactory.createConnectionFa
ctory(JCAManagedConnectionFactory.java:137)
	at
com.sun.enterprise.naming.factory.ConnectorObjectFactory.getObjectInstan
ce(ConnectorObjectFactory.java:130)
	at
javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
	at
com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:414)
	at javax.naming.InitialContext.lookup(InitialContext.java:392)
	...

I also tried to set "repositoryURI", without any success. I tried 
repositoryURI=jcr-jackrabbit://jackrabbit
repositoryURI=file:///c:/programs/glassfish/domains/domain1/jackrabbit
repositoryURI=c:/programs/glassfish/domains/domain1/jackrabbit
repositoryURI=jndi://jcr/local

I tried this on Windows and Linux.

Thanks in advance for any help,

Rainer



RE: ResourceException when using Jackrabbit 2.1.1 and Glassfish 2.1.1

Posted by Rainer Flicker <r....@airsight.de>.
 
>Neil Corbet <ncorbet <at> towerhillservices.com> writes:
>
>> Rainer,
>> 
>> When I access my repo through the jndi URI mine works with 
>the following:
>> 
>>      URI = jndi:java:comp/env/jcr/repository
>> 
>> Now, mea culpa, I am using Tomcat as my app server. I did have to try
>different 
>> forms of the URI before I finally got it right.
>> 
>> Hope this helps some,
>>     Neil
>> 
>> 
>
>Also, I forgot to add that I am using the 
>JcrUtils.getRepository(URI) with the 
>above URI. But, java:comp/env/jcr/local   may work for the 
>code you posted.
>
>Neil
>

I also tried as repositoryURI:
java:comp/env/jcr/local
jndi:java:comp/env/jcr/local
java:jcr/local
jndi:java:jcr/local

with no success.

Rainer

Re: ResourceException when using Jackrabbit 2.1.1 and Glassfish 2.1.1

Posted by Neil Corbet <nc...@towerhillservices.com>.
Neil Corbet <ncorbet <at> towerhillservices.com> writes:

> Rainer,
> 
> When I access my repo through the jndi URI mine works with the following:
> 
>      URI = jndi:java:comp/env/jcr/repository
> 
> Now, mea culpa, I am using Tomcat as my app server. I did have to try 
different 
> forms of the URI before I finally got it right.
> 
> Hope this helps some,
>     Neil
> 
> 

Also, I forgot to add that I am using the JcrUtils.getRepository(URI) with the 
above URI. But, java:comp/env/jcr/local   may work for the code you posted.

Neil



Re: ResourceException when using Jackrabbit 2.1.1 and Glassfish 2.1.1

Posted by Neil Corbet <nc...@towerhillservices.com>.
Rainer Flicker <r.flicker <at> airsight.de> writes:

> I also tried to set "repositoryURI", without any success. I tried 
> repositoryURI=jcr-jackrabbit://jackrabbit
> repositoryURI=file:///c:/programs/glassfish/domains/domain1/jackrabbit
> repositoryURI=c:/programs/glassfish/domains/domain1/jackrabbit
> repositoryURI=jndi://jcr/local
> 
> I tried this on Windows and Linux.
> 
> Thanks in advance for any help,
> 
> Rainer
> 
> 

Rainer,

When I access my repo through the jndi URI mine works with the following:

     URI = jndi:java:comp/env/jcr/repository

Now, mea culpa, I am using Tomcat as my app server. I did have to try different 
forms of the URI before I finally got it right.

Hope this helps some,
    Neil