AnsweredAssumed Answered

Port already in use error gets repeated

Question asked by vijiravi22 on Jul 2, 2010
Latest reply on Aug 25, 2010 by abhashree
Hi,
I have performed custom installation of Alfresco 3.3 Community Edition and deployed its WAR file inside my web application's <tomcat home>/webapps folder.
I started tomcat server and alfresco web client page opened and worked as expected. Then i tried to integrate LDAP and SSO to Alfresco 3.3 using the steps in Integration of Alfresco (Web Client), SSO and LDAP of URL http://www.liferay.com/web/guest/community/wiki/-/wiki/Main/Full+Integration+-+Liferay,+Alfresco,+SSO+and+LDAP.

After integrating and deploying the updated WAR file in tomcat, i started tomcat server. It gave me the following error:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'registry' defined in class path resource [alfresco/core-services-context.xml]: Invocation of init method failed; nested exception is java.rmi.server.ExportException: Port already in use: 50500; nested exception is:
        java.net.BindException: Address already in use

Predicting that this could be a port conflict, i changed the entry in alfresco-shared.properties:
alfresco.rmi.services.port=60600

Then on restarting the server, i have received the same "Port Already In Use" Error for a different port number:
SEVERE: Exception sending context initialized event to listener instance of class org.alfresco.web.app.ContextListener org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'avmRemoteService' defined in class path resource [alfresco/remote-services-context.xml]: Invocation of init method failed; nested exception is java.rmi.server.ExportException: Port already in use: 50501; nested exception is: java.net.BindException: Address already in use

I resolved it by specifying the port number as 0 for avm.rmi.service.port in repository.properties:
avm.rmi.service.port=0

On restarting the tomcat server, the same error prompted for port 50502:
SEVERE: Exception sending context initialized event to listener instance of class org.alfresco.web.app.ContextListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'avmSyncServiceTransportRMI' defined in class path resource [alfresco/remote-services-context.xml]: Invocation of init method failed; nested exception is java.rmi.server.ExportException: Port already in use: 50502; nested exception is:
        java.net.BindException: Address already in use

and same happened for ports 50503,…50508. So i modified the following set of port numbers to 0 in repository.properties:
avm.rmi.service.port=0
avmsync.rmi.service.port=0
attribute.rmi.service.port=0
authentication.rmi.service.port=0
repo.rmi.service.port=0
action.rmi.service.port=0
deployment.rmi.service.port=0
monitor.rmi.service.port=0

Now when i restart the server, i get the same error for the port 60600 (modified port number instead of 50500).
After integrating and deploying the updated WAR file in tomcat, i started tomcat server. It gave me the following error:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'registry' defined in class path resource [alfresco/core-services-context.xml]: Invocation of init method failed; nested exception is java.rmi.server.ExportException: Port already in use: 60600; nested exception is:
        java.net.BindException: Address already in use


Now i had to go back to alfresco-shared.properties and change the port number to 60700. When i do any change and deploy alfresco.war again and start tomcat, i get same error for the port number 60700. Since i have used random port number 0 for other rmi services mentioned above, they do not prompt for an error again. But "Error creating bean with name 'registry' defined in class path resource [alfresco/core-services-context.xml]: Invocation of init method failed; nested exception is java.rmi.server.ExportException: Port already in use: 60600; nested exception is:
        java.net.BindException: Address already in use" this error gets repeated for the modified port numbers every time i do some change and restart tomcat.

Why is this happening? Is this because the port number is left open even after the tomcat gets restarted?  I am connecting to remote linux server, installing & integrating alfresco in that linux server and i am testing the URL <server name>:8080/alfresco in my local machine(windows XP)

To my surprise, this error gets vanished if the linux server is restarted. However if i do any other change, reploy the war file and restart tomcat, this "Port Already In Use" error appears again. Please let me know how to solve this issue.

Outcomes