You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Pa...@xtl.com on 2007/01/18 20:32:40 UTC

causing Exception in JSP

I'm new to JSP and Struts.  I'm trying to learn from a book I bought, but I'm
getting an error on my index.jsp page.  Not sure what the problem is and I've
spent all day trying to figure it out.  Any help is appreciated.

HTTP Status 500 -



type Exception report


message


description The server encountered an internal error () that prevented it from
fulfilling this request.


exception


org.apache.jasper.JasperException: Exception in JSP: /index.jsp:15

12: <hr width="100%" noshade="true">
13:
14: &#149; Add an Employee<br />
15: &#149; <html:link forward="search">Search for Employees</html:link><br />
16:
17: </body>
18: </html:html>


Stacktrace:

org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:506)


org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:395)

org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
             org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
             javax.servlet.http.HttpServlet.service(HttpServlet.java:802)



root cause


java.lang.NullPointerException: Module 'null' not found.

org.apache.struts.taglib.TagUtils.getModuleConfig(TagUtils.java:743)

org.apache.struts.taglib.TagUtils.computeURLWithCharEncoding(TagUtils.java:360)

org.apache.struts.taglib.TagUtils.computeURLWithCharEncoding(TagUtils.java:281)

org.apache.struts.taglib.html.LinkTag.calculateURL(LinkTag.java:433)
             org.apache.struts.taglib.html.LinkTag.doStartTag(LinkTag.java:315)
             org.apache.jsp.index_jsp._jspx_meth_html_link_0(index_jsp.java:123)
             org.apache.jsp.index_jsp._jspx_meth_html_html_0(index_jsp.java:96)
             org.apache.jsp.index_jsp._jspService(index_jsp.java:57)
             org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
             javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:334)

org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
             org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
             javax.servlet.http.HttpServlet.service(HttpServlet.java:802)



note The full stack trace of the root cause is available in the Apache
Tomcat/5.5.20 logs.



Apache Tomcat/5.5.20



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: causing Exception in JSP

Posted by Pa...@xtl.com.
I believe I found the source of my problems.  I was flipping back and forth
between the mailreader example and the app I was working on when something
caught my eye in the web.xml file.

Here's what the mailreader had for <servlet-class> in the servlet config:
org.apache.struts.action.ActionServlet

Here's what I had in my app for <servlet-class> in the servlet config:
org.apache.struts.ActionServlet

enough said...

Patrick Grimard
M.I.S.
XTL Transport Inc.
T. (514) 636-1499 Ext. 5991
T. (800) 636-2138 Ext. 5991
F. (514) 636-5700


                                                                                
             "Pierre Thibaudeau"                                                
             <pierre.thibaudeau@                                                
             gmail.com>                                                      To 
                                         "Struts Users Mailing List"            
             01/18/07 02:58 PM           <us...@struts.apache.org>               
                                                                             cc 
                                                                                
              Please respond to                                         Subject 
                "Struts Users            Re: <html:link forward="search">       
                Mailing List"            causing Exception in JSP               
             <user@struts.apache                                                
                    .org>                                                       
                                                                                
                                                                                
                                                                                
                                                                                




I believe your global forward should point onto /search.do (which is the
ActionMapping whose path is defined as "/search" further down in your
struts-config.xml:

<global-forwards>
    <forward name="search" path="/search.do"/>
  </global-forwards>

Everything else in your struts-config-xml seems to be fine.  Does that help?


2007/1/18, Patrick.Grimard@xtl.com <Pa...@xtl.com>:
>
>   <!-- Global Forwards Configuration -->
>   <global-forwards>
>     <forward name="search" path="/search.jsp"/>
>   </global-forwards>
>




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: causing Exception in JSP

Posted by Pa...@xtl.com.
That didn't work.  I did however take a closer look at my struts-config.xml.  I
happened to find in my action mapping my type was
"com.jamesholmes.minihr/SearchAction", I replace the "/" with "." and now it
doesn't give me JSP exception, now it just gives me:

type Exception report


message


description The server encountered an internal error () that prevented it from
fulfilling this request.


exception


org.apache.jasper.JasperException: Module 'null' not found.

org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:512)


org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:395)

org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
             org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
             javax.servlet.http.HttpServlet.service(HttpServlet.java:802)



root cause


java.lang.NullPointerException: Module 'null' not found.

org.apache.struts.taglib.TagUtils.getModuleConfig(TagUtils.java:743)

org.apache.struts.taglib.TagUtils.computeURLWithCharEncoding(TagUtils.java:360)

org.apache.struts.taglib.TagUtils.computeURLWithCharEncoding(TagUtils.java:281)

org.apache.struts.taglib.html.LinkTag.calculateURL(LinkTag.java:433)
             org.apache.struts.taglib.html.LinkTag.doStartTag(LinkTag.java:315)
             org.apache.jsp.index_jsp._jspx_meth_html_link_0(index_jsp.java:123)
             org.apache.jsp.index_jsp._jspx_meth_html_html_0(index_jsp.java:96)
             org.apache.jsp.index_jsp._jspService(index_jsp.java:57)
             org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
             javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:334)

org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
             org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
             javax.servlet.http.HttpServlet.service(HttpServlet.java:802)



