You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by JavaJ <po...@yahoo.com> on 2006/08/01 02:39:12 UTC

Initializing Jackrabbit ...

Is it possible to initialize Jackrabbit manually on the startup of your
webapp?  For example, in a Servlet.init() method, calling
RepositoryImpl.create() or using a framework like Spring for initialization? 
Or do you have to use one of the Deployment Models for initalization of the
repository?
-- 
View this message in context: http://www.nabble.com/Initializing-Jackrabbit-...-tf2030936.html#a5586711
Sent from the Jackrabbit - Users forum at Nabble.com.


Re: Initializing Jackrabbit ...

Posted by Philip Mark Donaghy <ph...@gmail.com>.
I am new to jackrabbit, but your issues appears to be not shutting
down properly. Can you tell us how you implemented the shutdown?

Phil

On 8/1/06, JavaJ <po...@yahoo.com> wrote:
>
> So I'm having this wierd issue where my application will sometimes try to
> create the Repository even after it's already been created and I get the
> error "javax.jcr.RepositoryException: The repository home at c:\jackrabbit
> appears to be in use since the file at c:\jackrabbit\.lock is locked by
> another process.".  I think this has something to do with the configuration
> of Spring.
>
> In any case, is there a way to check if the repository has already been
> initialized (or at least locked) and if it is, grab that Repository
> instance?
> --
> View this message in context: http://www.nabble.com/Initializing-Jackrabbit-...-tf2030936.html#a5602851
> Sent from the Jackrabbit - Users forum at Nabble.com.
>
>


-- 
Philip Donaghy
donaghy.blogspot.com del.icio.us/donaghy/philip
Skype: philipmarkdonaghy
Office: +33 5 56 60 88 02
Mobile: +33 6 20 83 22 62

Re: Initializing Jackrabbit ...

Posted by JavaJ <po...@yahoo.com>.
So I'm having this wierd issue where my application will sometimes try to
create the Repository even after it's already been created and I get the
error "javax.jcr.RepositoryException: The repository home at c:\jackrabbit
appears to be in use since the file at c:\jackrabbit\.lock is locked by
another process.".  I think this has something to do with the configuration
of Spring.

In any case, is there a way to check if the repository has already been
initialized (or at least locked) and if it is, grab that Repository
instance?
-- 
View this message in context: http://www.nabble.com/Initializing-Jackrabbit-...-tf2030936.html#a5602851
Sent from the Jackrabbit - Users forum at Nabble.com.


Re: Initializing Jackrabbit ...

Posted by Jukka Zitting <ju...@gmail.com>.
Hi,

On 8/1/06, JavaJ <po...@yahoo.com> wrote:
> Is it possible to initialize Jackrabbit manually on the startup of your
> webapp?  For example, in a Servlet.init() method, calling
> RepositoryImpl.create() or using a framework like Spring for initialization?
> Or do you have to use one of the Deployment Models for initalization of the
> repository?

You can follow the deployment model 1 HOWTO. The
BindableRepositoryFactory bound in JNDI will automatically initialize
the repository when it's first accessed. Note that even though the
HOWTO doesn't currently mention it, you need to explicitly shutdown()
the repository in a Servlet.destroy() method to correctly clean things
up.

As you asked, you can also use RepositoryImpl.create() or even an IoC
framework to start the repository if you don't want to use JNDI. Note
that also in this case you generally want to make sure that the
repository gets shut down when your webapp is closed.

BR,

Jukka Zitting

-- 
Yukatan - http://yukatan.fi/ - info@yukatan.fi
Software craftsmanship, JCR consulting, and Java development