You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by "kazim_ssuet@yahoo.com" <ka...@yahoo.com> on 2011/04/02 01:34:37 UTC

Connection Refused on Windows 2000 Server...OK on Windows XP

Hi,

I have jackrabbit 1.6.4 WAR installed on windows XP. Since there is windows
firewall enabled on the machine, I had to add
"org.apache.jackrabbit.rmi.port=2800" to Websphere (Application servers >
server1 > Process Definition > Java Virtual Machine > Custom Properties) and
had to open two ports thru windows firewall, rmi registry port (1099) and
org.apache.jackrabbit.rmi.port (2800).
I was accessing it fine from a remote command line client and a remote web
application. Both remote command line client and remote web application
making API calls over RMI.

Then I installed Jackrabbit on one of our servers running Windows 2000
Server.
Although there is no firewall on windows 2000 server, I still added
"org.apache.jackrabbit.rmi.port=2800" to Websphere (Application servers >
server1 > Process Definition > Java Virtual Machine > Custom Properties).
Since there is no firewall I did not open any ports anywhere on the server.

This server also runs the web application that makes API calls to Jackrabbit
over RMI. I can access jackrabbit from the web app installed on the same
machine (on a seperate server instance of the same Websphere network
deployment).
But now my remote command line client cannot login. It finds the repository
in RMI registry but when making login call it fails with this error:

org.apache.jackrabbit.rmi.client.RemoteRepositoryException:
java.rmi.ConnectException: Connection refused to host: csidev4; nested
exception is: 
	java.net.ConnectException: Connection refused: connect
	at
org.apache.jackrabbit.rmi.client.SafeClientRepository.remoteLogin(SafeClientRepository.java:112)
	at
org.apache.jackrabbit.rmi.client.SafeClientRepository.login(SafeClientRepository.java:120)
	at
org.apache.jackrabbit.rmi.client.SafeClientRepository.login(SafeClientRepository.java:131)
	at JackrabbitTest2.detachContentReference(JackrabbitTest2.java:1811)
	at JackrabbitTest2.main(JackrabbitTest2.java:365)
Caused by: java.rmi.ConnectException: Connection refused to host: csidev4;
nested exception is: 
	java.net.ConnectException: Connection refused: connect
	at sun.rmi.transport.tcp.TCPEndpoint.newSocket(Unknown Source)
	at sun.rmi.transport.tcp.TCPChannel.createConnection(Unknown Source)
	at sun.rmi.transport.tcp.TCPChannel.newConnection(Unknown Source)
	at sun.rmi.server.UnicastRef.newCall(Unknown Source)
	at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
	at java.rmi.Naming.lookup(Unknown Source)
	at
org.apache.jackrabbit.rmi.client.ClientRepositoryFactory$1.getRemoteRepository(ClientRepositoryFactory.java:95)
	at
org.apache.jackrabbit.rmi.client.SafeClientRepository.remoteLogin(SafeClientRepository.java:108)
	... 4 more
Caused by: java.net.ConnectException: Connection refused: connect
	at java.net.PlainSocketImpl.socketConnect(Native Method)
	at java.net.PlainSocketImpl.doConnect(Unknown Source)
	at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
	at java.net.PlainSocketImpl.connect(Unknown Source)
	at java.net.Socket.connect(Unknown Source)
	at java.net.Socket.connect(Unknown Source)
	at java.net.Socket.(Unknown Source)
	at java.net.Socket.(Unknown Source)
	at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(Unknown
Source)
	at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(Unknown
Source)
	... 12 more
	

Later I found out that there is no port 2800 in the list of "netstat -a" on
the server which leads to the questions:
1. How is my web application communicating to jackrabbit thru API over RMI
if there is no port 2800 listening?
2. Is there a default behaviour that if API calls are made from local
machine RMI is not used?

There was port 2811 in the list of "netstat -a" so I modified the property
"org.apache.jackrabbit.rmi.port" to 2811...Still no luck, web app is fine
but remote command line client can't login.

I also tried removing "org.apache.jackrabbit.rmi.port" property since there
is no firewall and it should be ok if Jackrabbit uses anonymous port for
login...Still same result.

I am out of options to try, please help.

Thanks,
KS.

--
View this message in context: http://jackrabbit.510166.n4.nabble.com/Connection-Refused-on-Windows-2000-Server-OK-on-Windows-XP-tp3421380p3421380.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.

Re: Connection Refused on Windows 2000 Server...OK on Windows XP

Posted by "kazim_ssuet@yahoo.com" <ka...@yahoo.com>.
Pontus Amberg wrote:
> 
> There's some info about it here 
> http://jackrabbit.510166.n4.nabble.com/RMI-problem-td523318.html
> 

Thanks for the hints. I had slightly different issue but the hints helped. 

I can login now (half the battle), but still need couple of explanations. 

Host running JR (Jackrabbit) has two ip addresses, 172.16.1.xxx and
172.16.1.yyy 
In remote client machine it was defined as 172.16.1.xxx, while the hosts
file on JR machine had  172.16.1.yyy for the hostname...I changed the entry
on remote client and I can login. 

Question 1: Is an IP address picked by a listening port? Shouldn't it accept
connections on both IP addresses that host has? 
Jukka's response in
http://jackrabbit.510166.n4.nabble.com/RMI-problem-td523318.html
 ("By default the RMI server binds itself just to a single IP address")
probably answers that, but just to clearify, is that IP address picked from
the hosts file? And Is there a way to bind to multiple IPs?


