Where to put .class file of a servlet to run it on Tomcat 4.0

where do i put my .class file of my servlet or maybe the .java one too in order to run it using Tomcat 4.0
thanks in advance

i got it by accident a while ago.. hehe
thank you for trying to help thou :)
ivo

Similar Messages

  • Where to put class files

    hi,
    i use Tomcat v4.0.5, my jsp files import some classes. i put these classes to /classes folder under /jakarta-tomcat-4.0.5 base directory. but when i make some changes to these classes, i have to restart the Tomcat. i think there must be some other folders to put these class files and there wont be need any more to restart Tomcat.

    Hi
    It is necessary to restart your Tomcat if you are modifying class files, because tomcat will build a cache for the previously compiled classes and objects. As you are under development this is of no harm.
    And one more thing place any classes in the WEB-INF/classes directory of your tomcat application.
    Thanks
    Swaraj

  • Problem creating package structure and where is my .class file??????

    Working on Tomcat I have my folder structure like this...
    webapps
    ->app_root
    ->WEB-INF
    ->classes
    ->src
    -> .java files
    ->META_INF
    In the command prompt i compile using this
    c:\Program Files\Apache Tomcat 4.0\webapps\Murthy\WEB-INF\classes>javac -d src\*.java
    and in my java files I have the package structure mentioned as
    package com.acme;
    after compiling i expected this to happen for me.
    webapps
    ->app_root
    ->WEB-INF
    ->classes (in WEB-INF)
    ->com (in classes)
    ->acme (in com)
    -> .class files (in acme)
    ->src (in WEB-INF)
    -> .java files(In src)
    ->META_INF
    The funiest part for me started he when i compiled the file
    c:\Program Files\Apache Tomcat 4.0\webapps\Murthy\WEB-INF\classes>javac -d src\one.java
    It compiled successfully without giving me any error but no package structure was created and THERE IS NO one.class file anywhere in my system.....Then how did it compile my file and where is the .class file.
    I think am worng somewhere but unable to locate it.
    Can somebody pull me out of thiss stuf??? Need to do it fast.
    Thanx.

    c:\Program Files\Apache Tomcat 4.0\webapps\Murthy\WEB-INF\classes>javac -d src\*.java
    The command you posted does not have a source file specification. You are telling the compiler to put the .class files in src\*.java but you are not specifying any .java files. It looks like your command should be javac -d . src\*.java

  • How do I get Firefox to ask me where to put a file I wish to download

    When I download a file, Firefox puts it somewhere. I want to be able to tell it where to put that file each and every time.

    Options > General - Downloads = '''Always ask me where to save files'''

  • Where to put inf File so Servlets can read it?

    Hi
    I have a .inf file that contains the location of a database and of my smtp server. I have some servlets that make calls to java classes that read this file in order to access a DB and send emails etc. Where should i put this file so that when i come to run my project on apache the servlets and java classes can see and use the inf file? Do i need to put it in the WEB-INF directory etc? Do i need to add anything to the Web.xml file etc?
    Thanks
    David

    Thanks, ive set it up so it now uses a properties file which is placed in the same package as the class file on apache. But in order to read the file i need to put an absolute path in e.g.
    Properties props = new Properties();
    props.load(new FileInputStream("C:/apache-tomcat-6.0.10/webapps/ROOT/WEB-INF/classes/coreservlets/message.properties"));
    however i want to use a relative path, somethin like:
    props.load(new FileInputStream("/message.properties"));
    but this does not seem to work, do i need to define a realtive path using different syntax or do i need to place the properties file in a different place or change some configuration settings in apache?
    Thanks
    David

  • Using normal class file in the servlet

    Hello Friends;
    Now my problem is ;
    I generated a java file ;
    import drasys.or.mp.*;
    import drasys.or.mp.lp.*;
    public class optimize
        public static void main(String[] args)
        try
            int r=1;
            int s=0;
    .This file works perfect. It calls an API and there is no problem. But when I take this code into my servlet, then problem starts. First it says;
    "java.lang.NoClassDefFoundError: drasys/or/mp/ScaleException"
    but I know it is there. And I mounted the jar file.
    Do you think there is a problem with my codes, because it works when it is outside of the servlet.
    My servlet code is as follows;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import java.sql.*;
    import java.util.*;
    import java.net.*;
    import drasys.or.mp.*;
    import drasys.or.mp.lp.*;
    protected void processRequest(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
            response.setContentType("text/html");
            PrintWriter out = response.getWriter();
             try
            int r=1;
            int s=0;
            int n = 3;
            int t,w,u,v,f;
            f = 1;
            int z=0;
            int y = 1;
            int l = 1;
            double [][][][] C = new double [1][1][n-1][n];
            double [][][][] D = new double [1][1][n-1][n];
            C[0][0][0][1]=2.5-0.92*r;
            C[0][0][0][2]=1.43-0.37*r;
            C[0][0][1][2]=1.14-0.48*r;
            D[0][0][0][1]=0.65*r+0.94;
            D[0][0][0][2]=0.31*r+0.75;
            D[0][0][1][2]=0.27*r+0.40;
         SizableProblemI prob = new Problem(n*(n-1)+1,n);
            prob.getMetadata().put("lp.isMaximize", "true");
            prob.newVariable("Lambda").setObjectiveCoefficient(1.0);
            for (t=0;t<=(n-1);t++)
                prob.newVariable("W"+t).setObjectiveCoefficient(0);
            final byte LTE = Constraint.LESS;
            final byte EQU = Constraint.EQUAL;
            for (v = 1;v <= n*(n-1);v++)
                   prob.newConstraint("constr"+v).setType(LTE).setRightHandSide(y);
                prob.newConstraint("constr"+(n*(n-1)+1)).setType(EQU).setRightHandSide(1);
                // here, we are creating coefficients for lambda.
            for (u = 1; u <= n*(n-1); u++)
                    prob.setCoefficientAt("constr"+u,"Lambda",y);
    // here, we are creating coefficients for W�s.
            for(t = 0 ; t <= (n-2); t++)
                for (w = 1; w <= (n-1); w++)
                     if (t<w)
                         prob.setCoefficientAt("constr"+l, "W"+t, 1);
                         prob.setCoefficientAt("constr"+l,"W"+w, (-C[s][z][t][w]));
                         l = l + 1;
                         prob.setCoefficientAt("constr"+l, "W"+t, -1.0);
                         prob.setCoefficientAt("constr"+l, "W"+w, D[s][z][t][w]);
                         l = l + 1;
    /* here , we are creating coefficients for the last formula which is w1+w2+w3+....Wn = 1 */
                for (f=0; f <= (n-1); f++)
                prob.setCoefficientAt("constr"+(n*(n-1)+1), "W"+f, 1);
    /* API finds the solution below.*/
         LinearProgrammingI lp = new DenseSimplex(prob);
            double ans = lp.solve();
            System.out.println("Solution"+r+"="+ans);
            System.out.println(lp.getSolution());
            catch (drasys.or.mp.DuplicateException first)
             first.getMessage();
            catch (drasys.or.mp.NotFoundException second)
            catch (drasys.or.mp.InvalidException third)
            catch (drasys.or.mp.NoSolutionException fourth)
            catch (drasys.or.mp.UnboundedException fifth)
            catch (drasys.or.mp.InfeasibleException sixth)
            catch (drasys.or.mp.ConvergenceException seventh)
            catch (drasys.or.mp.ScaleException eigth)
               eigth.toString();
       

    Thanks a lot for the reply.
    Forgive me, I have no object oriented background,
    even programming. I am just in the learning phase.This is a pretty advanced problem to tackle for your first programming task.
    That's why it doesn't follow OO concepts. This part
    will be connected to user input part, that I've
    completed .Hmmm.
    Successful programming depends on one idea: "divide and conquer". You take a big problem and solve it by dividing it into smaller chunks that you CAN handle. You get the solution you want by bringing the smaller chunks together.
    In your case I'd recommend that you get the optimization code into a single object that you can test off-line, without Tomcat. It looks like you started to do that with your optimize class, but the mistake you made is to put so much code into the main() method. You can only call that on the command line. Better to encapsulate the rest of it into small methods that will let you instantiate an instance of optimize and call its methods. Once you have that working you can wrap it in a servlet if you want to use it in a Web app.
    Separate how your optimizer gets its data from how it processes it. On a desktop app, it might be convenient to read input from a file on disk. A Web app might be better served by an XML stream.
    Why I said "I know it is there" because it doesn't
    give any other error message than that one, if it
    couldn't see the jar file, wouldn't it give me lots
    of error messages? Don't assume anything. It only needs one error, which is the one you get when it can't find a class. How many more do you need? The class loader couldn't find that class, so it printed the message and stopped.
    "I mounted" the jar file means I'm using Netbeans, I
    mounted it to that environment as suggested by
    Netbeans, If you don't know Java or programming well, I'm guessing that you also don't know NetBeans. I'd recommend that you figure out how to make all this work without NetBeans before you add another complication to your life.
    If you don't use NetBeans, all you have to do is add the JAR to your CLASSPATH using the -classpath option on javac.exe when you compile and java.exe when you execute.
    Tomcat assumes that all the JAR files in your Web app's WEB-INF/lib are in the CLASSPATH. If you put it in there, Tomcat will find it.
    you're right, I'm using Tomcat 5.0,
    everything is working fine, user input servlets,
    mysql connection etc. Only this part is causing the
    problem now.If you've already got a Web app deployed and connected to MySQL, you're not doing too badly. Kudos to you - that's not too bad for someone who claims to be a programming novice.
    I'll put that jar file into lib folder as you suggested thanks.I think that might be all you'll need. Try it and see.
    Actually I saw an example it was using "throws
    exception" , I couldn't figure out where to put it,
    and I decided to get rid of the compiling errors just
    putting bunch of catch statements.If you're saying that your code is throwing a lot of checked exceptions, and you added these extra catch blocks to get rid of them, another way to do it would be to simply have a single catch block, like this:
    try
        // your code in here
    catch (Exception e)
        e.printStackTrace();
    }Polymorphism says that this catch block will handle all checked exceptions.
    >
    Looks like I don't know anything but I'm trying to
    handle a big thing :))).Indeed you are. Anyone who can write a Web app and connect it to a relational database on their first try is hardly helpless. We're all ignorant, just about different things. Keep digging - you'll make this work.
    But thank you soooo much for your detailed answer, and happy new year.
    Shamil.And the same to you, Shamil. Good luck, and let me know how you make out.
    %

  • Where to put jar files reachable for ejb:s?

    Hello!
    I have a ejb that use some jar files.
    But I can not figure out where to put the jar files that I use from my ejb in Weblogic 8.1.3.
    Until now I have extracted all jar files and put them inside my ejb with my own class files. But this seems odd.
    So please help me out here.
    Best regrads
    Fredrik

    Dear,
    You might have downloaded either tar.gz or zip file. when you extract this file you will find a jar file and also some demos nad docs(api+help). place the poifs api jar file in 'WEB-INF\lib" folder and restart the server.
    In general any api jar files for web applications should be placed in WEB-INF\lib folder then only they are accesible. If you extracted the jar, then place entire package structure in WEB-INF\classes directory
    Regards,
    Nishant Kulkarni
    Software Engineer
    Bangalore
    [email protected]

  • Where to put property files used by XSLT extensions?

    Still fighting with Java XSLT extensions. I have narrowed the
    problem down: my XSLT extension cannot find its property file,
    which I use to store JDBC connect strings etc.
    What is the proper directory to put this file so the XSLT
    extension class can find it? I am using Oracle HTTP Server with
    XDK 9.0.

    Thanks for the answer, Steve!
    Depends on what call you're using in your extension function to
    read your properties.Maybe I tried a too simplistic approach. I'm just using this:
    Properties props = new Properties();
    try {
    props.load(new FileInputStream("/foo.properties"));
    etc.
    This (with the slash) works if the properties file is in the root
    directory of the filesystem, but it's a kludge.
    If you read your properties as a resource using
    getResourceAsStream(), then where the classloader expects to
    find your file depends on the resource name that you specify.So maybe I should use getResourceAsStream() then? What if I put
    the properties file inside the JAR with the extension classes?
    Or is there any way to reference the web root?
    --Jere

  • Where to put .txt file with SimpleInput

    Hello everyone,
    I'm rather new to Java and have a slight problem. The thing is that I need to write an app that can read a text file in this format:
    2
    Orc
    name = Gnorck
    experience = 20
    maxHealthPoints = 50
    healthPoints = 30
    maxBerserk = 9
    berserk = 7
    Human
    name = Aragorn
    experience = 45
    maxHealthPoints = 40
    healthPoints = 30
    maxGreed = 20
    greed = 10
    The first number is de number of characters in the file and after that every character is described in 7 lines.
    Now the application has to be able to read the file. I've choosen to first just make a list of characters. A friend helped me with this code but I'm not completely sure if I know how it works. The code:
    package RPGApplicatie;
    import java.util.*;
    public class Karakters {
         //Constructor
         public Karakters(int size){
              karakters = new ArrayList(size);
         //Methode voor het toevoegen van een karakter
         public void voegToe(Karakter k){
              karakters.add(k);
         public static Karakters readFile(String filename) throws ClassNotFoundException, RuntimeException, InstantiationException, IllegalAccessException{
              SimpleInput file = new SimpleInput(filename);
              int size = file.nextInt();
              Karakters result = new Karakters(size);
              for(int i = 0; i < size ; i++) {
                   Class c = Class.forName(file.nextLine());
                   result.voegToe((Karakter)c.newInstance());
              return result;
         //Variabelen aanmaken
         private ArrayList<Karakter> karakters;
    }First question: I have the classes Karakter (which is the superclass for class Human and Orc), Human and Orc. So does the method forName scan for strings that are also classes? Like so it scans the file and when it comes across a line that says either 'Orc' or 'Human' it adds it to the list?
    Second question: Where to put the text file that holds the data? I now have it in the same folder called test.txt. I use this code to run it:
    package RPGApplicatie;
    public class RPGApplicatie {
         public static void main(String[] args) throws ClassNotFoundException, RuntimeException, InstantiationException, IllegalAccessException {
              Karakters.readFile("test.txt");
    }Thanks in advance! If more info is needed I can post that.
    Regards,
    Sander

    I assume you have defined your Human and Orc classes to include fields name, experience, etc and a constructor that takes these values as parameters?
    You can remove the Class.forName() method altogether. Example:
    int count = file.readInt();
    // define variables for Karakter values (name, experience etc.)
    for (int i = 0; i < count; i++)
      String characterClass = file.readLine();
      // read common character components
      if (characterClass.equals("Human")
        // read human specific components
        karakters.add(new Human(...));
      if (characterClass.equals("Orc")
        // create Orc
    //...Cheers

  • Where to put props file

    Hello,
              when using a WAR application to deploy a servlet, which uses a
              ResourceBundle to read a properties file, where should the properties file
              be put in the .war directory structure.....I put it in WEB-INF/lib, but that
              does not work....
              regards,
              Farhat
              

    I have a similar question - I'm not using Resource Bundles, but I want to be
              able to set some properties, from my program/servlet/jsp. If I include it in
              the WAR file, I can't set them. Where is a recommended spot for properties
              files to live?
              -Ketan
              Charlie Crook <[email protected]> wrote in message
              news:3a702ec4$[email protected]..
              > The properties file has to be available to the jvm - hence in the
              classpath.
              > But if the properties file is only as an .ini replacment by that
              particular
              > servlet, why not just move all the information from the properties into
              some
              > init parms for the servlet - in web.xml?
              >
              > "Muhammad Farhat Kaleem" <[email protected]> wrote in message
              > news:3a6fe9d7$[email protected]..
              > > Hello,
              > > when using a WAR application to deploy a servlet, which uses a
              > > ResourceBundle to read a properties file, where should the properties
              file
              > > be put in the .war directory structure.....I put it in WEB-INF/lib, but
              > that
              > > does not work....
              > >
              > > regards,
              > > --
              > > Farhat
              > >
              > >
              > >
              > >
              >
              >
              

  • Where to put javascript files.

    I am working in Apex 4.0.
    I have found javascript code titled accounting.js. It is available at http://josscrowcroft.github.com/accounting.js/
    The instruction on use of the code are as follows:
    "Download the script and put it somewhere, then do this:
    <script src="path/to/accounting.js"></script>
    <script type="text/javascript">
         // You can do this now:
         accounting.formatMoney(5318008);
    </script>"
    The accounting.js file is over 30,000 characters. Where do I put it so that I can reference it from any page in my application?
    Then what do I need to do on a page where I want to use it?

    You have two options. Both involve modifying your page template to include the file, but you have options on where to place the file.
    1) Place it in the images folder in your application server, and refer to it using the IMAGE_PREFIX substitution string
    <script src="#IMAGE_PREFIX#accounting.js" type="text/javascript"></script>2) Upload it into your Apex repository as a workspace file (Shared Components -> Static Files) and access it from the database.
    <script src="#WORKSPACE_IMAGES#accounting.js" type="text/javascript"></script>Scott

  • 8.1.7 LoadJava. Where do the class files get Stored

    I am using an 8.1.7 Database. I have class files in my database that were loaded using loadjava. I want to extract these class files to do a binary comparison. Does anyone know where a users schema the actual class files are stored. In 9i i believe that they are stored in CREATE$JAVA$LOB$TABLE but they aren't stored there in my 8.1.7 database. Where should i be looking in an 8.1.7 database???
    Cheers
    Paul

    found a solution. In case it is of interest to anyone, using enterprise manager from a 9i client, connected to my 8.1.7 database, and under, schema--> user-->source types--> java classes. for each class, select the class and there is an option to export the class on the RHS. Selecting this, can export class files to hard drive.

  • Where do these class files go?

    I downloaded a library of code that I'd like to use in my program. It came packaged as some .java files and some .class files. Many of the .class files don't have corresponding .java files. I assume this is because they did not want us to see the source code. Can I still use these class files? I put them in the bin folder of my project (I'm using eclipse) but the code still can't recognize the objects from that class.
    I found this: http://stackoverflow.com/questions/661110/how-do-i-include-class-files-in-my-project-in-eclipse-java
    and I think I did correctly what they said to do. I moved the files to a new folder called lib, and then added lib to the buildpath as a class folder, but Eclipse can't find it.
    Edited by: JFactor2004 on May 19, 2010 11:06 AM

    Need to be under the folder in the package (i.e. com.org.blah....)
    You can also decompile any class file to see what are in there
    use JAD ecplise plug-in or JD (for java >5)

  • Where to put Jar file?

    Hello,
    We are running the J2EE installation of ColdFusion, and I'm
    wanting to find out, is there a place on the server where I can add
    replace Jar files without restarting the JRun service?
    Thanks.

    lok2005 wrote:
    > Hello,
    >
    > We are running the J2EE installation of ColdFusion, and
    I'm wanting to find
    > out, is there a place on the server where I can add
    replace Jar files without
    > restarting the JRun service?
    >
    > Thanks.
    >
    Yep, depending on your installation type (stand-alone or
    multi-instance)
    you can put jar files in the lib directory of the JRun server
    and
    they'll get picked up without a restart. In the
    multi-instance
    installation this directory is {JRunRoot}\servers\lib, so on
    a typical
    Windows box this would be C:\JRun4\servers\lib. For a
    standalone
    installation it would be C:\CFusionMX7\lib
    Hope that helps,
    Matt
    Matt Woodward
    [email protected]
    Adobe Community Expert - ColdFusion

  • Where to put the file?

    Hi, I have been trying to sort my 'import' problem and no luck so far, so I'm going to try a different approach.
    Right I have this in my code.
    import EasyIn.*;
    Where should the 'EasyIn' file be place relative to this class that has the import function in?
    At the moment in time Have the class 'EasyIn' in the same folder as this class but it is not seaming to work.
    Thanks for any help.

    Thanks this has worked, this is so strange because i have had to use the import function when I was using the University computers, must because of the way the hdd are arranged (servers etc)
    Thanks alot

Maybe you are looking for

  • T500 BIOS disables USB booting (BUG)

    I am reporting this here as a coutesey to the rest of the T500 users. I boot from a lot of different USB media.  I have about 6 different OS/s that I regularly boot from.  I use them day-to-day for my development work.   I have been using my T500 for

  • Item category means

    Hello Experts. Please explain me what exactly mean by item category.why it is needed and what are the types of it and what would be the impact of it. Please explain me in a layman language with example. I seen this statement in sd book by glenn willi

  • Getting a message that i cant open pdf in browser

    Suddenly i cant open any pdf files that appear in web browser.  I get a message saying "Before proceeding you must first launch Adobe Acrobat and accept the End User License Agreement".  this never happened before and is only happening now after purc

  • What do I get with Adobe CC photography

    I have a paid for monthly Adobe CC photography package that includes Photoshop & LR.   Is there any other Adobe software included in this?  If so, how do I download?

  • Missing presets for mpeg-2

    I am so embarressed but I have totally forgotten how to access the mpeg-2 dvd Export Setting. I go to File>Export>Export Media Encoder>Export Settings... then what? In the Export Setting- Format dropdown I can choose Windows Media, Quicktime, Real Me