jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Esmond Pitt" <esmond.p...@bigpond.com>
Subject Using LDAP as JNDI bind/lookup mechanism
Date Tue, 23 Apr 2013 07:02:18 GMT
I have multiple server boxes accessing the JCR servlet via RMI. I want to
use an LDAP server instead of the RMI Registry to bind the RMI interface
into. I have this configuration in bootstrap.properties:
 
jndi.enabled=true
jndi.name=cn\=jcr,uid\=JavaContentRepository,ou\=Applications,ou\=System,dc\
=verismartlabs,dc=com
#java.naming.factory.initial=org.apache.jackrabbit.core.jndi.provider.DummyI
nitialContextFactory
java.naming.factory.initial=com.sun.jndi.ldap.LdapCtxFactory
java.naming.provider.url=ldap\://entirelydifferentlabs.com
java.naming.security.principal=<xyz>
java.naming.security.credentials=<secret>
java.naming.security.authentication=simple

I get this when the JCR webapp starts:
 
Apr 22, 2013 11:07:53 PM org.apache.catalina.core.ApplicationContext log
SEVERE: StandardWrapper.Throwable
java.lang.IllegalArgumentException: can only bind Referenceable,
Serializable, DirContext
 at com.sun.jndi.ldap.Obj.encodeObject(Unknown Source)
 at com.sun.jndi.ldap.Obj.determineBindAttrs(Unknown Source)
 at com.sun.jndi.ldap.LdapCtx.c_bind(Unknown Source)
 at com.sun.jndi.ldap.LdapCtx.c_bind(Unknown Source)
 at com.sun.jndi.toolkit.ctx.ComponentContext.p_bind(Unknown Source)
 at com.sun.jndi.toolkit.ctx.PartialCompositeContext.bind(Unknown Source)
 at com.sun.jndi.toolkit.ctx.PartialCompositeContext.bind(Unknown Source)
 at javax.naming.InitialContext.bind(Unknown Source)
 at
org.apache.jackrabbit.j2ee.RepositoryStartupServlet.registerJNDI(RepositoryS
tartupServlet.java:457)
 at
org.apache.jackrabbit.j2ee.RepositoryStartupServlet.startup(RepositoryStartu
pServlet.java:244)
 at
org.apache.jackrabbit.j2ee.RepositoryStartupServlet.init(RepositoryStartupSe
rvlet.java:215)
 at javax.servlet.GenericServlet.init(GenericServlet.java:160)
 at
org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:12
66)
 at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:11
85)
 at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1080)
 at
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:
5015)
 at
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:
5302)
 at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
 at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:8
95)
 at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:871)
 at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)
 at
org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:649)
 at
org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:
1585)
 at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
 at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
 at java.util.concurrent.FutureTask.run(Unknown Source)
 at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
 at java.lang.Thread.run(Unknown Source)
 
Is this an envisaged configuration? In this case the
RepositoryStartupServlet.registerJNDI() method needs to do the same things
as the registerRMI() method.
 
Or else a javax.naming.spi.StateFactory needs to be made available that does
this:
 
 public Object getStateToBind(Object obj, Name name, Context nameCtx,
Hashtable<?, ?> environment) throws NamingException
 {
  // Object is a Repository. Wrap it in a remote Repository and get return
its stub.
  if (obj instanceof Repository)
  {
   Repository repository = (Repository)obj;
            try
   {
    return RemoteObject.toStub(new
ServerAdapterFactory().getRemoteRepository(repository));
   }
   catch (RemoteException exc)
   {
    logger.log(Level.SEVERE, "creating remote repository", exc);
   }
  }
  return null;
 }

 
EJP


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message