jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Syer <david_s...@hotmail.com>
Subject Re: Junit testing with Jackrabbit using AbstractDependencyInjectionSpringContextTests
Date Mon, 23 Jul 2007 16:04:13 GMT

It works for me using AbstractTransactionalSpringContextTests (I used the
config from the jcr sample from the Springmodules distro, just changing the
directory name settings).  Maybe that would be a better choice generally for
you anyway?

bilobag wrote:
> I'm am in the process of setting up Junit testing for my Jackrabbit based
> CMS web application using JSF and Spring. I finally got my test to see the
> config files I need, but now I get the following error message. It seems
> like the JcrTemplate isn't opening up a new JCR session so that I can
> access the repository. Everything works fine when the application is
> deployed...just not for my Junit test. Since I don't get any errors about
> being able to initialize any of my Dependency Injected beans...i would
> assume everything is initialized properly. Does anyone know what i'm
> missing? Do I need to set something in the
> AbstractDependencyInjectionSpringContextTests class to initialize the
> repository?
> javax.jcr.RepositoryException: this session has been closed
> at org.apache.jackrabbit.core.SessionImpl.sanityCheck
> (SessionImpl.java:353)
> at org.apache.jackrabbit.core.ItemImpl.sanityCheck(It emImpl.java:153)
> at org.apache.jackrabbit.core.NodeImpl.getUUID(NodeIm pl.java:2803)
> at org.bmpcoe.cwe5.service.impl.NodeServiceImpl.getNo
> deByPath(NodeServiceImpl.java:165)
> at org.bmpcoe.cwe5.service.NodeServiceTests.testGetAl
> lFiles(NodeServiceTests.java:41)
> at org.springframework.test.ConditionalTestCase.runBa
> re(ConditionalTestCase.java:69)
> at org.eclipse.ant.internal.ui.antsupport.EclipseDefa
> ultExecutor.executeTargets(EclipseDefaultExecutor. java:32)
> at org.eclipse.ant.internal.ui.antsupport.InternalAnt
> Runner.run(InternalAntRunner.java:423)
> at org.eclipse.ant.internal.ui.antsupport.InternalAnt
> Runner.main(InternalAntRunner.java:137)

View this message in context: http://www.nabble.com/Junit-testing-with-Jackrabbit-using-AbstractDependencyInjectionSpringContextTests-tf4111861.html#a11747467
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.

View raw message