note The full stack trace of the root cause is available in the Apache
Tomcat/5.5.20 logs.

Patrick Grimard
M.I.S.
XTL Transport Inc.
T. (514) 636-1499 Ext. 5991
T. (800) 636-2138 Ext. 5991
F. (514) 636-5700


                                                                                
             "Pierre Thibaudeau"                                                
             <pierre.thibaudeau@                                                
             gmail.com>                                                      To 
                                         "Struts Users Mailing List"            
             01/18/07 02:58 PM           <us...@struts.apache.org>               
                                                                             cc 
                                                                                
              Please respond to                                         Subject 
                "Struts Users            Re: <html:link forward="search">       
                Mailing List"            causing Exception in JSP               
             <user@struts.apache                                                
                    .org>                                                       
                                                                                
                                                                                
                                                                                
                                                                                




I believe your global forward should point onto /search.do (which is the
ActionMapping whose path is defined as "/search" further down in your
struts-config.xml:

<global-forwards>
    <forward name="search" path="/search.do"/>
  </global-forwards>

Everything else in your struts-config-xml seems to be fine.  Does that help?


2007/1/18, Patrick.Grimard@xtl.com <Pa...@xtl.com>:
>
>   <!-- Global Forwards Configuration -->
>   <global-forwards>
>     <forward name="search" path="/search.jsp"/>
>   </global-forwards>
>




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: causing Exception in JSP

Posted by Pierre Thibaudeau <pi...@gmail.com>.
I believe your global forward should point onto /search.do (which is the
ActionMapping whose path is defined as "/search" further down in your
struts-config.xml:

<global-forwards>
    <forward name="search" path="/search.do"/>
  </global-forwards>

Everything else in your struts-config-xml seems to be fine.  Does that help?


2007/1/18, Patrick.Grimard@xtl.com <Pa...@xtl.com>:
>
>   <!-- Global Forwards Configuration -->
>   <global-forwards>
>     <forward name="search" path="/search.jsp"/>
>   </global-forwards>
>

Re: causing Exception in JSP

Posted by Pa...@xtl.com.
I just tried putting the slash before search in my forward attribute as you
mentioned, but I got the same error.  Here's my struts-config.xml.

<?xml version="1.0"?>

<!DOCTYPE struts-config PUBLIC
  "-//Apache Software Foundation//DTD Struts Configuration 1.3//EN"
  "http://struts.apache.org/dtds/struts-config_1_3.dtd">

<struts-config>

  <!-- Form Beans Configuration -->
  <form-beans>
    <form-bean name="searchForm"
               type="com.jamesholmes.minihr.SearchForm"/>
  </form-beans>

  <!-- Global Forwards Configuration -->
  <global-forwards>
    <forward name="search" path="/search.jsp"/>
  </global-forwards>

  <!-- Action Mappings Configuration -->
  <action-mappings>
    <action path="/search"
            type="com.jamesholmes.minihr/SearchAction"
            name="searchForm"
            scope="request"
            validate="true"
            input="/search.jsp">
    </action>
  </action-mappings>

  <!-- Message Resources Configuration -->
  <message-resources
    parameter="com.jamesholmes.minihr.MessageResources"/>

</struts-config>



                                                                                
             "Pierre Thibaudeau"                                                
             <pierre.thibaudeau@                                                
             gmail.com>                                                      To 
                                         "Struts Users Mailing List"            
             01/18/07 02:37 PM           <us...@struts.apache.org>               
                                                                             cc 
                                                                                
              Please respond to                                         Subject 
                "Struts Users            Re: <html:link forward="search">       
                Mailing List"            causing Exception in JSP               
             <user@struts.apache                                                
                    .org>                                                       
                                                                                
                                                                                
                                                                                
                                                                                




Hi Patrick,

Have you tried putting a slash:
<html:link forward="/search">

If that doesn't solve your problem, I suspect that you would need to post
the content of your struts-config.xml file...
Good luck!

Pierre


2007/1/18, Patrick.Grimard@xtl.com <Pa...@xtl.com>:
>
>
> org.apache.jasper.JasperException: Exception in JSP: /index.jsp:15
>
> 12: <hr width="100%" noshade="true">
> 13:
> 14: &#149; Add an Employee<br />
> 15: &#149; <html:link forward="search">Search for Employees</html:link><br
> />
> 16:
> 17: </body>
> 18: </html:html>


...

root cause
>
> java.lang.NullPointerException: Module 'null' not found.
>




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: causing Exception in JSP

Posted by Pierre Thibaudeau <pi...@gmail.com>.
Hi Patrick,

Have you tried putting a slash:
<html:link forward="/search">

If that doesn't solve your problem, I suspect that you would need to post
the content of your struts-config.xml file...
Good luck!

Pierre


2007/1/18, Patrick.Grimard@xtl.com <Pa...@xtl.com>:
>
>
> org.apache.jasper.JasperException: Exception in JSP: /index.jsp:15
>
> 12: <hr width="100%" noshade="true">
> 13:
> 14: &#149; Add an Employee<br />
> 15: &#149; <html:link forward="search">Search for Employees</html:link><br
> />
> 16:
> 17: </body>
> 18: </html:html>


...

root cause
>
> java.lang.NullPointerException: Module 'null' not found.
>