Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Java > Java and JDK > BOOK: Beginning JavaServer Pages
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning JavaServer Pages
This is the forum to discuss the Wrox book Beginning JavaServer Pages by Vivek Chopra, Jon Eaves, Rupert Jones, Sing Li, John T. Bell; ISBN: 9780764574856
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning JavaServer Pages section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old May 19th, 2005, 04:26 PM
Registered User
 
Join Date: May 2005
Location: San Diego, CA, .
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default Ch 19 not working either...

Ok......... I skipped over my last problem(s) (ch18) and continued to chapter 19 ...
I downloaded struts 1.2.4 (same as book uses), followed directions, and got ant to do the build just fine. I go to my tomcat manager page, and see that the struts app was on there, and I go to
http://localhost:8080/struts-base/index.jsp and get a....

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
    org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:370)
    org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:291)
    org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:241)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:802)


root cause

java.lang.NullPointerException
    org.apache.struts.taglib.TagUtils.retrieveMessageR esources(TagUtils.java:1219)
    org.apache.struts.taglib.TagUtils.message(TagUtils .java:1082)
    org.apache.struts.taglib.bean.MessageTag.doStartTa g(MessageTag.java:226)
    org.apache.jsp.index_jsp._jspx_meth_bean_message_0 (org.apache.jsp.index_jsp:125)
    org.apache.jsp.index_jsp._jspService(org.apache.js p.index_jsp:86)
    org.apache.jasper.runtime.HttpJspBase.service(Http JspBase.java:97)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:802)
    org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:322)
    org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:291)
    org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:241)
    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.9 logs.


--------------------------------------------------------------------------------

Apache Tomcat/5.5.9



sooooo..... I had a (perhaps) symilar problem with chapter 18 WebWork example, chapter 18 Spring I could not try because there is NO file that contains the properties I was instructed to change (I added an errata for this), and with chapter 19 I have this problem. So far the framework section of the book seems rather flawed to me.

Reply With Quote
  #2 (permalink)  
Old May 31st, 2005, 04:06 AM
Registered User
 
Join Date: May 2005
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

same problem here

Reply With Quote
  #3 (permalink)  
Old May 31st, 2005, 07:59 PM
Registered User
 
Join Date: May 2005
Location: , , .
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Looking at the error message it appears that you are missing a message properties file required by the taglib.

Both Chapter 18 and Chapter 19 have paragraphs that discuss this file and it's location and Chapter 18 contains some contents for that file.

While debugging JSP can be confusing at times, and simple configuration errors seems to create massive failures, your issues seem to stem from a single problem that should be simple to fix.

Creating so many examples for a book is very time consuming and is prone to human mistakes. We tried very hard to minimise those and do apologise for any that have survived the editing process.

There is an upside, debugging is a very important skill for software developers, so look at this as a head start to your competition that you'll have already been able to identify and work out these issues.

Searching these and other forums and using Google will also be invaluable tools for furthering your knowledge of Java development.
Reply With Quote
  #4 (permalink)  
Old July 7th, 2005, 04:17 PM
Registered User
 
Join Date: Jul 2005
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

In regards to the Spring framework example... I am having the same problem as mentioned above. The build.xml simply does not contain any of the mentioned properties on page 570. I did download the latest version of Spring which is slightly newer than the one used in the book but I doubt that a drastic change would occur between 1.0 and 1.1. If the properties aren't in build.xml, where are they?

If anyone has been able to figure this out please let me know.

Thanks in advance.
Reply With Quote
  #5 (permalink)  
Old April 13th, 2006, 12:42 AM
Registered User
 
Join Date: Apr 2006
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Jon,

  I'm getting following error on JBoss:-
