jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexander Klimetschek <aklim...@adobe.com>
Subject Re: Spring jcr version to use with Jack Rabbit 2.6.3
Date Fri, 30 Aug 2013 01:47:20 GMT
The spring jcr module is not developed by the Apache Jackrabbit. AFAIU it is inactive for a
number of years already.

But you don't need it to use JCR withing Spring applications. What it does is IMHO a bad approach
with JCR anyway - it sees JCR as just another DAO/OCR framework and uses template callbacks
etc. to make it completely transparent to the user how the JCR session underneath is managed.
This is a bad thing, it is important to control the session (login, lifecycle usually per
request, and exact save() or refresh() points) yourself.

A usueful approach is:
- to have maybe a servlet filter etc. auto-create the session at the start of the request
and use whatever authentication you have over HTTP coming in to login the right user for the
session and
- provide that to your servlets in e.g. a request attribute.
- session.save() would be up to servlets that actually change something (e.g. POST or PUT
- background services outside a request would create their own session with e.g. a service

You don't need the spring jcr module for this. Also, you might want to look at Apache Sling,
which follows the above pattern.


On 29.08.2013, at 02:35, sumit tiwari <tiwarisumit3@gmail.com> wrote:

> Hi All,
> I am planning to use jack rabbit with spring. I am seeing that spring jcr version 0.8
and 0.9 looks for old jsr170 jar and fails out.
> [ERROR] Failed to execute goal on project xyz: Could not resolve dependencies for project
com.test.xyq:war:2.4.2: The following artifacts could not be resolved: jsr170:jsr170:jar:1.0,
jeceira:jeceira:jar:0.1.3, aparzev:doka:jar:0.1, aparzev:commons:jar:0.2, jug:jug-asl:jar:2.0.0:
Failure to find jsr170:jsr170:jar:1.0 in http:///nexus/content/groups/cliqrthirdparty was
cached in the local repository, resolution will not be reattempted until the update interval
of  has elapsed http:///nexus/content/groups/cliqrthirdparty or updates are forced -> [Help
> I did the exclusion 
> <dependency>
> 			<groupId>org.springmodules</groupId>
> 			<artifactId>spring-modules-jcr</artifactId>
> 			<version>0.8</version>
> 			<optional>true</optional>
> 			<exclusions>
> 				<exclusion>
> 					<artifactId>jackrabbit-core</artifactId>
> 					<groupId>org.apache.jackrabbit</groupId>
> 				</exclusion>
> 				<exclusion>
> 					<artifactId>jackrabbit-jca</artifactId>
> 					<groupId>org.apache.jackrabbit</groupId>
> 				</exclusion>
> 		</exclusions>
> 	  </dependency>	
> I am using it in application-context.xml
> <bean id="repository"
>         class="org.springmodules.jcr.jackrabbit.RepositoryFactoryBean">
>         <!-- normal factory beans params -->
>         <property name="configuration" value="classpath:/jackrabbit-repository.xml"
>         <!-- use the target folder which will be cleaned  -->
>         <property name="homeDir" value="file:./tmp/repository" />
>     </bean>
> Is there any recent spring document which I can refer. I am not keen on using spring
jcr but a good approach in which I can integrate the latest version of jack rabbit with spring.
> -- 
> Thanks,
> Sumit 

View raw message