Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Strange error - Bean not found in scope  RSS feed

 
Sudharsan Govindarajan
Ranch Hand
Posts: 319
  • Mark post as helpful
  • send pies
  • 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
 
Jason Menard
Sheriff
Posts: 6450
  • Mark post as helpful
  • send pies
  • 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".
 
Marty Hall
Author
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!