================================================== ===================
00:26:27,474 ERROR [Engine] StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException
        at org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:254)
        at org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:295)
        at org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:241)
        at javax.servlet.http.HttpServlet.service(HttpServlet .java:853)
        at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:247)
        at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:193)
        at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:256)
        at org.apache.catalina.core.StandardPipeline$Standard PipelineValveContext.invokeNext(StandardPipeline.j ava:643)
        at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:480)
        at org.apache.catalina.core.ContainerBase.invoke(Cont ainerBase.java:995)
        at org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:191)
        at org.apache.catalina.core.StandardPipeline$Standard PipelineValveContext.invokeNext(StandardPipeline.j ava:643)
        at org.apache.catalina.valves.CertificatesValve.invok e(CertificatesValve.java:246)
        at org.apache.catalina.core.StandardPipeline$Standard PipelineValveContext.invokeNext(StandardPipeline.j ava:641)
        at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:480)
        at org.apache.catalina.core.ContainerBase.invoke(Cont ainerBase.java:995)
        at org.apache.catalina.core.StandardContext.invoke(St andardContext.java:2415)
        at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:180)
        at org.apache.catalina.core.StandardPipeline$Standard PipelineValveContext.invokeNext(StandardPipeline.j ava:643)
        at org.apache.catalina.valves.ErrorDispatcherValve.in voke(ErrorDispatcherValve.java:171)
        at org.apache.catalina.core.StandardPipeline$Standard PipelineValveContext.invokeNext(StandardPipeline.j ava:641)
        at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:172)
        at org.apache.catalina.core.StandardPipeline$Standard PipelineValveContext.invokeNext(StandardPipeline.j ava:641)
        at org.apache.catalina.valves.AccessLogValve.invoke(A ccessLogValve.java:509)
        at org.apache.catalina.core.StandardPipeline$Standard PipelineValveContext.invokeNext(StandardPipeline.j ava:641)
        at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:480)
        at org.apache.catalina.core.ContainerBase.invoke(Cont ainerBase.java:995)
        at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:174)
        at org.apache.catalina.core.StandardPipeline$Standard PipelineValveContext.invokeNext(StandardPipeline.j ava:643)
        at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:480)
        at org.apache.catalina.core.ContainerBase.invoke(Cont ainerBase.java:995)
        at org.apache.coyote.tomcat4.CoyoteAdapter.service(Co yoteAdapter.java:223)
        at org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:594)
        at org.apache.coyote.http11.Http11Protocol$Http11Conn ectionHandler.processConnection(Http11Protocol.jav a:392)
        at org.apache.tomcat.util.net.TcpWorkerThread.runIt(P oolTcpEndpoint.java:565)
        at org.apache.tomcat.util.threads.ThreadPool$ControlR unnable.run(ThreadPool.java:619)
        at java.lang.Thread.run(Thread.java:534)
00:26:27,474 ERROR [Engine] ----- Root Cause -----
java.lang.NullPointerException
        at org.apache.struts.taglib.TagUtils.retrieveMessageR esources(TagUtils.java:1175)
        at org.apache.struts.taglib.TagUtils.message(TagUtils .java:1038)
        at org.apache.struts.taglib.bean.MessageTag.doStartTa g(MessageTag.java:224)
        at org.apache.jsp.login_jsp._jspx_meth_bean_message_0 (login_jsp.java:102)
        at org.apache.jsp.login_jsp._jspService(login_jsp.jav a:68)
        at org.apache.jasper.runtime.HttpJspBase.service(Http JspBase.java:137)
        at javax.servlet.http.HttpServlet.service(HttpServlet .java:853)
        at org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:210)
        at org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:295)
        at org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:241)
        at javax.servlet.http.HttpServlet.service(HttpServlet .java:853)
        at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:247)
        at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:193)
        at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:256)
        at org.apache.catalina.core.StandardPipeline$Standard PipelineValveContext.invokeNext(StandardPipeline.j ava:643)
        at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:480)
        at org.apache.catalina.core.ContainerBase.invoke(Cont ainerBase.java:995)
        at org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:191)
        at org.apache.catalina.core.StandardPipeline$Standard PipelineValveContext.invokeNext(StandardPipeline.j ava:643)
        at org.apache.catalina.valves.CertificatesValve.invok e(CertificatesValve.java:246)
        at org.apache.catalina.core.StandardPipeline$Standard PipelineValveContext.invokeNext(StandardPipeline.j ava:641)
        at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:480)
        at org.apache.catalina.core.ContainerBase.invoke(Cont ainerBase.java:995)
        at org.apache.catalina.core.StandardContext.invoke(St andardContext.java:2415)
        at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:180)
        at org.apache.catalina.core.StandardPipeline$Standard PipelineValveContext.invokeNext(StandardPipeline.j ava:643)
        at org.apache.catalina.valves.ErrorDispatcherValve.in voke(ErrorDispatcherValve.java:171)
        at org.apache.catalina.core.StandardPipeline$Standard PipelineValveContext.invokeNext(StandardPipeline.j ava:641)
        at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:172)
        at org.apache.catalina.core.StandardPipeline$Standard PipelineValveContext.invokeNext(StandardPipeline.j ava:641)
        at org.apache.catalina.valves.AccessLogValve.invoke(A ccessLogValve.java:509)
        at org.apache.catalina.core.StandardPipeline$Standard PipelineValveContext.invokeNext(StandardPipeline.j ava:641)
        at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:480)
        at org.apache.catalina.core.ContainerBase.invoke(Cont ainerBase.java:995)
        at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:174)
        at org.apache.catalina.core.StandardPipeline$Standard PipelineValveContext.invokeNext(StandardPipeline.j ava:643)
        at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:480)
        at org.apache.catalina.core.ContainerBase.invoke(Cont ainerBase.java:995)
        at org.apache.coyote.tomcat4.CoyoteAdapter.service(Co yoteAdapter.java:223)
        at org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:594)
        at org.apache.coyote.http11.Http11Protocol$Http11Conn ectionHandler.processConnection(Http11Protocol.jav a:392)
        at org.apache.tomcat.util.net.TcpWorkerThread.runIt(P oolTcpEndpoint.java:565)
        at org.apache.tomcat.util.threads.ThreadPool$ControlR unnable.run(ThreadPool.java:619)
        at java.lang.Thread.run(Thread.java:534)

