facebook

Internal server error (Please reply)

  1. MyEclipse IDE
  2.  > 
  3. Off Topic
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #243854 Reply

    Ghazalawahid
    Member

    Hi,

    I am trying to access a servlet from a html page in a Web project.

    (Using Tomcat 5 as app server)

    1) Project name is userregistration.
    2) Servlet name is displayname which is in a package userpackage under src folder.
    3) HTML file name is welcome which is accessing a servlet when submit button is clicked. The command for accessing servlet is :

    FORM ACTION = “displayusername” method = post

    WEB-INF/web.xml setting is :

    <servlet>
    <description>This is the description of my J2EE component</description>
    <display-name>This is the display name of my J2EE component</display-name>
    <servlet-name>Displayusername</servlet-name>
    <servlet-class>userservlets.displayname</servlet-class>
    </servlet>

    <servlet-mapping>
    <servlet-name>Displayusername</servlet-name>
    <url-pattern>/displayusername</url-pattern>
    </servlet-mapping>

    </web-app>

    The problem is when I press save buttom in html form ,it gives message “Internal server error” in browser.

    The log for the localhost in Tomcat server says :

    SEVERE: Allocate exception for servlet Displayusername
    java.lang.UnsupportedClassVersionError: userservlets/displayuser (Unsupported major.minor version 49.0)

    Am i missing any setting regarding classpath in MyEclipse environment?Because i have not updated anything in Eclipse/MyEclipse after installation.

    Thanks.

    #243855 Reply

    Greg
    Member

    SEVERE: Allocate exception for servlet Displayusername
    java.lang.UnsupportedClassVersionError: userservlets/displayuser (Unsupported major.minor version 49.0)

    This is a Java5 vs Java1.4.X problem. What version of Tomcat are you using? I believe if you are wanting to develop/deploy with java5 you must use Tomcat 5.5. Give that a try if you are using Tomcat5.0.x at the moment.

    #243860 Reply

    Riyad Kalla
    Member

    Moving to OT > Soft Dev

    Greg is right, the problem seems like you are compiling your code with Java5 support enabled, then running it under Tomcat with JDK 1.4, and the 1.4 VM is barfing on it “I don’t understand this, wrong bytecode version”.

    #243881 Reply

    Ghazalawahid
    Member

    Thanks a lot guys for all your support.

    As I changed the jdk version from 4 to 5 ,it found the servlet .

    Thanks again.

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: Internal server error (Please reply)

You must be logged in to post in the forum log in