<jsp:useBean ... /> class attribute invalid

Hi. I get this error and i'm freaking out. I found a lot of threads of this error on this forum and on other forums and I tried every solution but I still get the error.

I use Tomcat 6.0 and jdk1.6.0.

Test.java

package dime;

import java.io.*;

publicclass Testimplements Serializable{

private String text ="";

public Test(){

}

publicvoid setText(String text){

this.text = text;

}

public String getText(){

return text;

}

}

index.jsp

<%@ page import="dime.Test" %>

<html>

<head>

<jsp:useBean id="tess" class="dime.Test" scope="session" />

<title>Basic HelloWorld JSP</title>

</head>

<body bgcolor="#909DB8">

<h1>

Hello world.

</h1>

</body>

</html>

and i get the following error:

org.apache.jasper.JasperException: /simple/index.jsp(5,3) The value for the useBean class attribute dime.Test is invalid.

...

The structure is:

{TOMCAT}\webapps\ROOT\simple\index.jsp

{TOMCAT}\webapps\ROOT\simple\WEB-INF\classes\dime\Test.class

and I typehttp://localhost/simple/ in the web browser.

The strange thing is when i use this code in a web application made in Netbeans 5, and the I run the app. with netbean's tomcat 5.5.17 server the application is OK.

Then I copied the build folder from netbeans' project to tomact6 webapps and I get the same error. From that I think the problem is in the server or in some variable like CLASSPATH.

PLEASE HELP!

Message was edited by:

dimitar

[2468 byte] By [dimitara] at [2007-11-27 8:44:26]
# 1
What're you doing with useBean, don't you need setProperty & getProperty? Also, try with page scope.
skp71a at 2007-7-12 20:45:14 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
The problem is't in setProperty or getPropery. The problem is in the line <jsp:useBean ... /> I try the same project in netbeans and from netbeans i go RUN and the project is OK. Everything is OK.
dimitara at 2007-7-12 20:45:14 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3

>The structure is:

>

>{TOMCAT}\webapps\ROOT\simple\index.jsp

>{TOMCAT}\webapps\ROOT\simple\WEB-INF\classes\dime\Test.class

I soleved the problem. The problem was in the path of the web application.

I just moved the folder simple from ROOT to webapps, and now it works. The path of the app now is:

{TOMCAT}\webapps\simple\index.jsp

{TOMCAT}\webapps\simple\WEB-INF\classes\dime\Test.class

Message was edited by:

dimitar

dimitara at 2007-7-12 20:45:14 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...