Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes JSP and the fly likes [solved]bean mySearchBean not found within scope Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "[solved]bean mySearchBean not found within scope" Watch "[solved]bean mySearchBean not found within scope" New topic
Author

[solved]bean mySearchBean not found within scope

wei liu
Ranch Hand

Joined: Nov 19, 2008
Posts: 35

hi everyone,

I have testing my application in Tomat6.0 with no errors. However, When I move it to the alive server which is Tomcat 5.5 in the firm, it shows

"java.lang.InstantiationException: bean mySearchBean not found within scope" error.

If there any difference about the jsp:userBean between Tomcat 6 and Tomcat 5.5.


thanks


SCJP 1.6 in 2010
SCWCD5 in 2011
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

can you post your bean class as well as your jsp (<jsp:useBean>) . jsp:useBean works in both tomcat5.5 and tomcat6.0
Surya Kant
Ranch Hand

Joined: Mar 29, 2005
Posts: 104
There should not be any difference between in tomcat 6 & 5.5.
Might be the problem of scope of the java bean
wei liu
Ranch Hand

Joined: Nov 19, 2008
Posts: 35

Surya Kant wrote:There should not be any difference between in tomcat 6 & 5.5.
Might be the problem of scope of the java bean



Thanks for your reply ,Surya Kant. Yes it working fine on my localhost, but just show that errors on the server.
I have tried to put the scope in application but have the same error. Could you please tell me how to solve the problem.

Surya Kant
Ranch Hand

Joined: Mar 29, 2005
Posts: 104
Can you please post your bean class & JSP page?
wei liu
Ranch Hand

Joined: Nov 19, 2008
Posts: 35

This is my JSP Page!



And my Bean file is



thank you
Surya Kant
Ranch Hand

Joined: Mar 29, 2005
Posts: 104
It is not able to instantiate becuase it is not able to find the the class name you have specified.
2 things you can try
1.Put import statement in your JSP
2.Check whether your classpath contains out put directory or not
I hope this will solve your problem
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

Please give proper class name . Change your bean class name searchBeans to SearchBeans
wei liu
Ranch Hand

Joined: Nov 19, 2008
Posts: 35

Thanks for your reply, Surya Kant , and the problem has solved.
I followed your instruction and add import of beans.searchBeans and it is now working.


thanks again for your help
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: [solved]bean mySearchBean not found within scope
 
Similar Threads
Problems with jsp:useBean
Errata on HF question?
using jsp:useBean tag
JSP servlet bean bad communication
InstantiationException: bean not found within scope