Problem compiling simple servlet

I am trying to compile a very simple servlet.
When I do, I get the following error message:
Package javax.servlet does not exist
I am using the Java 2 SDK, Standard Edition Version 1.3.1.
I have downloaded the servlet api (zip file servletapi2_1_1win.zip)
from Sun's site. I unzipped these files in my lib directory; there are two folders,
one called api and the other called src. Api and Src directories have their own
sub-folders, javax/servlet/http etc.
I am using W2K ; I had to create a CLASSPATH system variable in the environment
variables section of control panel since there was none defined.
I added the following line:
C:\jdk1.3.1_01\lib\api\javax\servlet;C:\jdk1.3.1_01\lib\api\javax\servlet\http;
I also did this for the PATH statement..
My servlet looks like this:
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class howdy extends HttpServlet {
public void doGet(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException {
res.setContentType("text/html");
PrintWriter out = res.getWriter();
out.println("<HTML>");
out.println("<HEAD><TITLE>Hello World </TITLE></HEAD>");
out.println("<BODY>");
out.println("<BIG>Hello World </BIG>");
out.println("</BODY></HTML>");

Thanks. I was able to figure it out by specifying the
full classpath
at the command line, like this:
C:> javac -classpath
C:\jdk1.3.1_01\lib\servletapi2_1_1-win.zip\MyServlet.ja
a
Apparantly the system doesn't acknowledge the
environmental variable that
I created in the control panel; also I have no
autoexec.bat file...so it
looks like I have to write out the full path whenever
I need to compile
something. Kind of bothersome, but at least it
works.
You shouldn't have to do this. What operating system are you using?
If you are using win2000, winNT or winxp, you should set the classpath in your system environment varialbes. You can also make a config.bat file and put everything in there. Then just run this config.bat file to set up your environment once for every session.
Here's a file that I have set up on one of our NT machines. I just double click the icon for this file on my shortcut, and it gives me the window where I can compile my java programs.
Hope this helps.
Kamran
=========== File SetJava.bat ============
set PATH=%PATH%;m:\jdk1.3\bin
set CLASSPATH=m:\jdk1.3\jre\lib;m:\jdk1.3\jaxp-1.1\jaxp.jar;m:\jdk1.3\jaxp-1.1\crimson.jar;m:\jdk1.3\jaxp-1.1\xalan.jar;.
cd cis235
%SystemRoot%\system32\cmd.exe

Similar Messages

  • Problem running simple servlet on tomcat 4.0

    hi,
    i have setup tomcat4.0 on the server and i am trying to run a simple servlet but it is not working. here is what i have done:
    1. setting the CATALINA_HOME variable to the directory where tomcat is installed
    2. setting the classpath variable to servlet.jar
    3. i am putting the .class fille in tomcat-home-directory/webapps/ROOTS/WEB-INF/classes
    4. i am giving the url as http://localhost:8080/servlet/HelloServlet.class
    but error is given...could you please tell where could i have probably made a mistake
    regards
    preeti

    hi tnguyen1973
    now my servlets are running on the server provided they are kept under /examples/WEB-INF/classes. But now i have my own folder at the same level of examples called Lm which also has WEB-INF/classes. but if i put my servlets here it is giving exception.hope u got me. please, tell me where should i make necessary modifications to get the servlets run from my own folder instead of examples
    thank u

  • Problems compiling a servlet

    Hello,
    I recently installed Tomcat 4.1.24 and I am trying to compile a servlet but with no success. The error I get is package javax.servlet does not exist. I have set up jdk1.3.1-3 and the environment paths. I have been successful in compiling regular java applications. I am currently just using the dos prompt and command line c:\javac somefile.java
    When I tried to compile a servlet, I ran into the javax.servlet error so I found a javax.jar file and added it to the jdk1/3/1-3\lib directory but the compile still fails.. I even tried to add it to the environment path but that still doesn't work...
    could someone tell me where I would need to add the javax.jar file? and what adjustment I need to make to be able to compile servlets?
    thanks in advance for any help
    gjcat777

    You need to get J2EE (Java 2 Enterprise Edition). Download it and install it. It's basically a couple of JAR files that you need to use. Under $J2EE_HOME/lib there is a file called J2EE.jar Include that JAR file into your project and carry on with your servlet development.

  • Problem compiling HelloWorld servlet

    Hello,
    I'm trying to compile a "Hello World" servlet in Tomcat that I copied straight out of the book. The code is as follows:
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class HelloWorld1 extends HttpServlet {
    public void doGet(HttpServletRequest request, HttpServletResponse response)
    throws IOException, ServletException
    response.setContentType("text/html");
    PrintWriter out = response.getWriter();
    out.println("<html>");
    out.println("<body>");
    out.println("<head>");
    out.println("<title>Hello World!</title>");
    out.println("</head>");
    out.println("<body>");
    out.println("<h1>Hello World!</h1>");
    out.println("</body>");
    out.println("</html>");
    However, neither HttpServlet, HttpServletRequest, HttpServletResponse, or ServletException are being recognized. In each case, the message I'm getting from the compiler is "cannot resolve symbol." I'm finding this whole situation very distressing. If someone could help me out, I'd greatly appreciate it.
    Thanks,
    Adam

    well i have tried out both Servlets and JSPs in Windows 98 and i did not get the problem you have mentioned, i am using Jakarta Tomcat 3.2.1, and i have set the classpath to servlet.jar, actually this file is present within the jakarta-tomcat-3.2.1\lib directory and i suppose the classpath is automatically set as u run the startup.bat file. What you can try is, while setting the TOMCAT_HOME and ANT_HOME in the autoexec.bat, try doing it using the old dos 8.3 file naming style, for eg.
    set JAVA_HOME=C:\jdk1.3
    set TOMCAT_HOME=c:\jakart~1.1
    set ANT_HOME=c:\jakart~1.1
    then try running the example again.

  • Problem getting simple servlet to run in tomcat

    i am trying to get a servlet to run that is explained in wrox Professional JSP second edition. i am using tomcat as the book explains.
    1. i have created the ch03/WEB-INF/classes directory within the webapps folder in tomcat.
    2. in the classes folder i created the directory
    com/wrox/projsp/ch03/myfirstwebapp.
    3. in the folder myfirstwebapp i have the compiled file
    MyFirstServlet.class
    4. i made sure the code is exactly as in the book.
    5. it states that if i go to
    http://localhost:8080/ch03/servlet/com.wrox.projsp.ch03.myfirstwebapp.MyFirstServlet i should get the correct output.
    6. the only way i can get this to work is if i create a web.xml
    file and point it to
    com.wrox.projsp.ch03.myfirstwebapp.MyFirstServlet and then in the
    browser i type in
    http://localhost:8080/ch03/com.wrox.projsp.ch03.myfirstwebapp.MyFirstServlet thus leaving out /servlet in the URL
    7. this seems fine but i would like to get it to work how the book shows which is without having to use the web.xml. am i missing something? do i need to set up anything (eg. a context tag for this app)within the server.xml.
    any help would greatly be appreciated,
    gary bushek

    I don't know how the book you're using instructed you to setup the server but my web.xml simply has the following in it:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
    "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
    <web-app>
    </web-app>
    I'm using tomact 3.2 and am able to run my servlets using
    http://localhost/servlet/package_name.servletName
    you might want to checkout www.coreservlets.com for more help on setting up tomcat.

  • Problems Compiling javax.servlet and javax.servlet.http

    When I try to compile a program that imports both javax.servlet and javax.servlet.http, the compiler keeps telling me that "package javax.servlet does not exist"... I have place the javax.servlet packages in the src.zip and in the src folder but i dont understand why the compiler isnt picking them up. Maybe I did something wrong ... could someone help please

    Try to compile vith the option "-classpath /your/path/to/servlet.jar"

  • Problem With Deploying a very simple Servlet

    HELP REQUIRED:
    Hi,
    I'm including code of a very simple Servlet application (I shd not call it an application):
    index.html
    ==========
    <html><body bgcolor="#FFFFFF">
         <head>
         <title> Rajeev Asthana </title>
    <form action = "/HelloWorldApp/HelloWorld" method = "POST" >
    Please press Submit
    <input type = "submit" value = "Press Me!">
    </form>
    </body></html>
    HelloWorld.java
    ===============
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class HelloWorld extends HttpServlet {
         public void doPost(HttpServletRequest request,
                   HttpServletResponse response)
              throws ServletException, IOException {
              response.setContentType("text/html");
              PrintWriter out = response.getWriter();
              out.println("<html><body bgcolor=\"#FFFFFF\">");
              out.println("<p>Hello World!</p>");
              out.println("</body></html>");
              out.close();
    web.xml
    ========
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app xmlns="http://java.sun.com/xml/ns/j2ee" version="2.4" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
    <display-name>HelloWorldApp</display-name>
    <servlet>
    <display-name>HelloWorld</display-name>
    <servlet-name>HelloWorld</servlet-name>
    <servlet-class>HelloWorld</servlet-class>
    </servlet>
    </web-app>
    sun-web.xml
    ===========
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE sun-web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 8.0 Servlet 2.4//EN" "http://www.sun.com/software/appserver/dtds/sun-web-app_2_4-0.dtd">
    <sun-web-app xmlns="http://java.sun.com/xml/ns/j2ee">
    <context-root>/HelloWorldApp</context-root>
    <session-config>
    <session-manager persistence-type="memory">
    <manager-properties/>
    <store-properties/>
    </session-manager>
    <session-properties/>
    <cookie-properties/>
    </session-config>
    <cache enabled="false" max-entries="4096" timeout-in-seconds="30">
    <default-helper/>
    </cache>
    <class-loader delegate="true"/>
    <jsp-config/>
    </sun-web-app>
    I have deployed it in following directory structure:
    C:\Sun\AppServer\domains\domain1\applications\j2ee-modules\HelloWorldApp\
    |
    |
    |               |               |               |
    |               |               |               |
    META-INF          WEB-INF          HelloWorld.java          index.html
                   |
                   |
              |          |          |          |
              |          |          |          |
         classes          sun-web.xml     web.xml          sun-j2ee-ri-project
         |
         |
         HelloWorld.class
    While generating HelloWorldApp.war (which is the war file for this app), I specifies /HelloWorldApp as context root (sun specific).
    Now, when I deployed it thru Admin Tool and then clicked on "Launch", it displays a page with :
    Please press Submit Press Me!
    But when I click the button "Press Me!", it says:
    "The requested resource (/HelloWorldApp/HelloWorld) is not available."
    What should I do to correct the problem?
    Thanks in advance.
         

    Yes, you need to add a servlet -mapping element and adjust your form to submit to the appropriate URL mapping.
    <servlet-mapping>
    <servlet-name>HelloWorldServlet</servlet-name>
    <url-pattern>/servlet/Hello</url-pattern>
    </servlet-mapping>

  • Having problems compiling *.java with import javax.servlet.jsp......

    I've been trying to do the tutorials in a book titled Apache Jakarta-Tomcat as part of my introduction to JSP. I'm new to Java but do know the basics. I have on my machine Java 1.3, Java 1.4, Java FrameWorks 2.1 and Jython 2.1 on Win2000 Pro. So enough about my configuration. I have never worked with packages also.
    I downloaded the files from the books site due to the fact I make a lot of typos when hand coding Java (I've become a pretty good debugger of my own code). But everytime I go to compile the *.java I get error messages. So below you will find HelloTag.java and beneath that the error messages that are thrown when I try and compile it. I tested other bits of *.java and have had no problem compiling them. Is there a JSP module I'm missing?
    Am I doing something wrong or am I missing something from my configuration.
    Marijan Madunic
    package chapter2;
    import javax.servlet.jsp.JspException;
    import javax.servlet.jsp.JspTagException;
    import javax.servlet.jsp.tagext.TagSupport;
    public class HelloTag extends TagSupport
    public void HelloTag() {
    // Method called when the closing hello tag is encountered
    public int doEndTag() throws JspException {
    try {
    // We use the pageContext to get a Writer
    // We then print the text string Hello
    pageContext.getOut().print("Hello");
    catch (Exception e) {
    throw new JspTagException(e.getMessage());
    // We want to return SKIP_BODY because this Tag does not support
    // a Tag Body
    return SKIP_BODY;
    public void release() {
    // Call the parent's release to release any resources
    // used by the parent tag.
    // This is just good practice for when you start creating
    // hierarchies of tags.
    super.release();
    D:\Java\JDK 1.3\bin>javac HelloTag.java
    HelloTag.java:3: cannot resolve symbol
    symbol : class JspException
    location: package jsp
    import javax.servlet.jsp.JspException;
    ^
    HelloTag.java:4: cannot resolve symbol
    symbol : class JspTagException
    location: package jsp
    import javax.servlet.jsp.JspTagException;
    ^
    HelloTag.java:5: cannot resolve symbol
    symbol : class TagSupport
    location: package tagext
    import javax.servlet.jsp.tagext.TagSupport;
    ^
    HelloTag.java:7: cannot resolve symbol
    symbol : class TagSupport
    location: class chapter2.HelloTag
    public class HelloTag extends TagSupport
    ^
    HelloTag.java:14: cannot resolve symbol
    symbol : class JspException
    location: class chapter2.HelloTag
    public int doEndTag() throws JspException {
    ^
    HelloTag.java:20: cannot resolve symbol
    symbol : variable pageContext
    location: class chapter2.HelloTag
    pageContext.getOut().print("Hello");
    ^
    HelloTag.java:24: cannot resolve symbol
    symbol : class JspTagException
    location: class chapter2.HelloTag
    throw new JspTagException(e.getMessage());
    ^
    HelloTag.java:28: cannot resolve symbol
    symbol : variable SKIP_BODY
    location: class chapter2.HelloTag
    return SKIP_BODY;
    ^
    HelloTag.java:37: cannot resolve symbol
    symbol : variable super
    location: class chapter2.HelloTag
    super.release();
    ^
    9 errors

    Well, it looks like you've not got the servlet development kit JAR on your classpath. I think it'll probably be called servlet.jar on your system. Add that to the classpath if it's not already there.
    Incidentally, you've bumped into one of the areas Java's slightly lenient - declaring a method that looks like a constructor:
    public HelloTag() { }
    public void HelloTag() { }The first is a constructor, the second is a normal method. I'm assuming you intended to have the former instead of the latter.
    Anyway, hope this helps.

  • Create problem when compiling the servlet

    hi,
    i got a problem when i compile a servlet
    when i try to compile the servlet, it shows that it could
    not found the classes like httpservlet, etc.
    means the classes of the servlet
    i am using the j2sdk1.4.1 edition,
    i had include the javax.servlet.*; in the program
    please tell me what can be the problem & especially any solution for that

    the javax.servlet package and it's sub packages (javax.servlet.http, javax.servlet.jsp, javax.servlet.jsp.tagext) are not included with the Standard Edition. These packages are part of the Enterprise Edition. Check out this link for download:
    http://java.sun.com/j2ee/sdk_1.3/

  • Problems to compile a servlet

    Hi, i have a problem to compile a servlet, i will try to explain my problem easily...
    i have a JavaBena class int he directory.....C:\Programmi\Apache Software Foundation\Tomcat 6.0\webapps\ROOT\WEB-INF\classes......and i have compiled it by DOS commands, everyhting has gone well!
    i have a Servlet class in the same directory where it situated the JavaBean. i compile the Servlet as well as i have done with the Javabean, by DOS commans, including the Tomcat servlet api.
    this is the command which i use to compile the servlet.......javac ServletRegistraUtente.java -classpath "C:\Programmi\Apache Software Foundation\Tomcat 6.0\lib\servlet-api.jar".....
    but everything i get this error...
    C:\Programmi\Apache Software Foundation\Tomcat 6.0\webapps\ROOT\WEB-INF\classes>javac ServletRicercaUtente
    .java -classpath "C:\Programmi\Apache Software Foundation\Tomcat 6.0\lib\servlet-api.jar"
    ServletRicercaUtente.java:20: cannot find symbol
    symbol : class BeanRicercaUtente
    location: class ServletRicercaUtente
    ^
    ServletRicercaUtente.java:20: cannot find symbol
    symbol : class BeanRicercaUtente
    location: class ServletRicercaUtente
    BeanRicercaUtente m_BeanRicercaUtente = new BeanRicercaUtente();
    ^
    2 errors
    C:\Programmi\Apache Software Foundation\Tomcat 6.0\webapps\ROOT\WEB-INF\classes>
    these are the 2 classes....
    import javax.servlet.http.*;
    import javax.servlet.*;
    import java.io.*;
    import JavaBean.BeanRicercaUtente;
    public class ServletRicercaUtente extends HttpServlet
         public void doPost(HttpServletRequest request, HttpServletResponse response)
         throws IOException, ServletException
              ServletContext sc;
              RequestDispatcher rd;
              try
                   BeanRicercaUtente m_BeanRicercaUtente = new BeanRicercaUtente();
                   request.setAttribute("m_BeanRicercaUtente", m_BeanRicercaUtente);
                   String codiceFiscale = request.getParameter("codice");
                   m_BeanRicercaUtente.effettuaRicerca(codiceFiscale);
                   sc = getServletContext();
                   rd = sc.getRequestDispatcher("/risposta.jsp");
                   rd.forward(request, response);
              catch(Throwable theException){}
    import java.sql.*;
    public class BeanRicercaUtente
         String nome, cognome, indirizzo, telefono;
         public void effettuaRicerca(String codiceFiscale)
              try
                   Class.forName("com.mysql.jdbc.Driver");
                   String url = "jdbc:mysql://.................";
                   Connection con = DriverManager.getConnection(url);
                   Statement cmd = con.createStatement();
                   String qry = "SELECT ..................";
                   ResultSet res = cmd.executeQuery(qry);
                   while (res.next())
                        cognome = res.getString(1);
                        nome = res.getString(2);
                        indirizzo = res.getString(3);
                        telefono = res.getString(4);
                   res.close();
                   cmd.close();
                   con.close();
              catch (SQLException e)
                   e.printStackTrace();
              catch (ClassNotFoundException e)
                   e.printStackTrace();
    i would be glad to get help about it...! :) thanks!

    i am sorry, but in the first class i have not written "import JavaBean.BeanRicercaUtente;"
    i have only these imports...
    import javax.servlet.http.*;
    import javax.servlet.*;
    import java.io.*;

  • How to install servlet classes in order to compile a simple servlet...

    When trying to compile a simple servlet (java file), I get errors having to do with not finding any object of the javax.servlet class. I am using J2SE v.1.4, and from what I know, it does not have built-in support for Servlets-JSP.
    Do I need to install myself the servlet classes (downloaded from Sun's site) in order for my servlet to be able to compile and work under tomcat? And if so, where should I put them? Or is there something else I have to do?
    Thank you in advance for your assistance!

    If you have Tomcat already, the files you require are in:
    (Tomcat4)
    [TOMCAT_HOME]/common/lib/servlet.jar
    or
    (Tomcat5)
    [TOMCAT_HOME]/common/lib/servlet-api.jar
    [TOMCAT_HOME]/common/lib/jsp-api.jar
    This file needs to be added to your classpath when compiling a servlet.

  • Servlet - unable to compile my simple servlet

    I downdloaded the servlet api, I changed the classpath to point to the directory that I extracted to. However, I still cannot compile a simple servlet. I am sure I did not install the servlet api the right way. Can somebody help?
    Thanks

    This may sound silly, but you did UNZIP the servlet API, right?
    Where did you set the classpath? Through an environment variable? Through a command line?
    Best,
    brumalis

  • I have a problem compiling servlets bymeans of NetBeans IDE 3.6.

    If I compile a servlet by means of another IDE, they are oK and work well with NetBeans too.
    On the contrary, if I compile it bymeans of Netbeans 3.6, I get a .class which does not work. I
    have realized also that for instance if the .class i get with the other IDE is 1,58 KB, if I use
    NetBeans I get a .class smaller, that is 1,53 Kb.
    Can you help me?
    Thanks
    Eugenia Mariani

    ok
    This is the servlet named Contatore.java
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class Contatore extends HttpServlet
    private int conta;
    public void init(ServletConfig config) throws ServletException
    conta = 0;
    public void doGet(HttpServletRequest richiesta, HttpServletResponse risposta)
    throws IOException, ServletException
    conta++;
    risposta.setContentType("text/html");
    PrintWriter out = risposta.getWriter();
    out.println("<html>");
    out.println("<head>");
    out.println("<title>Pagina con contatore</title>");
    out.println("</head>");
    out.println("<body>");
    out.println("Questa pagina e' stata visualizzata");
    out.println("<h1>"+conta+ "</h1> volte.");
    out.println("</body>");
    out.println("</html>");
    out.close();
    Before using the compiler of NetBeans (that is after getting Contatore.class by means of Bluej) when I use Execute I see in Internet Explorer 6.0 with win Xp Pro at the
    http://localhost:8084/esempi/Contatore
    Questa pagina e' stata visualizzata
    1
    volte.
    and Contatore.class is 1,58 KB
    After that I use the compiler of NetBeans when I use Execute here the error from Tomcat 5.0
    I see in Internet Explorer 6.0 with win Xp Pro at the
    http://localhost:8084/esempi/Contatore
    HTTP Status 404 - Servlet Contatore is not available
    type Status report
    message Servlet Contatore is not available
    description The requested resource (Servlet Contatore is not available) is not available.
    Apache Tomcat/5.0.19
    and Contatore.class is 1,53 KB
    I hope to have said everything
    I wait a help, please.
    Thanks

  • Trouble compiling a Servlet using the JSWDK-1.0.1

    I have an old Win95 box on which I had a JDK 1.2 install and I then installed the JSWDK-1.0.1. I have the servlet.jar and jspengine.jar files in the "\lib" directory and have added them to my classpath.
    I created a simple servlet but it does not read any classes from the JSWDK .jar files and throws an error saying class HTTPServlet not found. The first few lines of my servlet look like:
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class TestServlet extends HTTPServlet
    Any idea why the "javac" compiler cant see the class from the proper jar file? I am using JBuilder as my source code editor and it too shows all the servlet related class/package names in red (i.e. doesnt recognize them).
    Regular java apps compile and run fine on this machine.

    Hi,
    It should be definitely a CLASSPATH problem. You can double check the CLASSPATH in command prompt like this
    echo %CLASSPATH%
    If the CLASSPATH is set properly, you should see something like this
    c:\jdk1.2\lib\tools.jar;c:\jswdk-1.0.1\lib\servlet.jar
    Hope this helps.
    Best Luck!
    Senthil Babu J

  • PLEASE HELP:not able to load a simple servlet

    Hi,
    I'm new to weblogic server.I'm trying to setup weblogic 510.Everything was
    going fine until I got stuck to this small thing.I'm not able to load a
    simple servlet!.
    I would appreciate any pointers regarding this.Please Help me!!!
    Here is what I tried:
    I have installed weblogic510 plug-in for IIS.I could successfully run jsp
    files.However I am not able to load simple servlets;It gave an exception
    "java.lang.IllegalAccessError: try to access class
    weblogic/utils/classloaders/FileSource from class
    weblogic/servlet/internal/WarClassFinder"
    Details of my configuration:
    WebServer - IIS 4.0
    IIS port=80
    Weblogic port=7001
    I had set it in such a way that all the requests first go to IIS and then
    IIS redirects them to Weblogic.I've followed the steps according to the
    document "Installing the Weblogic ISAPI Plug-in".
    I've registered the servlet in weblogic.properties as following:
    weblogic.httpd.register.hello=examples.servlets.HelloWorld2
    I tested the servlet by URL http://localhost:7001/hello
    Following is the eact text for the exception I got in the WeblogicServer
    window:
    Mon Jul 24 12:13:13 PDT 2000:<E> <ServletContext-General> Error loading
    servlet:
    examples.servlets.HelloWorld2
    java.lang.IllegalAccessError: try to access class
    weblogic/utils/classloaders/Fi
    leSource from class weblogic/servlet/internal/WarClassFinder
    at
    weblogic.servlet.internal.WarClassFinder.getSource(WarClassFinder.jav
    a, Compiled Code)
    at
    weblogic.servlet.internal.WarClassFinder.getClassSource(WarClassFinde
    r.java:110)
    at
    weblogic.utils.classloaders.GenericClassLoader.findLocalClass(Generic
    ClassLoader.java:381)
    at
    weblogic.utils.classloaders.GenericClassLoader.reallyLoadClass(Generi
    cClassLoader.java, Compiled Code)
    at
    weblogic.utils.classloaders.RecursiveReloadOnModifyClassLoader$Slave.
    loadClass(RecursiveReloadOnModifyClassLoader.java:234)
    at
    weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClass
    Loader.java:146)
    at
    weblogic.utils.classloaders.RecursiveReloadOnModifyClassLoader.findLo
    calClass(RecursiveReloadOnModifyClassLoader.java:109)
    at
    weblogic.utils.classloaders.GenericClassLoader.reallyLoadClass(Generi
    cClassLoader.java, Compiled Code)
    at
    weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClass
    Loader.java:172)
    at
    weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClass
    Loader.java:146)
    at
    weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubI
    mpl.java:291)
    at
    weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.
    java:164)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
    pl.java:99)
    at
    weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletCon
    textImpl.java:742)
    at
    weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletCon
    textImpl.java:686)
    at
    weblogic.servlet.internal.ServletContextManager.invokeServlet(Servlet
    ContextManager.java:247)
    at
    weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.jav
    a:361)
    at
    weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:261)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled
    Code)
    Mon Jul 24 12:13:13 PDT 2000:<E> <ServletContext-General> Servlet failed
    with Ex
    ception
    I dont think there were any problems in the classpath or
    servletpath;Basically WeblogicServer was able to locate the servlet but when
    it tried to load the servlet it gave this exception.
    I would appreciate any ideas/suggestions.
    Thanks,
    Sravan

    Nice to hear it works!
    However, one mistake you have in the configuration you provided:
    You put D:\weblogic\BDL\servletclasses in both CLASSPATH and
    weblogic.class.path, remove it from CLASSPATH.
    Cheers - Wei
    Sravan Thella <[email protected]> wrote in message
    news:[email protected]...
    Hi Michael and Wei,
    Thank you very much for the response.
    My servlet details:
    Name - HelloWorld2.class
    package - examples.servlets
    Location - d:\weblogic\BDL\servletclasses ---- here BDL is my new folder
    where I want to keep my servlets
    My CLASSPATH(environment) settings:
    D:\weblogic\BDL\servletclasses;d:\weblogic\classes\boot;d:\weblogic\eval\clo
    >
    udscape\lib\cloudscape.jar;d:\weblogic\lib\poolorb.jar;D:\java\jre\lib\rt.ja
    r;
    my weblogic classpath settings(set it thru wlconfig)
    D:\weblogic\BDL\servletclasses;d:\weblogic\classes\boot;d:\weblogic\eval\clo
    >
    udscape\lib\cloudscape.jar;d:\weblogic\lib\poolorb.jar;D:\java\jre\lib\rt.ja
    r;
    My weblogic.policy:
    grant codeBase "file:d:/weblogic/-" {
    permission java.io.FilePermission "d:${/}weblogic${/}-",
    "read,write,delete,execute";
    permission java.net.SocketPermission "localhost:1-9000",
    "connect,accept,listen,resolve";
    permission java.awt.AWTPermission "accessClipboard";
    permission java.awt.AWTPermission "accessEventQueue";
    permission java.awt.AWTPermission "showWindowWithoutWarningBanner";
    permission java.io.SerializablePermission"enableSubclassImplementation";
    permission java.io.SerializablePermission "enableSubstitution";
    permission java.lang.RuntimePermission "accessClassInPackage.*";
    permission java.lang.RuntimePermission "accessDeclaredMembers.*";
    permission java.lang.RuntimePermission "createClassLoader";
    permission java.lang.RuntimePermission "createSecurityManager";
    permission java.lang.RuntimePermission "defineClassInPackage.*";
    permission java.lang.RuntimePermission "exitVM";
    permission java.lang.RuntimePermission "getClassLoader";
    permission java.lang.RuntimePermission "createClassLoader";
    permission java.lang.RuntimePermission "getProtectionDomain";
    permission java.lang.RuntimePermission "loadLibrary.*";
    permission java.lang.RuntimePermission "modifyThread";
    permission java.lang.RuntimePermission "modifyThreadGroup";
    permission java.lang.RuntimePermission "readFileDescriptor";
    permission java.lang.RuntimePermission "setContextClassLoader";
    permission java.lang.RuntimePermission "setFactory";
    permission java.lang.RuntimePermission "setIO";
    permission java.lang.RuntimePermission "setProtectionDomain";
    permission java.lang.RuntimePermission "setSecurityManager";
    permission java.lang.RuntimePermission "writeFileDescriptor";
    permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
    permission java.net.NetPermission "requestPasswordAuthentication";
    permission java.net.NetPermission "setDefaultAuthenticator";
    permission java.security.SecurityPermission "getPolicy";
    permission java.security.SecurityPermission "setPolicy";
    permission java.util.PropertyPermission "*", "read,write";
    grant codeBase "file:d:/weblogic/BDL/servletclasses/-" {
    permission java.io.FilePermission
    "d:${/}weblogic${/}BDL{/}servletclasses{/}-", "read,write,delete,execute";
    permission java.net.SocketPermission "localhost:1-9000",
    "connect,accept,listen,resolve";
    permission java.awt.AWTPermission "accessClipboard";
    permission java.awt.AWTPermission "accessEventQueue";
    permission java.awt.AWTPermission "showWindowWithoutWarningBanner";
    permission java.io.SerializablePermission"enableSubclassImplementation";
    permission java.io.SerializablePermission "enableSubstitution";
    permission java.lang.RuntimePermission "accessClassInPackage.*";
    permission java.lang.RuntimePermission "accessDeclaredMembers.*";
    permission java.lang.RuntimePermission "createClassLoader";
    permission java.lang.RuntimePermission "createSecurityManager";
    permission java.lang.RuntimePermission "defineClassInPackage.*";
    permission java.lang.RuntimePermission "exitVM";
    permission java.lang.RuntimePermission "getClassLoader";
    permission java.lang.RuntimePermission "createClassLoader";
    permission java.lang.RuntimePermission "getProtectionDomain";
    permission java.lang.RuntimePermission "loadLibrary.*";
    permission java.lang.RuntimePermission "modifyThread";
    permission java.lang.RuntimePermission "modifyThreadGroup";
    permission java.lang.RuntimePermission "readFileDescriptor";
    permission java.lang.RuntimePermission "setContextClassLoader";
    permission java.lang.RuntimePermission "setFactory";
    permission java.lang.RuntimePermission "setIO";
    permission java.lang.RuntimePermission "setProtectionDomain";
    permission java.lang.RuntimePermission "setSecurityManager";
    permission java.lang.RuntimePermission "writeFileDescriptor";
    permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
    permission java.net.NetPermission "requestPasswordAuthentication";
    permission java.net.NetPermission "setDefaultAuthenticator";
    permission java.security.SecurityPermission "getPolicy";
    permission java.security.SecurityPermission "setPolicy";
    permission java.util.PropertyPermission "*", "read,write";
    I dont know what is wrong here. In the weblogic.policy file,I tried
    differrent combinations but it never worked.
    I find weblogic documentation for troubleshooting to be pathetic.Notuseful
    at all.Documentation looks
    good to read ;not for practical purposes.I'm not sure whether others have
    similar opinion.
    I'm stuck at this thing for the past few days,I still have lot of work todo
    to purusue our management team to buy weblogic
    but I'm still stuck at this thing.
    Thank you very much for your time.
    Thanks,
    Sravan
    "Sravan Thella" <[email protected]> wrote in message
    news:[email protected]...
    Hi,
    I'm new to weblogic server.I'm trying to setup weblogic 510.Everything
    was
    going fine until I got stuck to this small thing.I'm not able to load a
    simple servlet!.
    I would appreciate any pointers regarding this.Please Help me!!!
    Here is what I tried:
    I have installed weblogic510 plug-in for IIS.I could successfully runjsp
    files.However I am not able to load simple servlets;It gave an exception
    "java.lang.IllegalAccessError: try to access class
    weblogic/utils/classloaders/FileSource from class
    weblogic/servlet/internal/WarClassFinder"
    Details of my configuration:
    WebServer - IIS 4.0
    IIS port=80
    Weblogic port=7001
    I had set it in such a way that all the requests first go to IIS andthen
    IIS redirects them to Weblogic.I've followed the steps according to the
    document "Installing the Weblogic ISAPI Plug-in".
    I've registered the servlet in weblogic.properties as following:
    weblogic.httpd.register.hello=examples.servlets.HelloWorld2
    I tested the servlet by URL http://localhost:7001/hello
    Following is the eact text for the exception I got in the WeblogicServer
    window:
    Mon Jul 24 12:13:13 PDT 2000:<E> <ServletContext-General> Error loading
    servlet:
    examples.servlets.HelloWorld2
    java.lang.IllegalAccessError: try to access class
    weblogic/utils/classloaders/Fi
    leSource from class weblogic/servlet/internal/WarClassFinder
    at
    weblogic.servlet.internal.WarClassFinder.getSource(WarClassFinder.jav
    a, Compiled Code)
    at
    weblogic.servlet.internal.WarClassFinder.getClassSource(WarClassFinde
    r.java:110)
    at
    weblogic.utils.classloaders.GenericClassLoader.findLocalClass(Generic
    ClassLoader.java:381)
    at
    weblogic.utils.classloaders.GenericClassLoader.reallyLoadClass(Generi
    cClassLoader.java, Compiled Code)
    at
    weblogic.utils.classloaders.RecursiveReloadOnModifyClassLoader$Slave.
    loadClass(RecursiveReloadOnModifyClassLoader.java:234)
    at
    weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClass
    Loader.java:146)
    at
    weblogic.utils.classloaders.RecursiveReloadOnModifyClassLoader.findLo
    calClass(RecursiveReloadOnModifyClassLoader.java:109)
    at
    weblogic.utils.classloaders.GenericClassLoader.reallyLoadClass(Generi
    cClassLoader.java, Compiled Code)
    at
    weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClass
    Loader.java:172)
    at
    weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClass
    Loader.java:146)
    at
    weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubI
    mpl.java:291)
    at
    weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.
    java:164)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
    pl.java:99)
    at
    weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletCon
    textImpl.java:742)
    at
    weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletCon
    textImpl.java:686)
    at
    weblogic.servlet.internal.ServletContextManager.invokeServlet(Servlet
    ContextManager.java:247)
    at
    weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.jav
    a:361)
    at
    weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:261)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java,Compiled
    Code)
    Mon Jul 24 12:13:13 PDT 2000:<E> <ServletContext-General> Servlet failed
    with Ex
    ception
    I dont think there were any problems in the classpath or
    servletpath;Basically WeblogicServer was able to locate the servlet butwhen
    it tried to load the servlet it gave this exception.
    I would appreciate any ideas/suggestions.
    Thanks,
    Sravan

Maybe you are looking for

  • Can't publish an OAM anymore

    Hi there, when I want to publish an OAM I always get this message: "an error occurred. Please save your work and restart Edge Animate." I  tried simple animations in a fresh project just with text, to sort out problems with footage. The publishing ac

  • Set AD varaible through workflow Activity

    So I was able to successfully unlock AD accounts using the below activity <Activity id='3' name='UnlockAD'>         <Comments>           On Success do a global unlock .         </Comments>         <Action id='0' application='com.waveset.session.Workf

  • Can I still get my old itunes acount with out sycing to my computer

    HHow can I get my old iTunes music and account on my iPad. Because computer is down, and I can't syc my new iPad to it

  • My network goes off and does not come back unless I switch off and switch on

    I have a vodafone connection. Whenever I go underground while traveling in train, my network goes off and but does not come back unless I switch off and switch on the phone... any suggestions???

  • SLT through BODS

    Hi All, Can we do SLT from ECC to HANA through BODS? All help is appreciated. Thanks Sam