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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "NullPointerException" Watch "NullPointerException" New topic
Author

NullPointerException

krishna prasad gunasekaran
Ranch Hand

Joined: Jul 25, 2006
Posts: 158
when i call a remote method on ejb, it throws a NullPointerException.
i am passing a VO as an argument.

code:
in Action

somewhere in my Action code...
ArrayList al = (ArrayList) EJBRemote.xyz(VO);

in Remote Interface
public collection EJBRemote.xyz(VO) throws RemoteException;

in Session Bean
public collection EJBRemote.xyz(VO){
Dao.getXYZ(VO);
}

Error code :
java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.ServerException: RuntimeException; nested exception is:
java.lang.NullPointerException


I have checked the code in DAO, there is no way it is going to throw NullPointerException. what could be the reason for NullPointerException?


have a great day,
krishna prasad
Dilip Viswanath
Greenhorn

Joined: Aug 03, 2007
Posts: 1
is your VO serializable?
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30136
    
150

Krisp,
Let's start by trying to narrow down the problem. Does it work if you comment out the call to the DAO? If not, we can rule out the DAO. Does it work if you pass null as the VO? If not, the problem is in the VO.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
krishna prasad gunasekaran
Ranch Hand

Joined: Jul 25, 2006
Posts: 158
Jeanne, i did not comment out the call to DAO, instead i used the codes in DAO in my Action. It worked perfectly. when i passed null, instead of VO, no exception was thrown out. the code exection was back on track. so can we rule out the parts of DAO and VO.

what could be the reason
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: NullPointerException
 
Similar Threads
Stub Class Not Found Exception
java.rmi.ServerException: java .rmi.UnmarshallException
RMI sever setup problem
How to retrieve collection from EJB to frontend in WSAD?
RMI Error