================================================== ===================

I'm using following code:-
1) struts-config.xml
<?xml version="1.0" encoding="ISO-8859-1" ?>

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

<struts-config>

    <global-exceptions>
        <exception
         key = "global.error.invalidlogin"
         path = "/login.jsp"
         scope = "request"
         type = "com.oreilly.struts.banking.service.InvalidLoginEx ception"/>
    </global-exceptions>

    <global-forwards>
        <forward name = "SystemFailure" path = "/systemerror.jsp"/>
        <forward name = "SessionTimeOut" path = "/sessiontimeout.jsp"/>
    </global-forwards>

    <action
     path = "/login"
     type = "com.oreilly.struts.banking.action.LoginAction "
     scope = "request"
     name = "loginForm"
     validate = "true"
     input = "/login.jsp">
     <forward name = "Success" path = "/home.jsp" redirect = "true"/>
     <forward name = "Failure" path = "/login.jsp" redirect = "true"/>
    </action>

    <action
     path = "/logout"
     type = "com.oreilly.struts.banking.action.LogoutActio n"
     scope = "reuest">
     <forward name = "Success" path = "/login.jsp" redirect = "true"/>
    </action>

    <form-beans>
        <form-bean
         name = "loginForm"
         type = "com.oreilly.struts.banking.form.LoginForm"/>
        <form-bean
          name = "accountInformationForm"
          type = "org.apache.struts.action.DynaActionForm">
          <form-property name = "accounts" type = "java.util.ArrayList"/>
        </form-bean>
        <form-bean
        name = "accountDetailForm"
        type = "org.apache.struts.action.DynaActionForm">
        <form-property name = "view" type = "com.oreilly.struts.banking.view.AccountDetailView "/>
        </form-bean>
    </form-beans>

    <message-resources parameter="BaseResources" null="false" scope="application"/>
</struts-config>
2)web.xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
    "http://java.sun.com/j2ee/dtds/web-app_2.2.dtd">

<web-app>
    <servlet>
        <servlet-name>simpleloginapp</servlet-name>
        <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
        <init-param>
            <param-name>config</param-name>
            <param-value>/WEB-INF/struts-config.xml</param-value>
        </init-param>
        <init-param>
            <param-name>host</param-name>
            <param-value>localhost</param-value>
        </init-param>
        <init-param>
            <param-name>port</param-name>
            <param-value>7001</param-value>
        </init-param>
    </servlet>
    <servlet-mapping>
        <servlet-name>simpleloginapp</servlet-name>
        <url-pattern>*.do</url-pattern>
    </servlet-mapping>
    <taglib>
        <taglib-uri>/WEB-INF/struts-html.tld</taglib-uri>
        <taglib-location>/WEB-INF/struts-html.tld</taglib-location>
    </taglib>
    <taglib>
        <taglib-uri>/WEB-INF/struts-logic.tld</taglib-uri>
        <taglib-location>/WEB-INF/struts-logic.tld</taglib-location>
    </taglib>
    <taglib>
        <taglib-uri>/WEB-INF/struts-bean.tld</taglib-uri>
        <taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
    </taglib>
