Friday, November 11, 2011

Cannot find bean org.apache.struts.taglib.html.BEAN in any scope

I was getting the following exception when I tried to execute an Action Class...
Everything in struts-config.xml, web.xml, the TLDs in place seem to be perfect.
But still I got the following exception.


500 Internal Server Error (Click for full stack trace)
javax.servlet.jsp.JspException: Cannot find bean org.apache.struts.taglib.html.BEAN in any scope

at org.apache.struts.util.RequestUtils.lookup(RequestUtils.java:938)
at org.apache.struts.taglib.html.BaseFieldTag.doStartTag(BaseFieldTag.java:176)
at _clientSide._jspService(clientSide.jsp:12) [/clientSide.jsp]
at com.orionserver[Oracle Application Server Containers for J2EE 10g (10.1.2.2.0)].http.OrionHttpJspPage.service(OrionHttpJspPage.java:57)
at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:356)
at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:498)
at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:402)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.2.0)].server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
at oracle.security.jazn.oc4j.JAZNFilter.doFilter(Unknown Source)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.2.0)].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:673)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.2.0)].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:340)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.2.0)].server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:229)
at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)
at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1485)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:509)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.2.0)].server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
at oracle.security.jazn.oc4j.JAZNFilter.doFilter(Unknown Source)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.2.0)].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:673)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.2.0)].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:340)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.2.0)].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:830)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.2.0)].server.http.HttpRequestHandler.run(HttpRequestHandler.java:285)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.2.0)].server.http.HttpRequestHandler.run(HttpRequestHandler.java:126)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.2.0)].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
at java.lang.Thread.run(Thread.java:534)


Solution

The mistake I was doing was that I had used <html:text> tag without using <html:form> in the JSP file.

Always remember that you should have <html:text tag inside <html:form

2 comments: