cancel
Showing results for 
Search instead for 
Did you mean: 

FTP Socket Error

s0110655
Champ in-the-making
Champ in-the-making
Hello,

When I try to run the sample code of the Alfresco tutorial, I receive an ftp error:

10:08:42,500 ERROR [alfresco.ftp.protocol] FTP Socket error
java.net.BindException: Address already in use: JVM_Bind
   at java.net.PlainSocketImpl.socketBind(Native Method)
   at java.net.PlainSocketImpl.bind(Unknown Source)
   at java.net.ServerSocket.bind(Unknown Source)
   at java.net.ServerSocket.<init>(Unknown Source)
   at java.net.ServerSocket.<init>(Unknown Source)
   at org.alfresco.filesys.ftp.FTPNetworkServer.run(FTPNetworkServer.java:377)
   at java.lang.Thread.run(Unknown Source)


Any ideas?

Steven
8 REPLIES 8

kevinr
Star Contributor
Star Contributor
This means another application on the same machine is already using port 21 - the FTP server port. Are you running another FTP server or maybe IIS?

Thanks,

Kevin

s0110655
Champ in-the-making
Champ in-the-making
Hi,

I had a Apache HTTP server running, but I don't need it any more so I have removed it now.  I have 2 Tomcat application servers running: one 5.5.9 where I already deployed another application on before I started using Alfresco.  I had some difficulties for deploying Alfresco on an already installed Tomcat, so I followed the default steps from the tutorial (assumption that no mySQL DB or tomcat was installed yet). The original Tomcat 5.5.9 must be started manually and is not running when I run my code.  I also executed netstat -a to see which ports are used.  It seems that the ftp port is not yet taken by any proces:

Proto  Lokaal adres           Extern adres           Status
TCP    laptop-steven:22       laptop-steven:0        Bezig met luisteren
TCP    laptop-steven:epmap    laptop-steven:0        Bezig met luisteren
TCP    laptop-steven:microsoft-ds  laptop-steven:0        Bezig met luisteren
TCP    laptop-steven:3260     laptop-steven:0        Bezig met luisteren
TCP    laptop-steven:3261     laptop-steven:0        Bezig met luisteren
TCP    laptop-steven:3306     laptop-steven:0        Bezig met luisteren
TCP    laptop-steven:52673    laptop-steven:0        Bezig met luisteren
TCP    laptop-steven:netbios-ssn  laptop-steven:0        Bezig met luisteren
TCP    laptop-steven:1025     laptop-steven:0        Bezig met luisteren
TCP    laptop-steven:1031     laptop-steven:0        Bezig met luisteren
TCP    laptop-steven:1035     laptop-steven:0        Bezig met luisteren
TCP    laptop-steven:1137     laptop-steven:0        Bezig met luisteren
UDP    laptop-steven:microsoft-ds  *:*
UDP    laptop-steven:isakmp   *:*
UDP    laptop-steven:1026     *:*
UDP    laptop-steven:4500     *:*
UDP    laptop-steven:ntp      *:*
UDP    laptop-steven:netbios-ns  *:*
UDP    laptop-steven:netbios-dgm  *:*
UDP    laptop-steven:1900     *:*
UDP    laptop-steven:ntp      *:*
UDP    laptop-steven:1593     *:*
UDP    laptop-steven:1900     *:*

When I run alf_start.bat and again execute netstat -a, I see that the ftp port is added to the list…

What do you think?

gary_spencer
Champ in-the-making
Champ in-the-making
Hi,

Could you email your alfresco.log file so I can see if there is some other error that may be causing the problem.

Thanks

Gary

s0110655
Champ in-the-making
Champ in-the-making
Hello,

Here is a printout from my Alfresco.log file:

