-
Bug
-
Resolution: Done
-
Major
-
2.6.0.Beta2
JCR 1.0 suggested finding Repository instances in JNDI directly, using something like this:
InitialContext initCtx = new InitialContext(); Context envCtx = (Context) initCtx.lookup("java:comp/env"); Repository repository = (Repository) envCtx.lookup("jcr/local");
ModeShape's JndiRepositoryFactory can be used within web servers to deploy a ModeShape engine instance and register a particular Repository instance in JNDI.
However, JCR 2.0 changed this and instead uses the ServiceLoader mechanism and introduced a RepositoryFactory interface that allowed a different way to find a Repository instance:
Map<String, String> parameters = ... for (RepositoryFactory factory : ServiceLoader.load(RepositoryFactory.class)) { repository = factory.getRepository(parameters); if (repository != null) break; }
where the parameters are implementation-dependent. ModeShape expects a single "org.modeshape.jcr.URL" parameter whose value is a URL of several forms. However, the only JNDI form expects the *ModeShape engine* to be found in JNDI, and thus this is not compatible with the JndiRepositoryFactory approach described above.
Therefore, the RepositoryFactory should be changed to look for a JNDI URL that points directly to a Repository instance.
- relates to
-
MODE-1243 JndiRepositoryFactory should be able to register the ModeShape engine in JNDI
- Closed