Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Null pointer exception for stateful session bean  RSS feed

 
clyde melly
Ranch Hand
Posts: 152
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A developer successfully creating and tests a
stateful bean following deployment, intermittent
"NullpointerException" begin to occur, particularly
when the server is hardly loaded. What most likely to
related problem.
a) setSessionContext
b) ejbCreate
c) ejbPassivate
d) beforeCompletion
e) ejbLoad


I guess it shud be between c and d.
 
clyde melly
Ranch Hand
Posts: 152
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guys plz help me out
 
Chris Brat
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Clyde,

Please give a bit more information about the problem - is this an exam question or a production problem that you are experiencing?

If you are able to identify the exception as a NullPointer are you able to view the stack trace? That would identify which method is causing the problem and help you resolve it.

Chris
[ November 28, 2005: Message edited by: Chris Brat ]
 
clyde melly
Ranch Hand
Posts: 152
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
preparing for my certification exam.so a mock exam question which i came across
 
Chris Brat
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Clyde,

Here are my thoughts.

"What most likely to related problem."

a) setSessionContext - I wouldnt expect a problem here as you usually only assign the SessionContext to a an instance variable,
there is also no statefull bean pool so the problem wouldnt be more noticable during server startup.
b) ejbCreate - A problem could occur if not all expected parameters are supplied - This is dependant on the clients input.
c) ejbPassivate - I wouldn't expect a problem here since you should only be releasing resources that cannot be serialized,
and the problem occurs especially when the server is hardly loaded - a bean needs to have been associated with the
client first before its passivated.
d) beforeCompletion - I would only expect a nullpointer here if you had bad business logic and had released a resource earlier in the
transaction that you still needed.
e) ejbLoad - There is no ejbLoad in statefull session beans


I find the question a bit vaque and dont remember getting a similar question during the exam - which mock exams are you using?

Chris
 
clyde melly
Ranch Hand
Posts: 152
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Chris Thanx.I was also thinking abt d as the option.As 4 d mock question got if from this yahoo gropup(sceaprep).Anyways thanx once again.Just wanted to b sure.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!