</web-app>
3)login.jsp
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>

<html:html>
<% System.out.println("Hello++++333++");%>
    <head>
        <title><bean:message key="title.login"/></title>
    </head>
<% System.out.println("Hello---------------");%>
    <body>
    suneel
    </body>
</html:html>

4) BaseResources.properties
title.login = Struts Online Banking

I'm accessing login.jsp via http://localhost:8081/SimpleLoginApp/login.jsp


Please help !

Thanks,
Suneel.

Reply With Quote
  #6 (permalink)  
Old May 23rd, 2006, 06:45 AM
Registered User
 
Join Date: Feb 2006
Location: , Ohio, .
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

suneel,

I can't say exactly what is wrong and why you are getting the results you are, specifically the error, but I can suggest you correct a couple other things first and then proceed.

Refer to page 596 in the book. Notice particularly that the order in which a struts-config file is laid out is not only important and required but can cause some stange errors.

From your struts-config file I see two things: one is that the form beans come after your action mappings, and two that your action mappings are not nested within <action-mappings>... </action-mappings>.

I'd make those two corrections and see what you get.
Reply With Quote
  #7 (permalink)  
Old May 17th, 2007, 05:36 AM
Registered User
 
Join Date: Apr 2007
Location: shanghai, , China.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Benjamin_zyl
Default

Ch19-struts-base I go to http://localhost:8080/struts-base/index.jsp and finish ex2 ,input some things and submit get a ...


HTTP Status 500 -

--------------------------------------------------------------------------------

type Exception report

message

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

exception

javax.servlet.ServletException: Servlet execution threw an exception


root cause

java.lang.NoClassDefFoundError: org/apache/oro/text/perl/Perl5Util
    org.apache.commons.validator.GenericValidator.matc hRegexp(GenericValidator.java:72)
    org.apache.struts.validator.FieldChecks.validateMa sk(FieldChecks.java:238)
    sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
    java.lang.reflect.Method.invoke(Method.java:324)
    org.apache.commons.validator.ValidatorAction.execu teValidationMethod(ValidatorAction.java:567)
    org.apache.commons.validator.Field.validateForRule (Field.java:827)
    org.apache.commons.validator.Field.validate(Field. java:906)
    org.apache.commons.validator.Form.validate(Form.ja va:174)
    org.apache.commons.validator.Validator.validate(Va lidator.java:367)
    org.apache.struts.validator.DynaValidatorForm.vali date(DynaValidatorForm.java:110)
    org.apache.struts.action.RequestProcessor.processV alidate(RequestProcessor.java:928)
    org.apache.struts.action.RequestProcessor.process( RequestProcessor.java:204)
    org.apache.struts.action.ActionServlet.process(Act ionServlet.java:1194)
    org.apache.struts.action.ActionServlet.doPost(Acti onServlet.java:432)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:709)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:802)


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

what's happened?



Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Error running CH 19 case study. dw60025 BOOK: Professional SQL Server 2005 Integration Services ISBN: 0-7645-8435-9 2 April 2nd, 2009 11:18 PM
where is the "validator-rules.xml" in ch-19? satanest BOOK: Beginning JavaServer Pages 0 August 10th, 2008 02:19 AM
Page 975; Ch 19 Nick Y BOOK: Ivor Horton's Beginning Visual C++ 2005 0 July 31st, 2006 01:25 AM
Page 973; Ch 19 Nick Y BOOK: Ivor Horton's Beginning Visual C++ 2005 0 July 31st, 2006 01:17 AM
Ch. 17 & 19 Apache instead of IIS Kevin Tough VB.NET 2002/2003 Basics 0 October 3rd, 2005 02:29 AM



All times are GMT -4. The time now is 08:39 AM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.