You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by Carlos Villegas <ca...@uniscope.jp> on 2006/05/19 17:45:50 UTC
jcr-rmi behind firewall
Hi,
I've been trying to connect to a jcr-rmi instance running on JBoss
behind a firewall with no success.
According to the JBoss documentation, I need to open 3 ports on a
standard configuration: 1098,1099, and 4444. I've done this and I'm able
to invoke EJBs through RMI to the server behind the firewall.
However, it doesn't work for the jcr-rmi server. The jcr-rmi is bound to
JBoss JNDI as per the instructions in jcr-rmi javadocs. It works fine
with no firewall in the middle.
What I'm noticing is that when I run my jcr-rmi service and bind it to
JNDI it seems to open an anonymous port on the server. I also see the
client trying to connect to this port when I invoke the first operation
on the remote Repository instance. But since the port is allocated
randomly I can't set a firewall rule for it!
Any ideas how to configure this port?
Carlos
Re: jcr-rmi behind firewall
Posted by Jukka Zitting <ju...@gmail.com>.
Hi,
On 5/20/06, Carlos Villegas <ca...@uniscope.jp> wrote:
> My question is then, why is this port used and where is created. I
> didn't see any explicit creation of sockets in the jcr-rmi code. I'm
> guessing that since it uses the java RMI API, probably the RMI API is
> defaulting to an anonymous port when a connection factory of some sort
> is created. But surely this can be configured.
By default RMI opens an anonymous port for each new remote object. It
is possible to configure the port or even the entire communication
protocol by passing a custom socket factory to the created remote
objects. However, at the moment JCR-RMI doesn't support custom socket
factories out of the box. Please file an enhancement request at Jira
if you'd like to see that feature.
The RMI FAQ lists a few options for firewall traversal at
http://java.sun.com/j2se/1.4.2/docs/guide/rmi/faq.html#firewallOut.
HTTP tunneling sounds like the best alternative in your case.
BR;
Jukka Zitting
--
Yukatan - http://yukatan.fi/ - info@yukatan.fi
Software craftsmanship, JCR consulting, and Java development
Re: jcr-rmi behind firewall
Posted by Carlos Villegas <ca...@uniscope.jp>.
In my case we can't use SOCKS, we don't control the firewall. I can only
request some ports to be open.
My question is then, why is this port used and where is created. I
didn't see any explicit creation of sockets in the jcr-rmi code. I'm
guessing that since it uses the java RMI API, probably the RMI API is
defaulting to an anonymous port when a connection factory of some sort
is created. But surely this can be configured.
Any hints?
Carlos
Nicolas Toper wrote:
> You can use a SOCKS library for this if your firewall supports it. SOCKS is
> a protocol btw an application and a firewall to negociate a dynamic port.
> This is the cleanest solution I think.
>
> There is jSocks for instance which support it.
>
> nico
> My blog! http://www.deviant-abstraction.net !!
>
> On 5/19/06, Carlos Villegas <ca...@uniscope.jp> wrote:
>>
>> Hi,
>>
>> I've been trying to connect to a jcr-rmi instance running on JBoss
>> behind a firewall with no success.
>> According to the JBoss documentation, I need to open 3 ports on a
>> standard configuration: 1098,1099, and 4444. I've done this and I'm able
>> to invoke EJBs through RMI to the server behind the firewall.
>> However, it doesn't work for the jcr-rmi server. The jcr-rmi is bound to
>> JBoss JNDI as per the instructions in jcr-rmi javadocs. It works fine
>> with no firewall in the middle.
>> What I'm noticing is that when I run my jcr-rmi service and bind it to
>> JNDI it seems to open an anonymous port on the server. I also see the
>> client trying to connect to this port when I invoke the first operation
>> on the remote Repository instance. But since the port is allocated
>> randomly I can't set a firewall rule for it!
>> Any ideas how to configure this port?
>>
>>
>> Carlos
>>
>
Re: jcr-rmi behind firewall
Posted by Nicolas Toper <nt...@gmail.com>.
You can use a SOCKS library for this if your firewall supports it. SOCKS is
a protocol btw an application and a firewall to negociate a dynamic port.
This is the cleanest solution I think.
There is jSocks for instance which support it.
nico
My blog! http://www.deviant-abstraction.net !!
On 5/19/06, Carlos Villegas <ca...@uniscope.jp> wrote:
>
> Hi,
>
> I've been trying to connect to a jcr-rmi instance running on JBoss
> behind a firewall with no success.
> According to the JBoss documentation, I need to open 3 ports on a
> standard configuration: 1098,1099, and 4444. I've done this and I'm able
> to invoke EJBs through RMI to the server behind the firewall.
> However, it doesn't work for the jcr-rmi server. The jcr-rmi is bound to
> JBoss JNDI as per the instructions in jcr-rmi javadocs. It works fine
> with no firewall in the middle.
> What I'm noticing is that when I run my jcr-rmi service and bind it to
> JNDI it seems to open an anonymous port on the server. I also see the
> client trying to connect to this port when I invoke the first operation
> on the remote Repository instance. But since the port is allocated
> randomly I can't set a firewall rule for it!
> Any ideas how to configure this port?
>
>
> Carlos
>