Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [ptp-dev] Problems with null pointer exceptions in PTP 2.0 RSEFileSystem.getStore on AIX

Greg
This turns out to be a problem with my code. There is a PE option in my 
resource tab panel that is an AIX only option and which is the relative 
pathname to a log file that PE is to create. I'm trying to validate that 
relative pathname on the remote system and that's where I am getting the 
null pointer execption. Since this is a relative pathname, I should not be 
trying to validate it at all and will have to fix my code to eliminate 
that validation.

I think I pretty much have to restrict any pathnames to be absolute paths 
since the current working directory when my proxy starts can, and probably 
will be different than what the current working directory will be when the 
application runs. Since the PE options apply to the application and the 
current working directory that applies to the PE options will be the 
application's current working directory, I think allowing relative 
pathnames will only confuse the user and make validation difficult.
Dave



Greg Watson <g.watson@xxxxxxxxxxxx> 
Sent by: ptp-dev-bounces@xxxxxxxxxxx
09/17/2008 08:22 AM
Please respond to
Parallel Tools Platform general developers <ptp-dev@xxxxxxxxxxx>


To
Parallel Tools Platform general developers <ptp-dev@xxxxxxxxxxx>
cc

Subject
Re: [ptp-dev] Problems with null pointer exceptions in PTP 2.0 
RSEFileSystem.getStore on AIX






Dave,

If you want to keep the path relative, you could also try changing 
getWorkingDirectory() to something like:

try {
IHostShell cmd = connection.getRemoteShellService().runCommand("", "pwd", 
new String[0], new NullProgressMonitor());
String path = cmd.getStandardOutputReader().readLine().getString().trim();
return new Path(path);
} catch (SystemMessageException e) {
return new Path("/");
}

Greg

On Sep 17, 2008, at 8:12 AM, Greg Watson wrote:

Probably a better solution is to add:

if (!path.isAbsolute()) {
path = getWorkingDirectory().append(path);
}

just before the return. However, that probably won't solve your problem 
though, because there doesn't seem to be any way to get the working 
directory in RSE so it still won't be able to find the file. You really 
need to supply the absolute path to the file you're trying to check for. 

Greg

On Sep 17, 2008, at 7:58 AM, Greg Watson wrote:

Dave,

Can you try changing the return in RSEFileManager.toURI to:

return new URI("rse", connection.getHost().getHostName(), 
path.makeAbsolute().toPortableString(), null); //$NON-NLS-1$

Let me know what happens.

Greg

On Sep 16, 2008, at 11:10 PM, Dave Wootton wrote:


I'm trying to run my PTP 2.0 plugins on AIX and am having problems with 
lots of null pointer exceptions when filling in a launch configuration 
that I'm not seeing on Linux  that have the following few methods at the 
top of the traceback 
java.lang.NullPointerException 
        at 
org.eclipse.core.internal.filesystem.NullFileSystem.getStore(NullFileSystem.java:52) 

        at 
org.eclipse.rse.internal.efs.RSEFileSystem.getStore(RSEFileSystem.java:88) 

        at 
org.eclipse.ptp.remote.rse.RSEFileManager.getResource(RSEFileManager.java:74) 

        at 
org.eclipse.ptp.rm.ibm.pe.ui.rmLaunchConfiguration.PERMLaunchConfigurationDynamicTab.validateOutputPath(PERMLaunchConfigurationDynamicTab.java:2751) 

        at 
org.eclipse.ptp.rm.ibm.pe.ui.rmLaunchConfiguration.PERMLaunchConfigurationDynamicTab.validateOutputPath(PERMLaunchConfigurationDynamicTab.java:2694) 

        at 
org.eclipse.ptp.rm.ibm.pe.ui.rmLaunchConfiguration.PERMLaunchConfigurationDynamicTab.validateMiscTab(PERMLaunchConfigurationDynamicTab.java:2644) 

        at 
org.eclipse.ptp.rm.ibm.pe.ui.rmLaunchConfiguration.PERMLaunchConfigurationDynamicTab.validateAllFields(PERMLaunchConfigurationDynamicTab.java:2451) 

        at 
org.eclipse.ptp.rm.ibm.pe.ui.rmLaunchConfiguration.PERMLaunchConfigurationDynamicTab$EventMonitor.modifyText(PERMLaunchConfigurationDynamicTab.java:679) 


I downloaded the PTP code from CVS using the PTP 2.0 tag to try to debug 
this. It looks like the reason I'm getting the null pointer exception is 
because there's a call to RSEFileManager.toURI where a URISyntaxException 
is caught and that method returns null. The IPath object that's passed to 
toURI has a device=null and a segments array with a single String element 
with value pmadjpri.log. 
The detail message in the URISyntaxException is "Relative path in absolute 
URI". The input variable in the URIException object is 
rse://K17SF2P01.PPD.POK.IBM.COMpmadjpri.log 

Is this exception being thrown because of something missing out of the 
pathname (it looks like '/' or ':' might be missing)? 

Note: The pmadjpri.log is passed in as a String parameter (path name) to 
my method 
org.eclipse.ptp.rm.ibm.pe.ui.PERMLaunchConfigurationDynamicTab.validateOutputPath 
at line 2740 where I'm trying to validate a pathname on the remote system. 
Am I doing something invalid in that method? 

Dave_______________________________________________
ptp-dev mailing list
ptp-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ptp-dev

_______________________________________________
ptp-dev mailing list
ptp-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ptp-dev

_______________________________________________
ptp-dev mailing list
ptp-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ptp-dev
_______________________________________________
ptp-dev mailing list
ptp-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ptp-dev




Back to the top