The value for the useBean class attribute com.wrox.library.Book is invalid

I have created the simple bean class (Book.java) and placed it under C:\Tomcat 6.0\webapps\ch03\web-inf\Classes\com\wrox\library directory. My java class looks like below,

package com.wrox.library;

public class Book{

private String title;

public Book(){

}

public void setTitle(String title){

this.title=title;

}

public String getTitle(){

return this.title;

}

}

and i have a simple jsp page

<html><head><title>A simple class</title></head>

<body>

<jsp:useBean id="myBook" class="com.wrox.library.Book" scope="session"/>

<jsp:setProperty name="myBook" property="title" value="Begging Jsp Web Development"/>

Book Title::<jsp:getProperty name="myBook" property="title"/>

</body></html>

But when try to run the jsp using my tomcat six it is giving the error:

org.apache.jasper.JasperException: /t1.jsp(3,0) The value for the useBean class attribute com.wrox.library.Book is invalid.

org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)

org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)

org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:148)

org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1200)

org.apache.jasper.compiler.Node$UseBean.accept(Node.java:1155)

I have tried with specifying the class name in type attribute but it didnt work for me.

Please help me out to solve this problem.

Thanks in advance.

Sumanth

[1672 byte] By [SShettya] at [2007-11-27 6:37:05]
# 1
Refer, should solve your issue. http://forum.java.sun.com/thread.jspa?threadID=567258&messageID=2944921
skp71a at 2007-7-12 18:05:20 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

I have refered that link.... But if you can see my code, I have class is public class and it has a public blank costructor. I also tried using the type attribute... But it didn't work for me. The link gives only this info.

I am trying all these with tomcat 6.0....

Please help me to solve out this problem.....

Thanks In Advance..

SShettya at 2007-7-12 18:05:20 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
Hey ShettyUse the follwing format I think u wont get that errorin useBean tag just add another attribute beanName="fully quailfied class name"for Ex<jsp:useBean id="xxx" class="xxx" beanName="com.xxx.BeanName" >
java@bava.coma at 2007-7-12 18:05:20 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4
Hey all,i think it is the Tomcat 6.0 problem ... Because i executed the same piece of code in tomcat 5.0... It worked fine.... Anyway thanks for the kind help...Regards,Shetty
SShettya at 2007-7-12 18:05:20 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...