Question 2: Why is port that I define as "org.apache.jackrabbit.rmi.port"
not being used? 

I found this line in log (RMIConnectorC A   ADMC0026I: The RMI Connector is
available at port 2812), while "org.apache.jackrabbit.rmi.port" is equal to
2800, which I set using following option in websphere console: 
(Application servers > server1 > Process Definition > Java Virtual Machine >
Custom Properties) 

Is setting the connection port feature not available in 1.6.4? If it is not,
then how would I define a single port for RMI connections rather than using
default anonymous port, in case there is a firewall on jackrabbit host? 

Does seeing this message in log (RMIConnectorC A   ADMC0026I: The RMI
Connector is available at port 2812) mean Jackrabbit is using a preset
single port and not anonymous port for RMI logins? if it is, then where is
this being set (if not thru org.apache.jackrabbit.rmi.port)? 

Thanks, 
KS.

--
View this message in context: http://jackrabbit.510166.n4.nabble.com/Connection-Refused-on-Windows-2000-Server-OK-on-Windows-XP-tp3421380p3429508.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.

Lock/unlock nodes in a clustered environment

Posted by Kl...@signal-iduna.de.
Hello,

we have a problem with locking and unlocking of nodes in our clustered 
environment. We keep getting javax.jcr.lock.LockException: Precondition 
Failed errors caused by  Caused by: 
org.apache.jackrabbit.webdav.DavException: Precondition Failed. We are not 
sure whether this is a communication problem or a session/cluster based 
error. 

We are a using Jackrabbit 2.2.4 deployed as repository server on websphere 
unsing  two cluster nodes which are directly connected to a DB 2 database. 
The errors occur randomly but constantly 
when we execute our testcase trying to add several nodes one after 
another. A JCR-WebDAV .doc stated the error as: 

412 (Precondition Failed) – if the lock token transmitted with the 
TransactionId header is not a transaction lock token or is invalid.

This is how our testcase looks like:


dmsSession = ... .loginRepository();
Node nodeToAddMixin = dmsSession.getNode("Path to node");
if (nodeToAddMixin.canAddMixin(NodeType.MIX_LOCKABLE)) {
        nodeToAddMixin.addMixin(NodeType.MIX_LOCKABLE);
        dmsSession.save();
}

lockManager = dmsSession.getWorkspace().getLockManager();
boolean isLocked = lockManager.isLocked("Path to node");

        ... wait till unlocked

        if (!isLocked) {
                lock = lockManager.lock("Path to node", true, false, 10, 
"");
                lockManager.addLockToken(lock.getLockToken());
      }

        ... do stuff with locked node

       if (lockManager != null) {
            try {
                if (lockManager.isLocked("Path to node")) {
                    if (dmsSession.hasPendingChanges()) {
                        dmsSession.save();
                    }
                    lockManager.unlock("Path to node");
                }
            } catch (RepositoryException e) {
                dmsSession.logout();
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
        }

dmsSession.save();
dmsSession.logout();


Does somebody know about bugs in the communication layer or obvious 
programming mistakes we might have made?


Greets

Klemens Letulé





SIGNAL Krankenversicherung a. G., Sitz: Dortmund, HR B 2405, AG Dortmund
IDUNA Vereinigte Lebensversicherung aG für Handwerk, Handel und Gewerbe,
Sitz: Hamburg, HR B 2740, AG Hamburg
Deutscher Ring Krankenversicherungsverein a.G., Sitz: Hamburg,
HR B 4673, AG Hamburg,
SIGNAL IDUNA Allgemeine Versicherung AG, Sitz: Dortmund, HR B 19108, 
AG Dortmund
Vorstände: Reinhold Schulte (Vorsitzender),
Dr. Karl-Josef Bierth,Jens O. Geldmacher, Marlies Hirschberg-Tafel,
Michael Johnigk, Ulrich Leitermann, Michael Petmecky,
Dr. Klaus Sticker, Prof. Dr. Markus Warg 
Vorsitzender der Aufsichtsräte: Günter Kutz
SIGNAL IDUNA Gruppe Hauptverwaltungen, Internet: www.signal-iduna.de
44121 Dortmund, Hausanschrift: Joseph-Scherer-Str. 3, 44139 Dortmund
20351 Hamburg, Hausanschrift: Neue Rabenstraße 15-19, 20354 Hamburg


Re: Connection Refused on Windows 2000 Server...OK on Windows XP

Posted by Pontus Amberg <po...@comhem.se>.
Have you tried to specify "java.rmi.server.hostname" when starting the 
server on the Windows 2000 machine?
There's some info about it here 
http://jackrabbit.510166.n4.nabble.com/RMI-problem-td523318.html

/Pontus

On 2011-04-04 16:18, kazim_ssuet@yahoo.com wrote:
> Any ideas/suggestions?
>
> Thanks,
> KS.
>
> --
> View this message in context: http://jackrabbit.510166.n4.nabble.com/Connection-Refused-on-Windows-2000-Server-OK-on-Windows-XP-tp3421380p3425603.html
> Sent from the Jackrabbit - Users mailing list archive at Nabble.com.
>


Re: Connection Refused on Windows 2000 Server...OK on Windows XP

Posted by "kazim_ssuet@yahoo.com" <ka...@yahoo.com>.
Any ideas/suggestions?

Thanks,
KS.

--
View this message in context: http://jackrabbit.510166.n4.nabble.com/Connection-Refused-on-Windows-2000-Server-OK-on-Windows-XP-tp3421380p3425603.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.