could not dereference object customerSessionBean not found

Hi, i have an error and i require some advice. This is the error:

*20:17:40,859 INFO JBoss (MX MicroKernel) Started in 16s:672ms
20:19:55,750 INFO Unexpected Exception: Could not dereference object
20:19:55,750 INFO javax.naming.NamingException: Could not dereference
object *

The login.jsp will call the loginpost.jsp to verify the user from the database. After checking, the error start at loginpost.jsp at this part highlight in bold:

Context initial = new InitialContext();
Object objref = initial.lookup("java:comp/env/ejb/CustomerSession");
System.out.println("lookup success for ejb/CustomerSession");
CustomerSessionHome home = (CustomerSessionHome)
PortableRemoteObject.narrow(objref, CustomerSessionHome.class);

i believe the problem is with the deployment descriptor, but i still new to ejb and i cant find where has gone wrong. Would you advise me what should i do? i have include the updated ear file. The deployment descriptor for customerSessionBean is in web.xml and ejb-jar-customerSession.jar.

Regards Shirley

Message was edited by:
Shirley

2 comments

Shirley,

I didn't find anything wrong in the deployment descriptors, and it seems that the bean can be referenced without any errors. I get later a JSP error, but that's after the bean has been referenced:

21:36:18,843 INFO lookup success for ejb/CustomerSession
21:36:18,875 INFO created CustomerSessionHome object
21:36:19,156 ERROR java.lang.NullPointerException
21:36:19,156 ERROR at org.apache.jsp.loginPost_jsp._jspService(logi
nPost_jsp.java:93)
21:36:19,156 ERROR at org.apache.jasper.runtime.HttpJspBase.service
(HttpJspBase.java:97)
21:36:19,156 ERROR at javax.servlet.http.HttpServlet.service(HttpSe
rvlet.java:810)
21:36:19,156 ERROR at org.apache.jasper.servlet.JspServletWrapper.s
ervice(JspServletWrapper.java:332)
21:36:19,156 ERROR at org.apache.jasper.servlet.JspServlet.serviceJ
spFile(JspServlet.java:314)
21:36:19,156 ERROR at org.apache.jasper.servlet.JspServlet.service(
JspServlet.java:264)
21:36:19,156 ERROR at javax.servlet.http.HttpServlet.service(HttpSe
rvlet.java:810)
21:36:19,156 ERROR at org.apache.catalina.core.ApplicationFilterCha
in.internalDoFilter(ApplicationFilterChain.java:252)
21:36:19,156 ERROR at org.apache.catalina.core.ApplicationFilterCha
in.doFilter(ApplicationFilterChain.java:173)
21:36:19,156 ERROR at org.jboss.web.tomcat.filters.ReplyHeaderFilte
r.doFilter(ReplyHeaderFilter.java:96)
21:36:19,156 ERROR at org.apache.catalina.core.ApplicationFilterCha
in.internalDoFilter(ApplicationFilterChain.java:202)
21:36:19,156 ERROR at org.apache.catalina.core.ApplicationFilterCha
in.doFilter(ApplicationFilterChain.java:173)
21:36:19,156 ERROR at org.apache.catalina.core.StandardWrapperValve
.invoke(StandardWrapperValve.java:213)
21:36:19,156 ERROR at org.apache.catalina.core.StandardContextValve
.invoke(StandardContextValve.java:178)
21:36:19,156 ERROR at org.jboss.web.tomcat.security.SecurityAssocia
tionValve.invoke(SecurityAssociationValve.java:175)
21:36:19,156 ERROR at org.jboss.web.tomcat.security.JaccContextValv
e.invoke(JaccContextValve.java:74)
21:36:19,156 ERROR at org.apache.catalina.core.StandardHostValve.in
voke(StandardHostValve.java:126)
21:36:19,156 ERROR at org.apache.catalina.valves.ErrorReportValve.i
nvoke(ErrorReportValve.java:105)
21:36:19,156 ERROR at org.apache.catalina.core.StandardEngineValve.
invoke(StandardEngineValve.java:107)
21:36:19,171 ERROR at org.apache.catalina.connector.CoyoteAdapter.s
ervice(CoyoteAdapter.java:148)
21:36:19,171 ERROR at org.apache.coyote.http11.Http11Processor.proc
ess(Http11Processor.java:869)
21:36:19,171 ERROR at org.apache.coyote.http11.Http11BaseProtocol$H
ttp11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
21:36:19,171 ERROR at org.apache.tomcat.util.net.PoolTcpEndpoint.pr
ocessSocket(PoolTcpEndpoint.java:527)
21:36:19,171 ERROR at org.apache.tomcat.util.net.MasterSlaveWorkerT
hread.run(MasterSlaveWorkerThread.java:112)
21:36:19,171 ERROR at java.lang.Thread.run(Thread.java:595)

0

Hi Martin,
Thanks for your advice that i can find the root of the problem. The problem lies with an ejb jar file which i have deployed in the jboss for standalone testing.
The jar file has a bean name same as the one in my ear file.

Thanks for your support and advice
Regards
Shirley

0

Please sign in to leave a comment.