Solution Hi I created a servlet which changes ownership of the file across files. But the servlet when deployed on TomCat5.0 shows the error java.lan.NullPointer Exception. Kindly advise the solution I have pasted the line where the error has occured!!! for furher querries please conatct me at pm.sainath@polaris.co.in or prav_veen@yahoo.com please help me as it is very urgent. There is a deadline to be complied with. If i fail, i will not be alive to see the next day. The following is the line where the error has occured: String s = httpservletrequest.getParameter("MasterShipFile").trim();
More>>

Solution

Hi I created a servlet which changes ownership of the file across files.
But the servlet when deployed on TomCat5.0 shows the error java.lan.NullPointer Exception.

Kindly advise the solution
I have pasted the line where the error has occured!!!
for furher querries please conatct me at pm.sainath@polaris.co.in
or prav_veen@yahoo.com
please help me as it is very urgent. There is a deadline to be complied with.
If i fail, i will not be alive to see the next day.

There probably a parameter in the request named MasterShipFile, before you perform a trim on your String you should first check for null as request.getParameter("paramName") will return null if there is no parameter with paramName in the request. And as you know you can't trim null.