Results 1 to 5 of 5
  1. #1
    JavaJimme is offline Member
    Join Date
    Nov 2012
    Posts
    30
    Rep Power
    0

    Default Java servlet doesn't run

    Hello,

    I'm trying to run my servlet but it seems I get an error and I can't figure out why...

    The web.xml
    Java servlet doesn't run-web.jpg


    The servlet
    Java servlet doesn't run-runningservlet.jpg


    When I run Tomcat I get this:
    Java servlet doesn't run-runningservlet.jpg

    Please help, I'm getting desprate here....

  2. #2
    gimbal2 is online now Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    3,914
    Rep Power
    5

    Default Re: Java servlet doesn't run

    Well that's not a crash in your own empty code, that's a crash in Tomcat :/

    The only thing that I see that is a bit off is that you have both the @WebServlet annotation AND web.xml configuration for the servlet; that's double, you need only one or the other (which shouldn't be a problem, but you never know). Try commenting out the web.xml servlet and servlet-mapping configuration data to see if that changes anything.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  3. #3
    JavaJimme is offline Member
    Join Date
    Nov 2012
    Posts
    30
    Rep Power
    0

    Default Re: Java servlet doesn't run

    Thanks to you I figured out what was wrong.. The tutorial I was following was abit off.. In the web.xml code line 4 should have been: <servlet-class>FirstServlet</servlet-class>
    Thanks for the reply ^^

  4. #4
    SurfMan's Avatar
    SurfMan is online now Godlike
    Join Date
    Nov 2012
    Location
    The Netherlands
    Posts
    938
    Rep Power
    2

    Default Re: Java servlet doesn't run

    The <servletclass> element wants a classname. So there could never be a / in it, only a dot.
    "It's not fixed until you stop calling the problem weird and you understand what was wrong." - gimbal2 2013

  5. #5
    JavaJimme is offline Member
    Join Date
    Nov 2012
    Posts
    30
    Rep Power
    0

    Default Re: Java servlet doesn't run

    Ye I figured, it was a really stupid mistake.. I should stop youtube tutorials because that one was incorrect.. I think I start with the book: Head First Servlets & JSP unless somebody got better suggestions. Thanks for the help though

Similar Threads

  1. Java Game Doesn't Work With Java 7
    By anthropamorphic in forum Java Gaming
    Replies: 1
    Last Post: 02-15-2013, 05:01 AM
  2. Replies: 4
    Last Post: 12-11-2012, 01:38 PM
  3. Replies: 13
    Last Post: 10-04-2012, 07:45 PM
  4. Java doesn't want to install anymore
    By Andross in forum Forum Lobby
    Replies: 0
    Last Post: 09-29-2011, 04:50 PM
  5. Replies: 3
    Last Post: 01-05-2011, 07:29 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •