You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by Cedric Bosdonnat <cb...@nuxeo.com> on 2006/04/24 09:26:39 UTC

Using JCR-RMI with the jackrabbit-server

Hi everybody,

I'm new here and trying to get a connection to the JCR server servlet
throught RMI. I can't figure out what is wrong...

To write the client code (a small test) I followed the JCR-API
instructions (client package). The configuration of the servlet is at
the end of the mail.

Some questions to check what I might do wrong:
  + What is the default port used for RMI ?
  + is the //localhost/jackrabbit.repository url correct ?
  + is there something else to add ?

Thanks for your help,
Cedric

------------- %< -- META-INF/context.xml -- %<------------

<Context path="/jackrabbit-server-1.0">
    <Resource name="jcr/repository"
        auth="Container"
        type="javax.jcr.Repository"
        factory="org.apache.jackrabbit.rmi.client.ClientRepositoryFactory"
        url="//localhost/jackrabbit.repository"/>
</Context>

------------ %< -- WEB-INF/web.xml -- %<------------
I uncommented all the RMI related lines and added at the end:

<resource-env-ref>
        <resource-env-ref-name>jcr/repository</resource-env-ref-name>

<resource-env-ref-type>javax.jcr.Repository</resource-env-ref-type>
</resource-env-ref>


Re: Using JCR-RMI with the jackrabbit-server

Posted by Cedric Bosdonnat <cb...@nuxeo.com>.
Hi Felix,

Felix Meschberger a écrit :

> Actually - from what I can see in the log - the repository should be
> registered with RMI:
> 
>    24.04.2006 10:19:22 *INFO * RepositoryStartupServlet: Repository
>    bound via RMI with name: //localhost:1099/jackrabbit.repository
>    (RepositoryStartupServlet.java, line 475)
> 
> The log entry for the dump is only informative as the repository startup
> servlet tries to create an RMI registry first and falls back to
> connecting to an existing registry if creation fails. Therefore failure
> to create the registry is not an error. The next entry though is
> actually, what you are looking for: The confirmation, that from the
> point of view of the startup servlet, the repository should be
> registered under the logged URL.

In fact, this error seems to indicate some problem during the registry
creation: I ran tomcat as a normal user and got this log. However, I
tried to run Tomcat as root and I didn't get the error. I even saw the
following entry in the netstat output:

tcp        0      0 localhost:rmiregistry   *:*        LISTEN

Running the test works fine afterwards using the 1099 port. It seems to
be a problem of priviledges to open such a port. It might be a
privileged port IIRC.

Moreover I found the following problem after shutting down tomcat: the
rmiregistry entry in netstat is still printed: the port isn't closed :(
and there is a java process still running (it seems to be a Tomcat
problem). When I kill this process, the port is closed...


Thanks for your help
Cedric

Re: Using JCR-RMI with the jackrabbit-server

Posted by Felix Meschberger <Fe...@day.com>.
Hi Cedric,

Actually - from what I can see in the log - the repository should be 
registered with RMI:

    24.04.2006 10:19:22 *INFO * RepositoryStartupServlet: Repository
    bound via RMI with name: //localhost:1099/jackrabbit.repository
    (RepositoryStartupServlet.java, line 475)

The log entry for the dump is only informative as the repository startup 
servlet tries to create an RMI registry first and falls back to 
connecting to an existing registry if creation fails. Therefore failure 
to create the registry is not an error. The next entry though is 
actually, what you are looking for: The confirmation, that from the 
point of view of the startup servlet, the repository should be 
registered under the logged URL.

Regards
Felix

Cedric Bosdonnat schrieb:
> Hi Felix,
>
> Thank you for your quick answer :)
>
> Felix Meschberger a écrit :
>
>   
>>>  Some questions to check what I might do wrong:
>>>    + What is the default port used for RMI ?
>>>       
>> The default RMI port in a Java VM is 1099
>>     
>
> That's what I thought...
>
>   
>>>    + is the //localhost/jackrabbit.repository url correct ?
>>>       
>> No, the default configuration would be for port 1099, that is
>> //localhost:1099/jackrabbit.repository
>>     
>
> Ok... thus omitting the port won't choose the default one ? nevermind...
>
>   
>>>    + is there something else to add ?
>>>       
>> Considering, you might not have used the correct port, this might be
>> your issue. Else, I cannot tell without logs.
>>     
>
> I added the logs of the jackrabbit servlet startup here:
> http://pastebin.com/678426
> It seems like the port 1099 is busy... but netstat -a doesn't show me
> this port as active... I even try to change the port, but I still get
> the same exception: "Port already used".
>
> I didn't found them at first look because the log4j line for the file
> appender was commented (default option :().
>
> Thanks for your help,
> Cedric
>   



Re: Using JCR-RMI with the jackrabbit-server

Posted by Cedric Bosdonnat <cb...@nuxeo.com>.
Hi Felix,

Thank you for your quick answer :)

Felix Meschberger a écrit :

>>  Some questions to check what I might do wrong:
>>    + What is the default port used for RMI ?
> The default RMI port in a Java VM is 1099

That's what I thought...

>>    + is the //localhost/jackrabbit.repository url correct ?
> No, the default configuration would be for port 1099, that is
> //localhost:1099/jackrabbit.repository

Ok... thus omitting the port won't choose the default one ? nevermind...

>>    + is there something else to add ?
> Considering, you might not have used the correct port, this might be
> your issue. Else, I cannot tell without logs.

I added the logs of the jackrabbit servlet startup here:
http://pastebin.com/678426
It seems like the port 1099 is busy... but netstat -a doesn't show me
this port as active... I even try to change the port, but I still get
the same exception: "Port already used".

I didn't found them at first look because the log4j line for the file
appender was commented (default option :().

Thanks for your help,
Cedric

Re: Using JCR-RMI with the jackrabbit-server

Posted by Felix Meschberger <Fe...@day.com>.
Hi Cedric,

>  Some questions to check what I might do wrong:
>    + What is the default port used for RMI ?
The default RMI port in a Java VM is 1099

>    + is the //localhost/jackrabbit.repository url correct ?
No, the default configuration would be for port 1099, that is
//localhost:1099/jackrabbit.repository

>    + is there something else to add ?
Considering, you might not have used the correct port, this might be
your issue. Else, I cannot tell without logs.

Hope this hels
Regards
Felix