Hi,

I tried to setup the spring jcr but when I start the Tomcat, it show the warning "Unclosed session detected. The session was opened here".
Below is the stacktrace:

Code:
java.lang.Exception: Stack Trace
        at org.apache.jackrabbit.core.SessionImpl.<init>(SessionImpl.java:249)
        at org.apache.jackrabbit.core.SessionImpl.<init>(SessionImpl.java:271)
        at org.apache.jackrabbit.core.XASessionImpl.<init>(XASessionImpl.java:105)
        at org.apache.jackrabbit.core.RepositoryImpl.createSessionInstance(RepositoryImpl.java:1517)
        at org.apache.jackrabbit.core.RepositoryImpl.createSession(RepositoryImpl.java:964)
        at org.apache.jackrabbit.core.RepositoryImpl.login(RepositoryImpl.java:1395)
        at org.apache.jackrabbit.core.jndi.BindableRepository.login(BindableRepository.java:162)
        at org.springframework.extensions.jcr.JcrSessionFactory.getBareSession(JcrSessionFactory.java:270)
        at org.springframework.extensions.jcr.JcrSessionFactory.registerNamespaces(JcrSessionFactory.java:182)
        at org.springframework.extensions.jcr.JcrSessionFactory.afterPropertiesSet(JcrSessionFactory.java:142)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowi
reCapableBeanFactory.java:1369)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireC
apableBeanFactory.java:1335)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCap
ableBeanFactory.java:473)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBea
nFactory.java:409)
        at java.security.AccessController.doPrivileged(Native Method)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapab
leBeanFactory.java:380)
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegis
try.java:222)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListable
BeanFactory.java:429)
        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplic
ationContext.java:728)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)
        at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)
        at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)
        at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3764)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4216)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544)
        at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:626)
        at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:553)
        at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:488)
        at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1150)
        at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022)
        at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
        at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
        at org.apache.catalina.core.StandardService.start(StandardService.java:448)
        at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
2009-08-15 16:54:04,546 main INFO [springframework.web.context.ContextLoader] Root WebApplicationContext: initialization
 completed in 155843 ms
Here's my spring config file:
Code:
<jee:jndi-lookup id="repository" jndi-name="jcr/repository"/>

    <bean id="jcrSessionFactory" class="org.springframework.extensions.jcr.JcrSessionFactory">
        <property name="repository" ref="repository"/>
        <property name="credentials">
            <bean class="javax.jcr.SimpleCredentials">
                <constructor-arg index="0" value="hnghiem"/>
                <constructor-arg index="1" value="hnghiem"/>
            </bean>
        </property>
        <property name="namespaces">
            <props>
                <prop key="owe">http://www.owe.com/jcr</prop>
            </props>
        </property>
        <property name="skipExistingNamespaces" value="true"/>
    </bean>

    <bean id="jcrTemplate" class="org.springframework.extensions.jcr.JcrTemplate">
        <property name="sessionFactory" ref="jcrSessionFactory"/>
        <property name="allowCreate" value="true"/>
    </bean>
Can anyone help me?
Thanks!!!