Server object.

I have a servlet now this servlet requests information from a standalone program which just waits for the requests by this servlet. Both servlet and the standalone app are located on same machine. My servlet requests a method from this app and the method has to return a Vector to it. I get a NullPointerException when i make this request. I don't know why. I tried to run some tests and i can't understand it. Now if i make the method return me a String it works fine but any other Object i get nullpointerexception. What can be causing this ?