• Post Reply Bookmark Topic Watch Topic
  • New Topic

Tomcat not able to find my user defined classes for my JSPs  RSS feed

 
Anjali Lourda
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have just installed and configured Tomcat 4.0 on my Machine on Windows 98.
I made added the following tag in server.xml file:
<Context path="/anjali" docBase="anjali" debug="0" reloadable="true" />
I made my directory under webapps/anjali and stored my jsp files in anjali folder.
Then I made the web-inf folder under which i made the classes folder in which I put the java class files that I had made.
But when I try to run the file it gives me this errror:
org.apache.jasper.JasperException: Unable to compile class for JSPNote: sun.tools.javac.Main has been deprecated.

An error occured between lines: 17 and 57 in the jsp file: /index1.jsp
Generated servlet error:
C:\jakarta-tomcat-4.0\work\localhost\anjali\index1$jsp.java:84: Class org.apache.jsp.MyAuthenticator not found.
Authenticator auth = new MyAuthenticator();

What am I doing wrong??
Thanx in advance
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From the way the error is stated:
C:\jakarta-tomcat-4.0\work\localhost\anjali\index1$jsp.java:84: Class
org.apache.jsp.MyAuthenticator not found.
Authenticator auth = new MyAuthenticator();
I would guess that you didn't put MyAuthenticator in a package or if you did, you did not import that package.
Bill
------------------
author of:
 
Anjali Lourda
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
thanx for replying!!
Do I need to put my classes in some package or other? Coz i havent put them in any package as yet, didnt think it was necessary to run them on Tomcat??
Was wondering if there are any changes in configuration that need to be done , say to the classpath, to tell Tomcat to pick up the classes from there???
Thanx again
Originally posted by William Brogden:
From the way the error is stated:
C:\jakarta-tomcat-4.0\work\localhost\anjali\index1$jsp.java:84: Class
org.apache.jsp.MyAuthenticator not found.
Authenticator auth = new MyAuthenticator();
I would guess that you didn't put MyAuthenticator in a package or if you did, you did not import that package.
Bill

 
Tom Diamond
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, from the error message it seems that MyAuthentication class (which I presume is one of the classes you've made) is already part of the package org.apache.jsp.
C:\jakarta-tomcat-4.0\work\localhost\anjali\index1$jsp.java:84: Class org.apache.jsp.MyAuthenticator not found.

So the path to the class must be something like :
WEB-INF/classes/org/apache/jsp/MyAuthentication.class
You may also put all classes of the package in a jar file and put the jar file in WEB-INF/lib folder.
Just make sure that WEB-INF is cappitalized (Java is case sensitive while Win**** are not). I had some problems with that in my machine...
Tom.
[This message has been edited by Tom Diamond (edited September 26, 2001).]
 
ramkumar subbarao
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anjali,
you can do the following. place the MyAuthentication.class under WEB-INF/classes/ directory of your context(in your case anjali).Then in the JSP , import it. i.e
<%@ page import="MyAuthentication.class" %>
This should work
Hope this helps
SRK
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!