Tomcat 4.1 class problem. Doesn't identify the class.

Hi
I just installed J2SDK and tomcat in windows xp. I've made jsp files and beans. The first page is customerlogin.jsp which takes user id and password in a form. It sends the request to authenticate.jsp. Would you please give me a few important steps that need to be done?
My directory structure is as follows:
C:\Tomcat 4.1\Webapps\Log -> jsps
c:\Tomcat 4.1\Webapps\Log\WEB-INF\classes\Log -> java beans
The jsp doesn't find AuthenBean class. It complains about it.
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 1 in the jsp file: /authenticate.jsp
Generated servlet error:
[javac] Compiling 1 source file
C:\Tomcat 4.1\work\Standalone\localhost\Log\authenticate_jsp.java:43: package Log does not exist
Log.AuthenBean Authen = null;
^
******** AuthenBean is : *********
package Log;
public class AuthenBean{
     String userid;
     String password;
     public void setUserid (String tuserid) {
               userid = tuserid;
     public void setPassword (String tpassword) {
               password = tpassword;
     public String getUserid() { return userid; }
     public String getPassword() { return password; }
******** Authenticate.jsp ***********
<jsp:useBean id="Authen" class="Log.AuthenBean" scope="session"/>
<jsp:useBean id="select" class="Log.ExecuteQuery"/>
<jsp:setProperty name="Authen" property="*"/>
<%
String id = Authen.getUserid();
String passwd = Authen.getPassword();
out.print("User id is " + id);
out.print("Password is " + passwd);
%>
<%@ page import="java.util.Vector" %>
<% Vector aResult = select.getResult();
select.connect();
boolean idCheck = false;
String query = new String();
query = "SELECT EMPLOYEE_ID, FIRST_NAME, LAST_NAME, PASSWORD, COUNTY, AREA FROM EMPLOYEE, LOCATION WHERE EMPLOYEE_ID = '" + id + "' AND PASSWORD = '" + passwd + "' AND (EMPLOYEE.LOCATION_ID = LOCATION.LOCATION_ID)";
select.select(query, 6);
select.disconn();
int size = aResult.size();
if(size > 0){
idCheck = true;
if(idCheck)
     session.setAttribute("loginId",id);
     session.setAttribute("firstName",(String)aResult.elementAt(1));
     session.setAttribute("lastName",(String)aResult.elementAt(2));
     session.setAttribute("county",(String)aResult.elementAt(4));
     session.setAttribute("area",(String)aResult.elementAt(5));
%>
<jsp:forward page="customer.jsp"/>
<%
else
String error_msg = "Error: User Authentication Failed!";
String link = "customerlogin.jsp";
session.setAttribute("prevPage", link);
session.setAttribute("errorMsg", error_msg);
}%>
****** web.xml in Log\WEB-INF is **********
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<servlet>
<servlet-name>Log\AuthenBean</servlet-name>
<servlet-class>Log\AuthenBean</servlet-class>
</servlet>
<servlet>
<servlet-name>Log\ExecuteQuery</servlet-name>
<servlet-class>Log\ExecuteQuery</servlet-class>
</servlet>
</web-app>
Your help would be appreciated
Thanks!

Your problem is in web.xml. Only servlet classes need to be mapped. Your bean class should not be.
****** web.xml in Log\WEB-INF is **********
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web
Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<servlet>
<servlet-name>Log\AuthenBean</servlet-name>
<servlet-class>Log\AuthenBean</servlet-class>
</servlet>
<servlet>
<servlet-name>Log\ExecuteQuery</servlet-name>
<servlet-class>Log\ExecuteQuery</servlet-class>
</servlet>
</web-app>
If you have only jsps, u mau use
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web
Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
</web-app>
Hope it works.
Hafizur Rahman
SCJP

Similar Messages

  • Class xyz is not in the class path

    When I used:
    <jsp:useBean id="blast" scope="session"class="hr.pbf.pnf.castorblast2.BlastOutput"/>
    (or other class) , I get an warning: "The class hr.pbf.pnf.castorblast2.BlastOutput" is not in the class path ???

    Hi,
    The possible reason could be that class is not present in project class path.
    Check the following location to make sure the project is configured with source and required libraries
    - Project > Properties > Java Build Path > Source Tab / Libraries Tab
    M7 Support

  • This VI is part of a LabVIEW class. No part of the class is executable at this time because one of the member VIs is missing. However I am not missing a vi

    I only have 1 vi and its not missing.  The 1 vi claims the owning library has blocked the execution of the VI.  The class has the error "This VI is part of a LabVIEW class. No part of the class is executable at this time because one of the member VIs is missing. Find the missing member VIs on disk and load them into memory or delete them from the class definition in the project tree."
    But there is only 1 member vi!!??
    I had lots of other vi's as part of this class but somehow this class got botched with this error.  I removed all vi from the directory and from the class definition and re made just the one assessor vi and still got the error message.
    I have attached my ridiculously simple class.
    I have other classes that work fine but somehow this one seems to have gotten botched.  I really need to understand what happened here and how to recover/avoid this error or I will not have the confidence to develop large applications using classes.
    In other words...PLEASE HELP!
    Solved!
    Go to Solution.
    Attachments:
    Tree class.zip ‏14 KB

    I cannot tell you why.  Only what it is missing.
    If you look in the Tree.lvclass file using something like Notepad, towards the bottom you will see some XML that looks like:
    <Item Name="Untitled 1" Type="VI">
            <Property Name="NI.ClassItem.ConnectorPane" Type="Bin">#1#!!!!!!!)!"1!&amp;!!!-!%!!!@````]!!!!"!!%!!!$H!!!!#1!-1#%'=X2B&gt;(6T!!!,1!-!"'.P:'5!!""!-0````]'=W^V=G.F!!!71&amp;!!!Q!!!!%!!AFF=H*P=C"P&gt;81!"!!!!#*!=!!?!!!/$&amp;2S:75O&lt;(&lt;'&amp;T=Q!!#&amp;2S:75A&lt;X6U!!!A1&amp;!!!Q!!!!%!!B.F=H*P=C"J&lt;C!I&lt;G]A:8*S&lt;X)J!#"!=!!?!!!/$&amp;2S:75O&lt;(&lt;'&amp;T=Q!!"V2S:75A;7Y!0!$Q!!Q!!Q!%!!1!"1!%!!1!"!!%!!9!"!!%!!=#!!"Y$1A!!!!!D1M!!!!!!!!!!!A!!!!!!*!!!!!!!1!)!!!!!!</Property>
            <Property Name="NI.ClassItem.ExecutionSystem" Type="Int">-1</Property>
            <Property Name="NI.ClassItem.Flags" Type="Int">0</Property>
            <Property Name="NI.ClassItem.IsStaticMethod" Type="Bool">false</Property>
            <Property Name="NI.ClassItem.MethodScope" Type="UInt">1</Property>
            <Property Name="NI.ClassItem.Priority" Type="Int">1</Property>
            <Property Name="NI.ClassItem.State" Type="Int">1342841344</Property>
        </Item>
    Delete this block.  Make a backup of the file before you do that.  Start up LV and load the class again.
    My guess is that something probably did not save properly when LV shut down.  I have a large OO project and have had more than one occasion where I have corrupted the project but could ot figure out why. 
    Today I had a similar message which is why your post caught my eye.  In doing some troubleshooting I found that it no longer 'knew' where one of my files was but it never complained when it loaded the project.  I went back to the original project and tried to open that vi from the project.  That is when it told me that the vi was not in the expected location, do you want to correct it.  I said yes and all was better. 
    Trying to open all of the VIs in the class might have worked, but this can be cumbersome to say the least in a large class.
    Good luck,
    Kurt

  • Attempts exist for this class. You cannot delete the class until you have d

    Attempts exist for this class. You cannot delete the class until you have deleted the attempts.
    Does anyone know how to delete the attemps against a Learning Object. I can delete the enrollments but when I go to delete the class or the learning object i get this message.
    This is for a Test environment.
    Thanks.
    John

    Hi John,
    You are right about the wording.
    There is no simple way of deleting classes. This is because the classes are normally used for the Learner's history and if there is an attempt there is also normally at least one Learner with a history of that Class.
    I know you can delete the Learners from a Class but these scenarios happens so seldom, that we have not yet had the need to have a "delete class feature".
    But if you have the business case for this, you are welcome to raise a SR for an enhancement for this.
    Regards Anders Northeved

  • My derived class suddenly doesn't recognize the parent class

    I had my assignment coded, debugged, working and ready to go. So I bring my flash drive upstairs to play around with it on my other computer. When I compile the base class it compiles fine, but now when I try to compile the derived class, and the test class with the main method, I'm coming up with errors.
    They have something to do with the base class not being recognized, because I can't instantiate any objects of the class now, and i get an error when attempting to compile the derived class to the effect of "cannot find symbol; symbol: class BaseClass". i get this error throughout the derived class, from the initial declaration of the class (public class DerivedClass extends BaseClass), to any references made toward methods of the parent class.
    My base class compiles with no problem, but it's like nothing else is able to "use" it. I'm not sure if it has something to do with the PC im using now, and I can't confirm this at the moment because the PC I used to write the code is down (waiting on an upgrade).
    ehhh.....help.
    Message was edited by:
    asphaltninja
    null

    It's not the fault of the computer hardware.
    It's not the fault of the operating system.
    It's not the fault of the JDK.
    So don't go rebooting or reinstalling anything. The problem is that you didn't set up things on the new computer in the same way they were set up on the old computer.
    In particular the compiling problem is that the compiled version of BaseClass isn't in the classpath when you try to compile DerivedClass. I can't tell why from your description.

  • A problem with ACL in the class-map on the ACE module

                      Hi all,
    I configured the following on the ACE module:
    object-group network test
      host 192.168.1.21
      host 192.168.1.22
      host 192.168.1.23
    object-group service port
      tcp eq www
      tcp eq 8080
    access-list T line 8 extended permit object-group port object-group test any
    I tried to configure a class-map for matching this ACL:
    ACE-4710-2/Lab-OPT-11(config)# class-map match-any TEST_C
    ACE-4710-2/Lab-OPT-11(config-cmap)# match access-list T
    Error: Cannot associate acl having object-group ACEs in class-map.
    So couldn't I  configure the class-map by using ACL with object-groups involved? Is it the bug or the normal behaviour? Because the customer uses object-groups in ACLs and he has to configure ACL without object-groups for the traffic classification. It is horrible.
    Thank you
    Roman

    Hi Roman,
    I'm afraid it's the expected behavior. You cannot use an ACL with object-groups inside a class-map.
    Regards
    Daniel

  • Problem with getRealPath in the class ServletContext

    this is a bug in tomcat 4.1
    ServletContext scon=getServletConfig().getServletContext();
    String path = scon.getRealPath("index.html");
    this lines return the path of the archive index.html but with a caracater of espace example:
    C:\Archivos de programa\Apache Group\Tomcat 4.1\webapps\prueba \index.html
    ----------------------------------------------------------------------------------------------^

    i don't think this is a bug...
    if you're using a MS OS (Windows) your java environment will normally return a files path using the backslash character instead of the normal slash.

  • "Error sending Message - check your ...." doesn't identify the message generating the error which is probably one which is autoforwarded.

    I have an email filter which auto-forwards an email depending on the To: field. When I open Thunderbird the inbox sometimes displays emails which should have been forwarded which are not flagged as forwarded. If I then manually forward this email I get a response " email successfully sent" followed shortly after by another message " error sending message ... check your email addresses (or similar)" - Is this the same email as the one which I have just been told has been successfully sent - how can I tell which email the message relates to - has it been sent? etc etc???
    Thanks for reading this far - any help would be very much appreciated
    MC

    Sorry Matt - 'fraid i'm guilty of not supplying all the facts ... the message arises from Thunderbird vers 9.01 running on a laptop with OS Win 7 Home Premiun SP 1. I think your reference is to problems running other email software.
    Mike

  • Class.forName() doesn't take dynamic class name

    String name="";
    String country="";
    String className = name + "_" + language + "_" + country;
    Class thisClass = Dynamicclassload.classLoad(className);
    System.out.println(className);
    Class class1 = Class.forName(className);
    child = (ResourceBundle) class1.newInstance();
    child.setParent( bundle );
    bundle = child;
    System.out.println("I am here");
    As i am passing classname as variable it throws an exception class not found exception.but if we write class name as the parameter of class.forName().it works.i am implementing in j2me
    why this happen? give me solution.

    The following classpackage test;
    public class TestLoad {
        String aString = "This is a Test";
        Integer anInteger = new Integer(42);
        public TestLoad() {
            System.out.println("aString = " + aString + ", anInteger = " + anInteger);
    }works correctly when loaded and instantiated by this class:package test;
    import java.util.logging.Logger;
    public class ExecuteTest {
        public static final Logger log = Logger.getAnonymousLogger();
        public static void main(String[] args) {
            try {
                Class clazz = Class.forName("test.TestLoad");
                TestLoad test = (TestLoad) clazz.newInstance();
            } catch (Exception ex) {
                log.severe(ex.toString());
    }and produces the string "aString = This is a Test, anInteger = 42"
    I used the following version of Java on Windows 2000
    java version "1.4.0"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-b92)
    Java HotSpot(TM) Client VM (build 1.4.0-b92, mixed mode)

  • Class unloading doesn't work as described in this forum !!!

    Hi,
    to the problem of dynamic class unloading many people in this forum wrote:
    - write your own class loader
    - load the class to be unloaded later
    - set all instances of your own class loader to null
    - if the work is done set all instances of the loaded classes to null
    - call the garbage collector and the classes will be removed
    I constructed a simple test for the problem:
    - the test class
    public class Impl {
    public String getVersion () {
    return "1";
    - instanciating the test class
    - printing the value of getVersion() to the screen
    - changing the return value of getVersion() and recompiling it (the test application is still runnig)
    - unload try (see below)
    - instanciating the test class
    - printing the value of getVersion() to the screen
    Back to the tipps above. Why doing this? The theory says a class loader stores every loaded class for
    suppressing unnecessary reloads. In reality the classes are NOT stored in the own class loader but in
    the parent of it. If no parameter is given to a class loader's constructor the parent of a class loader
    is the system classloader.
    Let's have a look at the source code of java.lang.ClassLoader.loadClass(...):
    protected synchronized Class loadClass(String name, boolean resolve)
    throws ClassNotFoundException
    // First, check if the class has already been loaded
    Class c = findLoadedClass(name);
    if (c == null) {
    try {
    if (parent != null) {
    ### here the loadClass() of the parent is called and the
    ### loaded class is stored within the parent
    c = parent.loadClass(name, false);
    } else {
    c = findBootstrapClass(name);
    } catch (ClassNotFoundException e) {
    // If still not found, then call findClass in order
    // to find the class.
    c = findClass(name);
    if (resolve) {
    resolveClass(c);
    return c;
    My Idea was: Give a null to the class loader's constructor so the classes cannot be stored within a parent.
    Here my test class loader (it is build as it is described within javadoc of java.lang.ClassLoader
    except the constructor):
    import java.io.*;
    public class MyClassLoader extends ClassLoader {
    public MyClassLoader () {
    super ( null );
    public Class findClass ( String name ) {
    byte[] b = loadClassData ( name );
    return defineClass ( name, b, 0, b.length );
    private byte[] loadClassData ( String name ) {
    byte[] ret = null;
    try {
    InputStream in = new FileInputStream ( name + ".class" );
    ret = new byte[in.available ()];
    in.read ( ret );
    } catch ( Exception e ) {
    e.printStackTrace ();
    return ret;
    The loading of the class works fine
    ClassLoader cl = new MyClassLoader ();
    Class c = cl.loadClass ( "Impl" );
    Object i = c.newInstance ();
    Impl impl = (Impl)i;
    The class "Impl" was found and instanciated. But the cast "Impl impl = (Impl)i;" causes a
    "java.lang.ClassCastException: Impl"
    May second idea was deleting all instances of the class to unload from the class loader via reflection.
    A strange way I know but if this is the only way I will do it. But this doesn't work too.
    After deleting the class from the class loader and all its parents the class is still anywhere in the depth
    of the VM.
    Can anybody help me with this problem?
    Thanks in advance,
    Axel.

    <pre>
    I made a similar and simpler program and it worked:
    import java.net.URLClassLoader;
    import java.net.URL;
    public class DynamicExtension {
         public static void main(String args[]) throws Exception {
              URL[] ua = new URL[] {  new URL("file://c:\\TEMP\\") };
              URLClassLoader ucl = new URLClassLoader(ua);
              MyLoadable l =
                   (MyLoadable) ucl.loadClass("LoadableObject").newInstance();
              l.printVersion();
              Thread.currentThread().sleep(10000);
    //you have ten seconds to replace the old version of the LoadableObject.class file
    //so yo?d better had compiled the new one before executing this
              ucl = new URLClassLoader(ua);
              l = (MyLoadable) ucl.loadClass("LoadableObject").newInstance();
              l.printVersion();
              ucl = null;
              l = null;
              System.gc();
    public class LoadableObject implements MyLoadable {
         public void printVersion() {
              System.out.println("version 1");
         protected void finalize() {
              System.out.println("finalizing " + this);
    public interface MyLoadable {     void printVersion();  }
    C:\Java\TIJ2\Test>java DynamicExtension
    version 1
    version 2
    finalizing LoadableObject@1bd03e
    finalizing LoadableObject@4abc9
    The ClassCastException was due to the fact that one class was loaded by the system class loader, the one that appers as Impl impl = (Impl), and the other by MyClassLoader. That mean that they are different for the VM because they are in different namespaces: The namespace for MyClassLoader is the set of classes loaded by itself and those returned to it by his parent class loader as a result of a request to MyClassLoader?s parent class loader to load a class.
    Setting null for the parent of MyClassLoader was in fact the cause of the problem, because that caused a call to a native method called findBoostrapClass. I guess this method looks for the classes in the bootstrap classpath where MyClassLoader shouldn?t be. This causes MyClassLoader loaded the class itself. If MyClassLoader had had the system class loader as its parent the result had been that only one classloader would have loaded the class. This is what happens in the example above so no ClassCastException is thrown.
    In the source code for ClassLoader
    there is the following:
    * The classes loaded by this class loader. The only purpose of this
    * table is to keep the classes from being GC'ed until the loader
    * is GC'ed.
    private Vector classes = new Vector(); /*
    and:
    * Called by the VM to record every loaded class with this loader.
    void addClass(Class c) {
    classes.addElement(c);
    I would like to have seen findLoadedClass checking the already loaded classes in this Vector, but this method is native. Anyway, as the code for loadClass shows, the parent or bootstrap classloader is checked if findLoadedClass doesn?t find the class; Can we guess that findLoadedClass only checks the clases loaded by the classloader, not its parent?
    By the way, could an example like this be made in c++?
    </pre>

  • Unique "flash question folder" problem, doesn't boost from either HD/drive

    Hello, I am pretending to be a Mac expert to my friends (Please don't laugh at me, Cornelius, Douglas, Duane or others). One of my friends went to me with a iBook G3 with a classic flashing question folder on screen. I promised her I would fix it next day. But now I am stucked on it. I thought it would just be an OS issue. It seems it is more complicated than that. I tried to install 10.4 from DVD, by restarting while holding down "C" key. It did not boost from there. Fine, it might just be an optical drive problem. I dived into the book, replace the HD with a known-good one having OS installed. The book still won't boost. Fine, it might be the a bad connection between HD/drive to the mother board. So I threw in a good signal cable. Nothing I have done really helped the boosting issue. I think I have to bring the same non-working book back to her on Tues or Wed. So embarrassed. Maybe you guys can help me out? Thank you.

    There is an article on the flashing question mark that might be helpful:
    http://docs.info.apple.com/article.html?artnum=58042
    It sounds like you might already have done more than was necessary, but it should be possible to get back in business. I'm not the one to advise you, as I am not all that experienced myself. But the more knowledgeable memebers of the forum should be able to help.
    One thing--do you have all of the original install discs? If you don't, see if you can get them from your friend. You will probably need to have them on hand. Often people have to hunt for these, so you might be able to stall for a little more time while you get some answers from the forum. Also, the install discs will contain the Apple Hardware Test, which you can run and look for hardware problems.
    Also, identify the iBook model more completely. Here's the article to find that out:
    http://docs.info.apple.com/article.html?artnum=88039
    Posting more detail will help others to advise you.
    Good luck!

  • Smart forms - Identifying the calling method and class

    Hi Experts,
    Is there a way to identify the method and class names that called a smart form..
    Any inputs or pointers in this regard woul;d be of great help.
    Regards,
    Kris.

    Hi Kartik,
    The procedure you suggested is good to identify the class by manual intervention.
    But I need the class/mehtod name in the program as the logic of the code depends on which class called the smart form.
    Any idea how this can be read?
    Regards,
    Kris.

  • Does a member class have to be within the same source file?

    Hi there,
    I have this application that extensively uses two classes. The main class setsup the GUI, and the second main class is responsible for handling all of the actions that arise from the GUI.
    I could have done this by making all of my handler methods be of the first main class, but this class really is just for the GUI setup, the logic doesn't fit into this class' behaviour.
    The class that handles the GUI actions is required to use the fields of the main class e.g. to get values of a text field. The problem is that since the class that handles the actions is getting very big, I would kind of like to move this class into a different source file - because currently it is a member class of the first one, so that it can access all of its fields.
    Is there some way that I can move this handler class into another source file, and still have it access all of the fields of the main GUI class - without making the fields public, or using millions of get/set methods? Also, I can't use inheritance because the both the GUI class creates an instance of the handler class in its constructor, and so leads to an infinite loop when trying to instantiate the GUI class.
    Can I ask.. would a static class or something be of use here? Do they exist? I'm confused as to how to do this without getting the mother of all source files (in size that is - nothing to do with cooking or baking).
    - Anyway, thanks in advance for any help that you could give me -
    BYEE, Edd.

    You can't have an inner class that is not in the same source file. However, you could use package-protected (default) access to give another class in the same package access to things without making them public. Actually, that's how inner classes are actually compiled. Package-protected access is underused IMHO. It's a great tool that most people (including myself) are suspicious of at first.

  • Code Completion does not show the Class I want

    Hello!
    I try to get familiar with JDeveloper 10.1.3.
    I have a simple project with an external Jar file.
    In this project I am using the swing file-chooser dialog. So I want to use a FileFilter to let the user choose only one type of file.
    At least there are three FileFilter:
    1. java.io
    2. javax.swing.filechooser (<- this is the one I want)
    3. com.ibm.as400.vaccess.FileFilter
    When i type FileFi the code insight is positioned on Float.
    The little window mentions alt-enter to get the 3rd choice (ibm FileFilter)
    So, do we have a bug, or is it just a config problem or do i want to much?
    With kind regards
    Joerg Fechner

    Hi,
    The javax.swing.filechooser.FileFilter class is an abstract class. Though JDeveloper imports the class for you, it cannot be instantiated. E.g.
    jfc.setFileFilter(new FileFilter());
    doesn't work because you cannot instantiate an abstract class. JDeveloper will show this file as underlined in red to indicate this.
    When importcing classes through pressing alt+Enter, a dilaog shows up that you select the wanted import through the arrow - down or - up key. Press Enter to confirm the selected choice
    Frank

  • FM/BAPI for assigning a class and value for the class instead of manually d

    Hi guys,
    Instead of manually adding equipment class and assigning value for the class added can i get a FM or BAPI.
    this is for transaction IE02.
    rewards will be given.

    Hi
    I hope this thread can help you
    Characteristic Value
    Re: Equipment Characteristic Value
    Change Equipment Using Transaction IE02
    Regards
    pavan

Maybe you are looking for