Bug 196632 - [ftp] Passive mode setting does not work
Summary: [ftp] Passive mode setting does not work
Status: RESOLVED FIXED
Alias: None
Product: Target Management
Classification: Tools
Component: RSE (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows XP
: P2 major (vote)
Target Milestone: 2.0.1   Edit
Assignee: David McKnight CLA
QA Contact: Martin Oberhuber CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-07-16 07:39 EDT by Martin Oberhuber CLA
Modified: 2007-08-01 11:19 EDT (History)
2 users (show)

See Also:
javier.montalvoorus: review+


Attachments
patch to review (2.18 KB, patch)
2007-07-31 12:02 EDT, David McKnight CLA
no flags Details | Diff
updated patch (3.96 KB, patch)
2007-07-31 14:01 EDT, David McKnight CLA
no flags Details | Diff
updated patch dealing with wizard selection issues (6.70 KB, patch)
2007-07-31 16:14 EDT, David McKnight CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Oberhuber CLA 2007-07-16 07:39:22 EDT
Craig Setera wrote:
I'm playing with Target Management and I definitely like the concept.  I 
created an FTP connection to my web hosting site and specified a passive 
connection.  It worked fine for a while, but now it won't work anymore. 
If I look in the properties, I see that it is still specified as 
passive, but TM is always initiating a non-passive connection and I get:

PORT 192,168,0,22,14,66
500 I won't open a connection to 192.168.0.22 (only to xxx.xxx.xxx.xxx)

in the console.

-----------Enter bugs above this line-----------
TM 2.0
installation : eclipse-SDK-3.3 (I20070625-1500), cdt-4.0.0, emf-2.3.0
RSE install  : workspace HEAD
java.runtime : Sun 1.6.0_01-b06
os.name:     : Windows XP 5.1, Service Pack 1
------------------------------------------------
systemtype   : Windows-local, Dstore-win, Dstore-linux
targetos     : Red Hat Enterprise Linux WS release 4 (Nahant Update 3)
targetuname  : Linux parser 2.6.9-34.EL #1 i686 athlon i386 GNU/Linux
targetvm     : Sun Java HotSpot(TM) Client VM (build 1.4.2_12-b03, mixed mode)
------------------------------------------------
Comment 1 Martin Oberhuber CLA 2007-07-16 07:41:54 EDT
I could reproduce this issue and it looks like a bug. When I look into the Subsystem Properties, it says "passive"="true" but according to FTP Console it does not initiate a passive mode connection. Switching subsystem properties to "false" and back to "true" does not help.

This might be a problem with instantiating the PropertySet at the wrong time, and using a wrong propertySet in the ConnectorService (since the correct one appears to be used in the Property Page). Adding Dave D on CC.

For me, it looks like FTPConnectorSerivice.java line 99,
    _ftpService.setPropertySet(_propertySet);
should be changed to
    _ftpService.setPropertySet(getPropertySet("FTP Settings"));
Comment 2 Javier Montalvo Orús CLA 2007-07-17 12:22:04 EDT
It looks like a change of behaviour in the PropertySets during the wizard.
Debugging it, getPropertySet("FTP Settings") returns null, even after having filled the properties in the wizard page.

DaveD: Do you know what could be causing it ?
Comment 3 David Dykstal CLA 2007-07-17 13:58:33 EDT
I'll take a look.
Comment 4 Javier Montalvo Orús CLA 2007-07-25 13:55:34 EDT
Any update on this ?

The FTP Properties displayed in RSE are not the same as the ones applied to the FTPClient.
It means that even the user changes the active/passive mode or the parser, those changes are not applied to the FTP client.
Comment 5 Martin Oberhuber CLA 2007-07-27 13:28:42 EDT
Dave you've been most successful finding issues with the PropertySets in the past -- Javier and I both don't understand where that issue comes from.

Could you please take a look. This is a major functionality issue.
Comment 6 David McKnight CLA 2007-07-30 11:58:50 EDT
The problem is that in the FTPConnectorService constructor we're trying to get the "FTP Settings" property set and store it in the _propertySet variable.  What happens is, if the property set cannot be found, a default one is created.  However, the property sets for a model object are not created until after the constructor for a model object is called, so we end up storing this default property set before the real one gets created and associated.  Instead of creating the property set in the constructor, this should be deferred until it is needed.  I'll attach a patch that describes one resolution to this problem.

Comment 7 David McKnight CLA 2007-07-30 15:21:53 EDT
(In reply to comment #4)
> Any update on this ?
> 
> The FTP Properties displayed in RSE are not the same as the ones applied to the
> FTPClient.
> It means that even the user changes the active/passive mode or the parser,
> those changes are not applied to the FTP client.
> 

Comment 8 David McKnight CLA 2007-07-31 12:02:29 EDT
Created attachment 75052 [details]
patch to review
Comment 9 Javier Montalvo Orús CLA 2007-07-31 13:03:00 EDT
With the patch, the "FTP Settings" PropertySet is no longer available, neither in the FTP wizard or in the the subsystem properties.
Any idea ? 
Comment 10 David McKnight CLA 2007-07-31 14:01:37 EDT
Created attachment 75066 [details]
updated patch

Try this.  I think the problem was that the property isn't created initially when you have the wizard.  This update doesn't store the property set separately so we update the proper one.
Comment 11 Javier Montalvo Orús CLA 2007-07-31 14:20:45 EDT
Now the settings specified on the wizard are not moved to the created FTP connection.
To reproduce, create a new FTP connection and modify the default "FTP Settings" (passive and/or parser)
Once created, the FTP Settings are reset to the default ones.
Comment 12 David McKnight CLA 2007-07-31 15:07:24 EDT
It seems okay to me.  Are you seeing this when you open up the property page after creating the connection?
Comment 13 David McKnight CLA 2007-07-31 15:30:52 EDT
Hmm, sometimes this works and other times it doesn't.  This is looking like it's intermittent.
Comment 14 David McKnight CLA 2007-07-31 16:14:53 EDT
Created attachment 75077 [details]
updated patch dealing with wizard selection issues
Comment 15 David McKnight CLA 2007-07-31 16:17:03 EDT
There appears to be an additional problem with the wizard here.  Properties were not being applied in the wizard because selected ServiceElements did not have their _isSelected property set properly.  Does this work for you?
Comment 16 Javier Montalvo Orús CLA 2007-08-01 05:45:37 EDT
It works fine now.
The property set in the wizard is correctly moved to the created FTP client.

I'll apply the patch, thanks !
Comment 17 Javier Montalvo Orús CLA 2007-08-01 11:19:11 EDT
Now the FTP settings of the wizard are passed to the created connection.