[ 
https://issues.apache.org/jira/browse/JCR-3694?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13842715#comment-13842715
 ] 

Bruno CORNOUILLER commented on JCR-3694:
----------------------------------------

When the shutdown hook is called, the logger is not accessible (is null).
So, i rewrite BindableRepositoryFactory which call directly 
RepositoryImpl.create(config).
And in Resource tag, i add parameter "closeMethod" with the value "shutdown". 
So when tomcat stop, the method "shutdown()" is automatically called on 
repository object. It's a new functionnality in tomcat7.


> Exception on shutdown when using BindableRepository
> ---------------------------------------------------
>
>                 Key: JCR-3694
>                 URL: https://issues.apache.org/jira/browse/JCR-3694
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-core
>    Affects Versions: 2.6.4
>            Reporter: Bruno CORNOUILLER
>
> I declare a resource in "context.xml" (of my app) :
> <Resource name="jcr/myRepository" auth="Container"
> type="javax.jcr.Repository"
> factory="org.apache.jackrabbit.core.jndi.BindableRepositoryFactory"
> configFilePath="C:\myapp\conf\repository.xml"
> repHomeDir="C:\myapp\repository" />
> And then, i call the repository like that :
> InitialContext context = new InitialContext();
> Repository repository = (Repository) 
> context.lookup("java:comp/env/jcr/myRepository");
> I do anything else. And I stop tomcat, and i have this exception :
> Exception in thread "Thread-3" java.lang.NullPointerException
>       at 
> org.apache.jackrabbit.core.RepositoryImpl.doShutdown(RepositoryImpl.java:1060)
>       at 
> org.apache.jackrabbit.core.RepositoryImpl.shutdown(RepositoryImpl.java:1048)
>       at 
> org.apache.jackrabbit.core.jndi.BindableRepository.shutdown(BindableRepository.java:259)
>       at 
> org.apache.jackrabbit.core.jndi.BindableRepository$1.run(BindableRepository.java:120)
> The NullPointerException is on this line :
>  log.info("Shutting down repository...");



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to