• 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:
  • Tim Cooke
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Scott Selikoff
Bartenders:
  • Piet Souris
  • Jj Roberts
  • fred rosenberger

Null pointer exception for stateful session bean

 
Ranch Hand
Posts: 152
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Guys plz help me out
 
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic