clonmelog
asked on
URGENT:org.apache.jasper.JasperException: Unable to compile class for JSPNote: sun.tools.javac.Main has been deprecated.
Hi,
Im currently trying to create a login in jsp and im getting the following errors:
org.apache.jasper.JasperEx ception: Unable to compile class for JSPNote: sun.tools.javac.Main has been deprecated.
error: Invalid class file format in C:\Program Files\Java\jdk1.5.0_06\jre \lib\rt.ja r(java/lan g/Object.c lass). The major.minor version '49.0' is too recent for this tool to understand.
G:\tomcat4\work\Standalone \localhost \_\home$js p.java:0: Class java.lang.Object not found in class javax.servlet.GenericServl et.
package org.apache.jsp;
^
2 errors, 1 warning
Im not sure if this is a problem with my setup or what it is.
the code being used here is:
<%@ page import="java.sql.*" %>
<html>
<head>
<title>Admin Verification</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<%
Connection connection = null;
try {
// Load the JDBC driver
String driverName = "oracle.jdbc.driver.Oracle Driver";
Class.forName(driverName);
// Create a connection to the database
String serverName = "witnt07.wit.ie";
String portNumber = "1521";
String sid = "orawit";
String url = "jdbc:oracle:thin:@" + serverName + ":" + portNumber + ":" + sid;
String username = "W01445693";
String password = "EPEDXZ";
connection = DriverManager.getConnectio n(url, username, password);
} catch (ClassNotFoundException e) {
out.println( "Could not find the database driver");
} catch (SQLException e) {
e.printStackTrace();
out.println( "Could not connect to the database");
}
%>
<%
session.setAttribute("User name",requ est.getPar ameter("Us ername"));
try
{
String user = request.getParameter("User name");
String formPassword = request.getParameter("Pass word");
String Password = null;
Statement stmt = connection.createStatement ();
ResultSet rs = stmt.executeQuery("select Pass from Supervisor WHERE Username = '" + user + "'");
if( formPassword == null) {
String redirectURL = "/momentum/error.jsp";
response.sendRedirect(redi rectURL);
}
else {
if( rs.next() )
{
Password = rs.getString("Password");
if( formPassword.equals( Password ) )
{
//login sucess
String redirectURL = "/momentum/adminoptions.js p";
response.sendRedirect(redi rectURL);
}
else
{
//login failed
String redirectURL = "/momentum/error.jsp";
response.sendRedirect(redi rectURL);
}
}
else
{
//Login failed
String redirectURL = "/momentum/error1.jsp";
response.sendRedirect(redi rectURL);
}
}
}
finally
{
connection.close();
}
%>
</body>
</html>
any ideas?
thanks!
Im currently trying to create a login in jsp and im getting the following errors:
org.apache.jasper.JasperEx
error: Invalid class file format in C:\Program Files\Java\jdk1.5.0_06\jre
G:\tomcat4\work\Standalone
package org.apache.jsp;
^
2 errors, 1 warning
Im not sure if this is a problem with my setup or what it is.
the code being used here is:
<%@ page import="java.sql.*" %>
<html>
<head>
<title>Admin Verification</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<%
Connection connection = null;
try {
// Load the JDBC driver
String driverName = "oracle.jdbc.driver.Oracle
Class.forName(driverName);
// Create a connection to the database
String serverName = "witnt07.wit.ie";
String portNumber = "1521";
String sid = "orawit";
String url = "jdbc:oracle:thin:@" + serverName + ":" + portNumber + ":" + sid;
String username = "W01445693";
String password = "EPEDXZ";
connection = DriverManager.getConnectio
} catch (ClassNotFoundException e) {
out.println( "Could not find the database driver");
} catch (SQLException e) {
e.printStackTrace();
out.println( "Could not connect to the database");
}
%>
<%
session.setAttribute("User
try
{
String user = request.getParameter("User
String formPassword = request.getParameter("Pass
String Password = null;
Statement stmt = connection.createStatement
ResultSet rs = stmt.executeQuery("select Pass from Supervisor WHERE Username = '" + user + "'");
if( formPassword == null) {
String redirectURL = "/momentum/error.jsp";
response.sendRedirect(redi
}
else {
if( rs.next() )
{
Password = rs.getString("Password");
if( formPassword.equals( Password ) )
{
//login sucess
String redirectURL = "/momentum/adminoptions.js
response.sendRedirect(redi
}
else
{
//login failed
String redirectURL = "/momentum/error.jsp";
response.sendRedirect(redi
}
}
else
{
//Login failed
String redirectURL = "/momentum/error1.jsp";
response.sendRedirect(redi
}
}
}
finally
{
connection.close();
}
%>
</body>
</html>
any ideas?
thanks!
If your using an IDE, specifically eclipse check the JRE you are using sometimes it does conflicts on JRE's right click the project and then properties select the java compiler to change settings or any equivalent you may also want to rebuild ;)
The reason it conflics are for features(methods etc...) of your applocation which are not enabled yet for some versions.
ASKER
Im not actually using JRE. Just dreamweaver to build the pages.
> Im not actually using JRE. Just dreamweaver to build the pages.
it may not be JRE's it can be the main compiler 2 > C:\Program Files\Java\jdk1.5.0_06\jre \lib\rt.ja r(java/lan g/Object.c lass)
it may not be JRE's it can be the main compiler 2 > C:\Program Files\Java\jdk1.5.0_06\jre
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Are you saying that I may need a newer version of tomcat or how exactly can i solve this issue?
> The major.minor version '49.0' is too recent for this tool to understand.
It might be that some of what you are using are already depricated ;)
It might be that some of what you are using are already depricated ;)
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
> Are you saying that I may need a newer version of tomcat or how exactly can i solve this issue?
You can try 1st if 1.4.2 of java the rebuild your project if it doesnt help then use a lesser version of tomcat which is compatible w/ your jre ;)
It happend to me once when I use eclipse.
You can try 1st if 1.4.2 of java the rebuild your project if it doesnt help then use a lesser version of tomcat which is compatible w/ your jre ;)
It happend to me once when I use eclipse.
ASKER
>>
Try using a much lesser version of java :D
I dont actually have admin rights to the machine that i am working on. Is there any solution for this other than working with an older verison of Java?
Try using a much lesser version of java :D
I dont actually have admin rights to the machine that i am working on. Is there any solution for this other than working with an older verison of Java?
ASKER
>>>You can try 1st if 1.4.2 of java the rebuild your project if it doesnt help then use a lesser version of tomcat which is compatible w/ your jre ;)
It happend to me once when I use eclipse.
Ill try this now!
It happend to me once when I use eclipse.
Ill try this now!
If I'm not mistaken (tomcat version == java version) to work well, see the JDK 1.4 Compatability Package:
http://tomcat.apache.org/download-55.cgi
http://tomcat.apache.org/download-55.cgi
i think you need to use a newer vesion of Tomcat not a older version.
> i think you need to use a newer vesion of Tomcat not a older version.
Depends on which is more stable ;)
Depends on which is more stable ;)
ASKER
Ok ive upgraded to a newer version of tomcat as you suggested above and now im getting the error:
org.apache.jasper.JasperEx ception: Unable to compile class for JSP
org.apache.jasper.JasperEx
ASKER
also:
root cause
java.io.FileNotFoundExcept ion: G:\apache-tomcat-5.5.16\wo rk\Catalin a\localhos t\_\org\ap ache\jsp\a dminresult 1_jsp.java (Access is denied)
root cause
java.io.FileNotFoundExcept
please give the full exception.
> Ok ive upgraded to a newer version of tomcat
Remember that tomcat also varies with version of your java compiler so if you downloaded 5.5.16 try java 1.4
Remember that tomcat also varies with version of your java compiler so if you downloaded 5.5.16 try java 1.4
i think you have some access permission problem.
Or see if your previous tomcat is still running if not proceed with my comment above.
ASKER
ive seen other posts on EE with similar errors refering to a classes.zip file? i dont think i have this in my setuo. could it be related to the problem and if so what do i do with this file?
Could be :) it doesnt hurt to try.
ASKER
OK ive tried to add that file and no luck. Ive also attempted to get rid of the pronblem with an upgrade of my tomcat version but im getting another error, i think it may be something to do with permissions.
when i start tomcat there are a few errors though which may be contributing to the upgrade from working, see this screenshot: http://www.templateit.net/javascreen.JPG
Is there a way to change paths or something to get rid of the above errors. I think this may be the reason that the files are failing to compile.
when i start tomcat there are a few errors though which may be contributing to the upgrade from working, see this screenshot: http://www.templateit.net/javascreen.JPG
Is there a way to change paths or something to get rid of the above errors. I think this may be the reason that the files are failing to compile.
Are you not the admininstrator ? if so better uninstall tomcat on add/remove and then use the zip file it works even w/o admin ;)
why not to try the same thing in administartor mode???
i think it is surely file access permission issue.
i think it is surely file access permission issue.
javatm we think lot alike.
:-)
:-)
ASKER
I dont have admin rights here im afraid.... i would do it at home but i dont have an oracle licence! :-(
and for a good start I would suggest use netbeans IDE its a combination of all a web-editor, integrated tomcat, and many more just try it cause its what I'm using
I'm pretty sure w/ all this mess it's a 98% cure :
Download : http://www.netbeans.info/downloads/download.php?type=5.0
Features : http://www.netbeans.org/products/ide/features.html
Tutorials : http://www.netbeans.org/kb/50/quickstart-webapps.html
I'm pretty sure w/ all this mess it's a 98% cure :
Download : http://www.netbeans.info/downloads/download.php?type=5.0
Features : http://www.netbeans.org/products/ide/features.html
Tutorials : http://www.netbeans.org/kb/50/quickstart-webapps.html
> I dont have admin rights here im afraid....
Use the zip for tomcat or better use this IDE as what my suggestion suggest :)
http://us1.mirror.netbeans.org/download/5_0/fcs/200601251500/netbeans-5_0.zip
Use the zip for tomcat or better use this IDE as what my suggestion suggest :)
http://us1.mirror.netbeans.org/download/5_0/fcs/200601251500/netbeans-5_0.zip
ASKER
i think youve pretty much solved that problem so ill close the question.
ive changed machines to a pc running java 1.4 and with tomcat version 4 so that conflic will be gone. I still get errors in my script though so ill be opening another question v soon :-)
ive changed machines to a pc running java 1.4 and with tomcat version 4 so that conflic will be gone. I still get errors in my script though so ill be opening another question v soon :-)
Hahaha glad I was able to help thanks a lot ;)