• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

NullPointerException

 
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
is your VO serializable?
 
author & internet detective
Posts: 42003
911
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
krishna prasad gunasekaran
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Looky! I'm being abducted by space aliens! Me and this tiny ad!
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic