Apache Tomcat/Java Servlet help?

Discussion in 'OT Technology' started by Joe_Cool, Jun 2, 2005.

  1. Joe_Cool

    Joe_Cool Never trust a woman or a government. Moderator

    Joined:
    Jun 30, 2003
    Messages:
    299,296
    Likes Received:
    560
    I have Tomcat installed on my server, and it's serving up pages no problem. I get the default homepage and the example servlets, but when I compile a servlet and try to host it, I get a 404 error.

    The virtual directory is there, but my servlet doesn't seem to be. Anybody have any experience with this stuff?
     
  2. ShapeShifterz

    ShapeShifterz Longtime Lurker

    Joined:
    Mar 15, 2000
    Messages:
    183
    Likes Received:
    0
    Location:
    Bay Area, CA
    I typically give Tomcat Manager a .war file and it deploys automatically. Is it possible for you to export your project to a .war file?
     
  3. P07r0457

    P07r0457 New Member

    Joined:
    Sep 20, 2004
    Messages:
    28,491
    Likes Received:
    0
    Location:
    Southern Oregon
    why the fuck are you using tomcat? That is the worst piece of shit ever.
     
  4. Joe_Cool

    Joe_Cool Never trust a woman or a government. Moderator

    Joined:
    Jun 30, 2003
    Messages:
    299,296
    Likes Received:
    560
    Thanks for the helpful reply, asshole.
     
  5. Joe_Cool

    Joe_Cool Never trust a woman or a government. Moderator

    Joined:
    Jun 30, 2003
    Messages:
    299,296
    Likes Received:
    560
    I'll give that a try, thanks.
     
  6. SLED

    SLED build an idiot proof device and someone else will

    Joined:
    Sep 20, 2001
    Messages:
    28,118
    Likes Received:
    0
    Location:
    AZ, like a bauce!
    where did you put the new servlet? did you tell the tomcat configuration about it? Are you using the jk_module?
     
  7. kevlarface

    kevlarface New Member

    Joined:
    Sep 17, 2002
    Messages:
    2,042
    Likes Received:
    0
    Location:
    Peg City
    Did you restart Tomcat after you compile?
    my problem is similar...
    I can view my servlet but then then when I do something eg. hit submit button it gives me a 404 error. I tired to set it up like how we have it at school but no go.
     
  8. CyberBullets

    CyberBullets I reach to the sky, and call out your name. If I c

    Joined:
    Nov 13, 2001
    Messages:
    11,865
    Likes Received:
    0
    Location:
    BC, Canada/Stockholm, Sweden
    this is like the pot calling the kettle black... :noes:
     
  9. kevlarface

    kevlarface New Member

    Joined:
    Sep 17, 2002
    Messages:
    2,042
    Likes Received:
    0
    Location:
    Peg City
    Joe_Cool - are you running database? I had to connect mine

    Administrative Tools -> Data Sources (ODBC)
    On the 'System DSN' tab, click the 'Add...' button
    Choose 'Microsoft Access Driver (*.mdb) and click 'Finish' button
    Data Source Name is 'BookOrders'
    Click 'Select...' button and browse to the BookOrders.mdb database on your system
    Click the 'OK' button

    hope that helps...btw what text editor are you using? I am using JCreator and you have to import the .jar files from Tomcat.
     
  10. Joe_Cool

    Joe_Cool Never trust a woman or a government. Moderator

    Joined:
    Jun 30, 2003
    Messages:
    299,296
    Likes Received:
    560
    Well I'm running PostgreSQL, but my servlet is just a simple "hello world" with no need for a db, but it still doesn't work.

    By the way, it's running on a linux machine, not windows.

    I did put everything into *.war files, restarted Tomcat, and same thing. I even took precompiled servlets that I can see working, put them in new directories, and they didn't work. At least now I know for sure it's something I'm doing wrong and not a problem with the install or anything. :hs: :confused:

    And for my text editor, I'm using TextPad on windows and pico on linux.
     

Share This Page