cancel
Showing results for 
Search instead for 
Did you mean: 

charSet for FTP not accepted

tbee
Champ in-the-making
Champ in-the-making
Alfresco's FTP server per default uses UTF8 on its control channel. Most FTP client's do not (I even had to hack Apache Common-VFS to handle this). So instead of fighting with all clients, I wanted to convince Alfresco 3.2r to use ISO-8859-1. So I created:

C:\Alfresco\tomcat\shared\classes\alfresco\extension\subsystems\fileServers\default\default\custom-file-servers-context.xml
As per documentation:
http://wiki.alfresco.com/wiki/File_Server_Subsystem#Advanced_Spring_Overrides_2

Containing:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING/DTD BEAN//EN"
    "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>

   <bean id="ftpServerConfig" class="org.alfresco.filesys.config.FTPConfigBean">

      <property name="charSet">
         <value>ISO-8859-1</value>
      </property>

   </bean>

</beans>

But that breaks the FTP service.
I also found an example custom-file-servers-context.xml containing all kind of beans (sniplet below) and used a modified version of that.

  …
  <bean id="fileServerConfiguration" class="org.alfresco.filesys.config.ServerConfigurationBean" parent="fileServerConfigurationBase">
      <property name="cifsConfigBean">
         <ref bean="cifsServerConfig" />
      </property>
      <property name="ftpConfigBean">
         <ref bean="ftpServerConfig" />
      </property>
      <property name="nfsConfigBean">
         <ref bean="nfsServerConfig" />
      </property>
      <property name="filesystemContexts">
         <ref bean="filesystemContexts" />
      </property>
      <property name="securityConfigBean">
         <ref bean="fileSecurityConfig" />
      </property>
   </bean>
  …
   <bean id="ftpServerConfig" class="org.alfresco.filesys.config.FTPConfigBean">
      <property name="serverEnabled">
         <value>${ftp.enabled}</value>
      </property>

      <property name="port">
         <value>${ftp.port}</value>
      </property>

      <property name="charSet">
         <value>ISO-8859-1</value>
      </property>

      <!– IPv6 support –>
      <property name="ipv6Enabled">
         <value>${ftp.ipv6.enabled}</value>
      </property>

      <!– FTP authentication –>
      <property name="authenticator">
         <ref bean="FtpAuthenticator" />
      </property>

      <!– FTP server debug settings –>
      <!– Enable 'log4j.logger.org.alfresco.fileserver=debug' in log4j.properties file –>
      <!–
         <property name="debugFlags"> <value>File,Search,Error,Directory,Info,DataPort</value> </property>
      –>

   </bean>

The FTP service is up, but still running UTF8.
What am I doing wrong?
2 REPLIES 2

jmliege
Champ in-the-making
Champ in-the-making
Hi,

you should not trust the documentation… :wink:
It seems that there's a small bug. I'm running with version 3.2 community, and the problem comes from the 'extension' path sent to init the subsystems childApplicationContextFactory.

In fact the default ID is not 'default' but '[default]'. Smiley Surprised

In order to make any change to the fileServers configuration, you have to do it following next rule:

alfresco/extension/subsystems/<category>/<type>/<id>/*-context.xml

which gives

alfresco/extension/subsystems/fileServers/default/[default]/*-context.xml

So for your specific code:

alfresco/extension/subsystems/fileServers/default/[default]/custom-file-servers-context.xml

After searched for two hours… I've finally debugged the org.alfresco.repo.managementsubsystems.ChildApplicationContextFactory. :idea:
I'll send a email to Alfresco to ask them to change either the documentation or the code for having default and not [default].

Perhaps it's already modified in newer version, I don't know. You may have to try out v3.3.

Best regards,
JMarc B.

tbee
Champ in-the-making
Champ in-the-making
Allright then! That explains A LOT of problems I've been having. Thanks!