cancel
Showing results for 
Search instead for 
Did you mean: 

Port already in use error gets repeated

vijiravi22
Champ in-the-making
Champ in-the-making
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,+SS....

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.
3 REPLIES 3

mrogers
Star Contributor
Star Contributor
Very strange.   Never heard anything like that before. :!:

Although I don't think this will affect what you are seeing, you should be configuring alfresco via alfresco-global.properties rather than alfresco-shared.properties or repository.properties.

Is your networking working well when you are not running alfresco?

Then I suspect that your instance of alfresco is not shutting down properly
Check that your instance of Tomcat is shutting down for example check that there is no java process after you shutdown.
Wait a minute.
Then do a netstat -a command to see what is happening on your tcp ports.

vijiravi22
Champ in-the-making
Champ in-the-making
Hi,
Thanks for your reply.
The content i have in alfresco-global.properties is mentioned below:
###############################
## Common Alfresco Properties #
###############################
dir.root=/srv/alfresco/alf_data
db.driver=org.gjt.mm.mysql.Driver
db.url=jdbc:mysql://localhost/alfresco

Please let me know what additional properties have to be moved from alfresco-shared.properties and repository.properties.

abhashree
Champ in-the-making
Champ in-the-making
Hi
sometimes it shows like rmi port is already in use …that means there is an instance of server is running….have you shut down the server properly…check the processes and kill the extra processes…
when this types of problem arises then shut down your system…this may solve the problem..