• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Internal Server Error - Null Pointer

 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Got the permissions fixed. The FedEx API need all socket permissions granted.
Thanks again!
 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic