Bug 200734 - [ftp] NPE when deleting profile that has active connection
Summary: [ftp] NPE when deleting profile that has active connection
Status: ASSIGNED
Alias: None
Product: Target Management
Classification: Tools
Component: RSE (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Javier Montalvo Orús CLA
QA Contact: Martin Oberhuber CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-08-21 17:26 EDT by Kevin Doyle CLA
Modified: 2007-10-19 10:42 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin Doyle CLA 2007-08-21 17:26:38 EDT
When deleting a profile that has an active ftp connection I get a NPE.

java.lang.NullPointerException
at org.eclipse.rse.internal.services.files.ftp.FTPService.disconnect(FTPService.java:376)
at org.eclipse.rse.internal.subsystems.files.ftp.connectorservice.FTPConnectorService.internalDisconnect(FTPConnectorService.java:142)
at org.eclipse.rse.core.subsystems.AbstractConnectorService.disconnect(AbstractConnectorService.java:425)
at org.eclipse.rse.core.subsystems.SubSystem.internalDisconnect(SubSystem.java:2550)
at org.eclipse.rse.core.subsystems.SubSystem$DisconnectJob.performOperation(SubSystem.java:1627)
at org.eclipse.rse.core.subsystems.SubSystem$SubSystemOperationJob.run(SubSystem.java:1293)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

Steps to Reproduce:
1. Create a new profile.
2. Create a new connection for that profile.
3. Connect to the new connection.
4. Delete the profile.

-----------Enter bugs above this line-----------
TM 2.0.1 Testing
installation : eclipse-SDK-3.3
RSE install  : Dev Driver - 
java.runtime : Sun 1.5.0_11-b03
os.name:     : Windows XP, Service Pack 2
------------------------------------------------
Comment 1 Javier Montalvo Orús CLA 2007-10-17 13:57:41 EDT
I cannot reproduce this issue. Possibly it's been fixed by something else in the meantime.
Kevin, can you still get the NPE ?
Comment 2 Kevin Doyle CLA 2007-10-18 09:45:39 EDT
This happens for me all the time on one of my ftp servers, but doesn't happen on any of the others.  It's running Pure-FTPd.  Another ftp server running Pure-FTPd works fine though.
Comment 3 Kevin Doyle CLA 2007-10-19 10:42:33 EDT
When debugging I get a slightly different exception stack trace:

java.lang.NullPointerException
at org.apache.commons.net.ftp.FTP.sendCommand(FTP.java:441)
at org.apache.commons.net.ftp.FTP.sendCommand(FTP.java:520)
at org.apache.commons.net.ftp.FTP.sendCommand(FTP.java:569)
at org.apache.commons.net.ftp.FTP.noop(FTP.java:1463)
at org.apache.commons.net.ftp.FTPClient.sendNoOp(FTPClient.java:1924)
at org.eclipse.rse.internal.services.files.ftp.FTPService.getFTPClient(FTPService.java:476)
at org.eclipse.rse.internal.services.files.ftp.FTPService.disconnect(FTPService.java:441)
at org.eclipse.rse.internal.subsystems.files.ftp.connectorservice.FTPConnectorService.internalDisconnect(FTPConnectorService.java:168)
at org.eclipse.rse.core.subsystems.AbstractConnectorService.disconnect(AbstractConnectorService.java:425)
at org.eclipse.rse.core.subsystems.SubSystem.internalDisconnect(SubSystem.java:2550)
at org.eclipse.rse.core.subsystems.SubSystem$DisconnectJob.performOperation(SubSystem.java:1627)
at org.eclipse.rse.core.subsystems.SubSystem$SubSystemOperationJob.run(SubSystem.java:1293)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

SubSystemConfiguration.deleteSubSystemsByConnection(IHost) checks if the file subsystem is connected and since it is schedules a job to do the disconnect.  A few lines lower deleteSubSystem(ISubSystem) is called which also checks if the subsystem is connected and since it is, it schedules a disconnect job.  The first thread to do the disconnect works fine.  The second thread throws the NPE.