wood burning stoves
The moose likes Servlets and the fly likes NullPointer at create() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "NullPointer at create()" Watch "NullPointer at create()" New topic

NullPointer at create()

steve dowdall
Ranch Hand

Joined: May 23, 2001
Posts: 36
Ok, thanks to all you guys I have the servlet calling out to the ejb from the servlet. The ejb lookup and method calls are in a processRequest method that is called from the doGet method.
Tracing it i find that it gets past the InitialContex and the lookup, It gets to the ejb.home.create() and gives a NullPointer Exception. Like this:
getting ready to create()
<Nov 14, 2001 5:16:43 PM EST> <Error> <HTTP> <[WebAppServletContext(392716,DDMWebApp)] Servlet faile
d with Exception
at com.document.DocServlet.processRequest(DocServlet.java:181)
at com.document.DocServlet.doGet(DocServlet.java:280)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:213)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:12
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:1631)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
Not sure why. I can hit the ejb from my java client and it works ok.
Any suggestions where to look or how to pin point it more?
steve dowdall
Ranch Hand

Joined: May 23, 2001
Posts: 36
I found the error.
It was a due to a bad try/catch block that was not allowing the remote interface to be created. After a little house keeping it works great. This is my first attempt at connecting a jsp/servlet/ejb and fully implemting the MVC architecture.
Thanks to all those who encouraged me the past week. Now on to those enhancments........
subject: NullPointer at create()
It's not a secret anymore!