Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java and JDK > BOOK: Beginning JavaServer Pages
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old April 23rd, 2006, 08:16 AM
Registered User
Join Date: Feb 2006
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 19 error of: Cannot find bean: "org.apache

In case anyone runs into this error, I've pulled the following from the internet:

---- begin from internet -----

Seemingly, even experienced struts users encounter this kind of issue. There are a few reasons this happens

1.When there is a form object, which has no bean specified, name attribute is empty. e.g
<html:text property="name" />. Check if the property name is specified in the form-bean declaration if DynaActionForm or if the ActionForm has that property.

2. Secondly, check whether the <html:form is already there or not and does the form object in the <html:form></html:form>

3. Make sure the <html:form action="" /> points to the correct place where the form-bean definition is the same as when you are displaying the form.
It basically means check your action mappings also especially the name attribute

Sometimes, things are cached, restart your j2ee container would be the best bet to resolve suspects of cache issues

------ end from internet -----

Now I didn't get this problem with the exercises in the book as I did my own test. I struggled for at least two days with trying to get the strusts-config.xml file correct. At some point I had it correct but the app wasn't working just the same. I'd rebooted the PC at some point, but I can only conclude that I hadn't gotten the struts-config.xml file correct at that point.

Just the same, last night I finally turned the PC off and walked away from the problem; I'd had enough. This morning I turned the PC on and gave it one more try and it worked. What I can't tell you is what was causing the problem, except that something apparently is being cached.

I had a simple index.jsp that came up and did the following:

<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<html:link page="/main.jsp">Test the Main Form</html:link>

The main.jsp basically did the following (pertinent lines of code only shown here):

<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<html:form action="/Main.do" method="post">
            Enter Request ID: <html:text property="requestID" size="10" maxlength="10"/><br>
            Enter Donation ID: <html:text property="donationID" size="10" maxlength="10"/><br>

The results.jsp contained the following code:

<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
    <title>Needs Fulfillment - Testing Results Page</title>
    <link rel="stylesheet" type="text/css" href="needs.css">
<body class="body">
<h1 class="h1">Testing Results</h1>

Request ID: <bean:write name="ClosedDonationsForm" property="requestID"/>
Donation iD: <bean:write name="ClosedDonationsForm" property="donationID"/>

Struts-config.xml contained the folllowing:



        <form-bean name="ClosedDonationsForm"

         <action path="/Main"
            <forward name="success" path="/results.jsp"/>

The entire purpose of this was an attempt to learn one piece of struts - nothing more than that.

The action class simply did a mapping.findForward("success"). That's all.

The action form (java bean) did nothing but supply the getters and setters for the two fields.

I was trying to learn and test the forwarding action set up in struts-config.xml and cause the data transfer between forms using the java bean.

Point is: if you run into the same error, check things over and if all else fails, reboot the PC and give it another try. I'd carefully review everything first. If you've got something wrong, the rebooting isn't going to work and you'll end up considering that a failed attempt. Make certain all is right as best you can and then try the reboot.

Hopfully this may be of some help to someone.
Old April 23rd, 2006, 08:17 AM
Registered User
Join Date: Feb 2006
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts

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

The thread title didn't take the full error message, so here it is in full.

Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 19 xml error flashmanTom Visual Basic 2005 Basics 0 February 9th, 2008 02:05 PM
org.apache.jasper.JasperException:The value for th Lijin Apache Tomcat 1 January 18th, 2007 08:05 PM
Exception creating bean of class org.apache.struts chandseetare Apache Tomcat 0 May 14th, 2005 07:22 AM
org.apache.struts.* bongo76 Apache Tomcat 1 April 18th, 2004 05:06 AM
org.apache.strut.util.GenericDataSource elbicho JSP Basics 1 August 23rd, 2003 03:55 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.