08:41:14,656 INFO  [org.alfresco.repo.admin.patch.PatchExecuter] Checking for patches to apply …
08:41:14,750 INFO  [org.alfresco.repo.admin.patch.PatchExecuter] No patches were required.
08:41:15,421 INFO  [org.alfresco.service.descriptor.DescriptorService] Alfresco JVM - v1.5.0_04-b05; maximum heap size 506,313MB
08:41:15,437 INFO  [org.alfresco.service.descriptor.DescriptorService] Alfresco started (Community Network): Current version 1.2.0 schema 6 - Installed version 1.2.0 schema 6
09:15:57,578 INFO  [org.alfresco.repo.admin.patch.PatchExecuter] Checking for patches to apply …
09:15:57,828 INFO  [org.alfresco.repo.admin.patch.PatchExecuter] No patches were required.
09:15:58,250 INFO  [org.alfresco.service.descriptor.DescriptorService] Alfresco JVM - v1.5.0_04-b05; maximum heap size 506,313MB
09:15:58,250 INFO  [org.alfresco.service.descriptor.DescriptorService] Alfresco started (Community Network): Current version 1.2.0 schema 6 - Installed version 1.2.0 schema 6
09:30:05,718 INFO  [org.alfresco.repo.admin.patch.PatchExecuter] Checking for patches to apply …
09:30:05,921 INFO  [org.alfresco.repo.admin.patch.PatchExecuter] No patches were required.
09:30:06,359 INFO  [org.alfresco.service.descriptor.DescriptorService] Alfresco JVM - v1.5.0_04-b05; maximum heap size 506,313MB
09:30:06,375 INFO  [org.alfresco.service.descriptor.DescriptorService] Alfresco started (Community Network): Current version 1.2.0 schema 6 - Installed version 1.2.0 schema 6
09:43:16,859 INFO  [org.alfresco.repo.admin.patch.PatchExecuter] Checking for patches to apply …
09:43:16,937 INFO  [org.alfresco.repo.admin.patch.PatchExecuter] No patches were required.
09:43:17,140 INFO  [org.alfresco.service.descriptor.DescriptorService] Alfresco JVM - v1.5.0_04-b05; maximum heap size 506,313MB
09:43:17,140 INFO  [org.alfresco.service.descriptor.DescriptorService] Alfresco started (Community Network): Current version 1.2.0 schema 6 - Installed version 1.2.0 schema 6
09:51:08,671 INFO  [org.alfresco.repo.admin.patch.PatchExecuter] Checking for patches to apply …
09:51:08,734 INFO  [org.alfresco.repo.admin.patch.PatchExecuter] No patches were required.
09:51:08,937 ERROR [org.alfresco.ftp.protocol] FTP Socket error
java.net.BindException: Address already in use: JVM_Bind
   at java.net.PlainSocketImpl.socketBind(Native Method)
   at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:359)
   at java.net.ServerSocket.bind(ServerSocket.java:319)
   at java.net.ServerSocket.<init>(ServerSocket.java:185)
   at java.net.ServerSocket.<init>(ServerSocket.java:141)
   at org.alfresco.filesys.ftp.FTPNetworkServer.run(FTPNetworkServer.java:377)
   at java.lang.Thread.run(Thread.java:595)
