Win a copy of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Strange error - Bean not found in scope

 
Ranch Hand
Posts: 319
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey!
The JSP spec (and my common sense) says that if a bean is not found, it will be instantiated. But when i try to use a bean using the <jsp:useBean> tag it reports the following error
(truncated the long stack trace)
The bean phoneBook, which is referred does have a public no argument constructor.
The class exists in the \WEB-INF\classes\ folder. Other classes in the same package have no problem in instantiation.
The servlet container is Tomcat 4.1.18.
Whats wrong?
thanks
sudharsan
 
Sheriff
Posts: 6450
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It might help if we could see the JSP code. One reason you might get something like this is if you did a usebean for "PhoneBook" and then later referenced it as "phoneBook".
 
Author
Posts: 111
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

...But when i try to use a bean using the <jsp:useBean> tag it reports the following error...


Are you sure that it is the jsp:useBean tag that causes the error? Maybe it is a jsp:getProperty or jsp:setProperty tag? Maybe put in some
<% System.out.println("..."); %>
statements to be sure?
Cheers-
- Marty
 
Sudharsan Govindarajan
Ranch Hand
Posts: 319
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Marty,
Just a single line of JSP code was enough to reproduce this error. I tested with a jsp file containing only this line

And I'm sure abt the spelling of the id value.
-sudharsan
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic