Jackrabbit JCR-RMI
  1. Jackrabbit JCR-RMI
  2. JCRRMI-32

Obselete/Unclear documentation for JBoss integration

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.1.0
    • Fix Version/s: None
    • Labels:
    • Environment:

      Linux, JBoss 5.1.0.GA, Sun JDK 1.6

      Description

      Documentation or code samples found from http://wiki.apache.org/jackrabbit/JackrabbitOnJBoss about the use of Jackrabbit JCR RMI with JBoss are either obselete or unclear.

      Here are the following steps I've performed in order to get a working JCR session with a standalone Java client from a remote (even if localhost is not so remote).

      In jackrabbit-rmi-service.xml (to be in x-jcr-rmi.jar), I've edited two lines :
      <attribute name="LocalAddress">_LOCAL_JNDI_NAME_TO_JCR_</attribute>
      <attribute name="RemoteAddress">jnp://localhost:1099/aRemoteName</attribute>

      Replace _LOCAL_JNDI_NAME_TO_JCR_ by the actual JNDI name the JCR repository was locally bound to within JBoss (value of <jndi-name> element in x-jcr-ds.xml JCA descriptor). Replace aRemoteName by wanted name for the RMI remote repository.

      Then I've copied the x-jcr-rmi.jar in jboss main deploy directory ($JBOSS_HOME/server/default/deploy), and restarted JBoss.

      Finally I use the following code in my standalone client (actually a testing one) :

      import javax.naming.InitialContext;

      import javax.jcr.Repository;
      import javax.jcr.Session;

      import org.apache.jackrabbit.rmi.remote.RemoteRepository;
      import org.apache.jackrabbit.rmi.client.ClientAdapterFactory;

      [...]

      ClientAdapterFactory caf = new ClientAdapterFactory();
      InitialContext ctx = new InitialContext();
      RemoteRepository rr = (RemoteRepository) ctx.lookup("jnp://localhost:1099/aRemoteName");
      Repository repo = caf.getRepository(rr);
      Session s = repo.login(...);

        Activity

          People

          • Assignee:
            Unassigned
            Reporter:
            Cédric Chantepie
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:

              Development