Obselete/Unclear documentation for JBoss integration
----------------------------------------------------
Key: JCRRMI-32
URL: https://issues.apache.org/jira/browse/JCRRMI-32
Project: Jackrabbit JCR-RMI
Issue Type: Improvement
Affects Versions: 2.1.0
Environment: Linux, JBoss 5.1.0.GA, Sun JDK 1.6
Reporter: Cédric Chantepie
Priority: Minor
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(...);
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira