File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes error in jsp when calling a javabean Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "error in jsp when calling a javabean" Watch "error in jsp when calling a javabean" New topic

error in jsp when calling a javabean

raji navaneethan

Joined: Apr 06, 2006
Posts: 15
// my html code that calls the Javabean stored in the following path : "http//localhost:8080/vennila/Beans/bean.jsp"

<jsp:useBean id="a" class="sun.bean" scope="session"/>
<jsp:setProperty name="a" property="*"/>


// my input page that calls the <html>


<title>New Page 1</title>


<form method="POST" action="http://localhost:8080/vennila/Beans/bean.jsp">

<p><input type="text" name="name" size="20"></p>
<p><input type="text" name="name2" size="20"></p>
<p><input type="submit" value="Submit" name="B1"></p>



// my java bean stored in the following path : C:\Program Files\Apache Tomcat 4.0\webapps\vennila\WEB-INF\classes

package sun;
public class bean implements
private String name;
private String name2;

public bean()

public void setName(String name1)
public String getName()
return name;

public void setName2(String name3)
public String getName2()
return name2;

while compiling the bean file i haven't got any error but when executing the jsp file i am getting the following error,

org.apache.jasper.JasperException: Unable to compile class for JSPNote: has been deprecated.
error: Invalid class file format in C:\Program Files\Apache Tomcat 4.0\webapps\vennila\WEB-INF\classes\sun\bean.class. The major.minor version '49.0' is too recent for this tool to understand.

An error occurred at line: 4 in the jsp file: /Beans/bean.jsp

Generated servlet error:
C:\Program Files\Apache Tomcat 4.0\work\localhost\vennila\Beans\bean$ Class sun.bean not found.
sun.bean a = null;

when i execute the same code in my neighbours system its working. kindly let me know what could be the reason in my system or is it in my program.
Purushoth Thambu
Ranch Hand

Joined: May 24, 2003
Posts: 425
Did you check whether you compiled the file using the JDK version used by tomcat. Most likely you are having multiple JDK versions in your system
I agree. Here's the link:
subject: error in jsp when calling a javabean
It's not a secret anymore!