File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Internal Server Error - Null Pointer Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Internal Server Error - Null Pointer" Watch "Internal Server Error - Null Pointer" New topic
Author

Internal Server Error - Null Pointer

Dave Comeau
Greenhorn

Joined: Jun 14, 2002
Posts: 27
Hi,
I'm trying to modify the FedEX API sample code from an applet to a servlet. I'm running into an error, which I can't decipher at all.
If anyone can point me in the right direction in trying to figure out this error, it would be great.
Some background, the file compiles fine, and I can even import com.fedex.api.*; in my servlet without problems, but when I actually call the FedExAPI method the servlet throws the internal server error.
The method FedExAPI.transact interacts with a server that I am running, and returns a byte array. The server is running fine, since I can run the applet test code and get a response from it.
Here is the code

Here is the error I get when I try to access the servlet in my browser.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12675
    
    5
So - what is in line 41 that could be null??
Why don't you have try/catch provision in your doGet for better error reporting?
Bill
Dave Comeau
Greenhorn

Joined: Jun 14, 2002
Posts: 27
Well, here is line 41 from my text editor.

I don't know how to add a try/catch to my doGet. I just gave it a go and got an exception is never thrown in the body error on compile. I'll hunt around on how to do that, and see what happens.
Thanks!
Dave Comeau
Greenhorn

Joined: Jun 14, 2002
Posts: 27
Adding the correct try/catch got rid of that horrible error that the browser spit out.
Thanks!
Now, in my log file, I see my real problem, I think.

I'm trying to grant all permissions to my webapps with no luck. I'm on an Ensim server, and their setup is custom and hard to follow. I think I'm on the right track though...
Thanks again.
Dave Comeau
Greenhorn

Joined: Jun 14, 2002
Posts: 27
Got the permissions fixed. The FedEx API need all socket permissions granted.
Thanks again!
raj guntupalli
Greenhorn

Joined: Dec 16, 2002
Posts: 27
Thank you very much.The error is where you have said.I tried to find out the error by using a try /catch block.The mistake I have made is I have been using data.put("userid") instead of data.put(userid) and it happens I did not see it all day.Thanx.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Internal Server Error - Null Pointer
 
Similar Threads
Apache Tomcat/4.0.1 - HTTP Status 500 - Internal Server Error
Service Error..
jdbc error....
java.lang.OutOfMemoryError
Problem creating an image from a remote url