I am trying to use a JNDI instance of JackRabbit through Glassfish and Spring and am having some issues. I can startup one webapp just fine, and it seems to find the repository with no issues or complaints. When I try to start a second app though I get stuck in an infinite lookup look with spring and just spew tons of errors that doesn't seem to stop until I kill glassfish. The problem seems to be in BindableRepositoryFactory where it's not finding the already created reference from the Map and tries to create another repository instance, which fails. A small part of the stack trace is below. I don't think, however, the stacktrace is the real problem as it just complains about file locks being in place and all that, which is fine, but it shouldn't be trying to create a new instance, which it is.
Any help on this? As anyone seen this before? I used the example from the wiki to setup the JNDI instance, and am using a simple spring file to reference it: <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jee="http://www.springframework.org/schema/jee" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-2.5.xsd"> <jee:jndi-lookup id="jcrRepository" jndi-name="jcr/FileRepository"/> </beans> Like I said, first look up of the JNDI object works, subsequent lookups however don't. Thanks for the help! -Nick (and testing with the 1.5 snapshot since that is the only way I could get custom CND files to load) Heres some stacktraces showing BindableResourceFactory trying to create a new instance... javax.jcr.RepositoryException: Directory was previously created with a different LockFactory instance; please pass null as the lockFactory instance and use setLockFactory to change it: Directory was previously created with a different LockFactory instance; please pass null as the lockFactory instance and use setLockFactory to change it: Directory was previously created with a different LockFactory instance; please pass null as the lockFactory instance and use setLockFactory to change it at org.apache.jackrabbit.core.SearchManager.initializeQueryHandler(SearchManager.java:521) at org.apache.jackrabbit.core.SearchManager.<init>(SearchManager.java:242) at org.apache.jackrabbit.core.RepositoryImpl$WorkspaceInfo.getSearchManager(RepositoryImpl.java:1713) at org.apache.jackrabbit.core.RepositoryImpl.initWorkspace(RepositoryImpl.java:639) at org.apache.jackrabbit.core.RepositoryImpl.initStartupWorkspaces(RepositoryImpl.java:452) at org.apache.jackrabbit.core.RepositoryImpl.<init>(RepositoryImpl.java:311) at org.apache.jackrabbit.core.RepositoryImpl.create(RepositoryImpl.java:590) at org.apache.jackrabbit.core.jndi.BindableRepository.createRepository(BindableRepository.java:174) at org.apache.jackrabbit.core.jndi.BindableRepository.init(BindableRepository.java:138) at org.apache.jackrabbit.core.jndi.BindableRepository.create(BindableRepository.java:125) at org.apache.jackrabbit.core.jndi.BindableRepositoryFactory.createInstance(BindableRepositoryFactory.java:59) at org.apache.jackrabbit.core.jndi.BindableRepositoryFactory.getObjectInstance(BindableRepositoryFactory.java:81) at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304) at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:403) at javax.naming.InitialContext.lookup(InitialContext.java:392) at org.springframework.jndi.JndiTemplate$1.doInContext(JndiTemplate.java:132) at org.springframework.jndi.JndiTemplate.execute(JndiTemplate.java:88) at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:130) at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:155)