09:51:08,937 INFO  [org.alfresco.service.descriptor.DescriptorService] Alfresco JVM - v1.5.0_04-b05; maximum heap size 506,313MB
09:51:08,953 INFO  [org.alfresco.service.descriptor.DescriptorService] Alfresco started (Community Network): Current version 1.2.0 schema 6 - Installed version 1.2.0 schema 6
09:57:14,000 INFO  [org.alfresco.repo.admin.patch.PatchExecuter] Checking for patches to apply …
09:57:14,187 INFO  [org.alfresco.repo.admin.patch.PatchExecuter] No patches were required.
09:57:14,578 INFO  [org.alfresco.service.descriptor.DescriptorService] Alfresco JVM - v1.5.0_04-b05; maximum heap size 506,313MB
09:57:14,625 INFO  [org.alfresco.service.descriptor.DescriptorService] Alfresco started (Community Network): Current version 1.2.0 schema 6 - Installed version 1.2.0 schema 6
10:00:18,906 INFO  [org.alfresco.repo.admin.patch.PatchExecuter] Checking for patches to apply …
10:00:19,343 INFO  [org.alfresco.repo.admin.patch.PatchExecuter] No patches were required.
10:00:23,312 INFO  [org.alfresco.service.descriptor.DescriptorService] Alfresco JVM - v1.5.0_04-b05; maximum heap size 506,313MB
10:00:23,328 INFO  [org.alfresco.service.descriptor.DescriptorService] Alfresco started (Community Network): Current version 1.2.0 schema 6 - Installed version 1.2.0 schema 6
16:14:05,343 INFO  [org.alfresco.repo.admin.patch.PatchExecuter] Checking for patches to apply …
16:14:05,453 INFO  [org.alfresco.repo.admin.patch.PatchExecuter] No patches were required.
16:14:06,421 INFO  [org.alfresco.service.descriptor.DescriptorService] Alfresco JVM - v1.5.0_04-b05; maximum heap size 506,313MB
16:14:06,421 INFO  [org.alfresco.service.descriptor.DescriptorService] Alfresco started (Community Network): Current version 1.2.0 schema 6 - Installed version 1.2.0 schema 6
16:32:06,687 INFO  [org.alfresco.repo.admin.patch.PatchExecuter] Checking for patches to apply …
16:32:06,796 INFO  [org.alfresco.repo.admin.patch.PatchExecuter] No patches were required.
16:32:07,046 INFO  [org.alfresco.service.descriptor.DescriptorService] Alfresco JVM - v1.5.0_04-b05; maximum heap size 506,313MB
16:32:07,046 INFO  [org.alfresco.service.descriptor.DescriptorService] Alfresco started (Community Network): Current version 1.2.0 schema 6 - Installed version 1.2.0 schema 6

I hope this can help.

Thanks!
Steven

gary_spencer
Champ in-the-making
Champ in-the-making
Hi,

How are you stopping/starting Alfresco/Tomcat ?, are you redeploying the Alfresco war file ?.

Cheers

Gary

s0110655
Champ in-the-making
Champ in-the-making
Hi,

I run the alf_start.bat file to start Alfresco and the alf_stop.bat file to stop Alfresco.  The only thing that alf_start.bat does is calling the alfresco.bat file whos content is printed below:

@echo off
rem —————————————————————————
rem Start script for the Alfresco Server
rem —————————————————————————

set CATALINA_HOME=C:\alfresco\tomcat

rem Set any default JVM options
set JAVA_OPTS=-Xms128m -Xmx512m -Xss64k -server

rem — If SetPaths.bat already exists - assume set by hand and use as is
if not exist "SetPaths.bat" goto getpaths
call SetPaths.bat
goto start

:getpaths
call RegPaths.exe
call SetPaths.bat
del SetPaths.bat

:start
set PATH=%JAVA_HOME%/bin:%PATH%
rem —————————————
rem Start Components
rem —————————————

if not ""%1"" == ""start"" goto nostart

rem —————————————
rem Start Tomcat
rem —————————————

echo Starting Tomcat…
call "%CATALINA_HOME%\bin\startup.bat"

rem —————————————
rem Start OpenOffice for transformations
rem —————————————
if exist "start_oo.bat" call "start_oo.bat"

goto nostop
:nostart

rem —————————————
rem Stop Components
rem —————————————

if not ""%1"" == ""stop"" goto nostop

echo Shutting down Tomcat…
call %CATALINA_HOME%\bin\shutdown.bat

rem —————————————
rem Stop OpenOffice for transformations
rem —————————————
if exist "start_oo.bat" c:\windows\system32\taskkill /f /im soffice.bin

:nostop


I hope this can help you.

Thanks!
Steven

gary_spencer
Champ in-the-making
Champ in-the-making
Hi Steven,

After you stop Alfresco/Tomcat can you run a netstat -an and check if the FTP server port is still in use. If it is still in use can you check if there is a Tomcat process still running (the image name will be java.exe in the process list).

You could also try changing the FTP server port in the classes/alfresco/file-servers.xml file, add <port>1021</port> to the "FTP Server" configuration section. That would help to rule out that it's not another application that's using the port if the JVM_Bind error still occurs.

Cheers

Gary

s0110655
Champ in-the-making
Champ in-the-making
Hi,

I changed the port number in the xml file like you suggested and it works now.

Thank you!
Steven
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.