Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3315920
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T22:24:28+00:00 2026-05-17T22:24:28+00:00

I worked with a JSP code and executed the same under the tomcat5.5 server.

  • 0

I worked with a JSP code and executed the same under the tomcat5.5 server. It worked fined. Now I have copied the same code to the other system under tomcat server. But while submission of that jsp file, am receiving the following error. What might be the cause for the error? Please advise.

root cause:
javax.servlet.ServletException: Bad version number in .class file (unable to load class myfirst.SearchLink)
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:841)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:774)
org.apache.jsp.Test_jsp._jspService(Test_jsp.java:70)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:308)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:259)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)

java.lang.UnsupportedClassVersionError: Bad version number in .class file (unable to load class myfirst.SearchLink)
org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1962)
org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:931)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1403)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1282)
org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:125)
org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:63)
java.lang.ClassLoader.loadClassInternal(Unknown Source)
org.apache.jsp.Test_jsp._jspService(Test_jsp.java:51)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:308)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:259)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)

UPDATE

Even after compiling all the java code I have, in the current version of java, I get the same error..

RECENT UPDATE

@Pangea Yes am using myfirst.SearchLink in my JSP code as follows,

myfirst.SearchLink o=new myfirst.SearchLink();
String result=o.checkURL(url);

And my java code for SearchLink is as below,

package myfirst;

import java.net.URL;
import java.net.URLConnection;
import java.sql.*;
public class SearchLink{
public static void main(String args[]) throws Exception {


}

public String checkURL(String link)throws SQLException{
    Connection con=null;
    Statement stmt=null;
    Statement stmtR=null;
    String mem;
    if(con==null){
            SQLConnection.setURL("jdbc:sqlserver://192.168.2.53\\SQL2005;user=sa;password=365media;DatabaseName=LN_ADWEEK");
            con=SQLConnection.getNewConnection();
            stmt=con.createStatement();
            stmtR=con.createStatement();
    }
    try{
        ResultSet rs;
        boolean hasRows=false;
        rs=stmt.executeQuery("select url from urls_linkins where url='"+link+"'");
        while(rs.next()){
            hasRows=true;
            //String mem=rs.getString(1);
            rs.close();
            return "This URL already exists in DB";
        }
        rs.close();
        if (!hasRows)
        {
            URL url = new URL(link);
            String domain=url.getHost();
            String Str="This URL does not exist in DB<br><br><br>";
            rs=stmtR.executeQuery("select url from urls_linkins where url like '%"+domain+"%'");
            boolean flag=false;
            while(rs.next()){
                if(!flag){
                Str=Str+"<Br>"+"Similar Domains in DB are";
                }
                flag=true;
                mem=rs.getString(1);
                //System.out.println("Similar Domains already in DB"+mem);
                Str=Str+"<Br>"+mem;
            }
            return Str;
        }
        return "This URL does not exist in DB";
    }catch(Exception e){
        e.printStackTrace();
        return e.getMessage();
    }finally{
        if(stmtR!=null){
            stmtR.close();
        }
        if(stmt!=null){
            stmt.close();
        }
        if(con!= null){
            con.close();
        }

    }
}


public String addURL(String link,String source)throws SQLException{
        Connection con=null;
        Statement stmt=null;
        Statement stmtR=null;
        final String rssvar="Rss";
        if(con==null){
                SQLConnection.setURL("jdbc:sqlserver://192.168.2.53\\SQL2005;user=sa;password=365media;DatabaseName=LN_ADWEEK");
                con=SQLConnection.getNewConnection();
                stmt=con.createStatement();
                stmtR=con.createStatement();
    }
        try{
            PreparedStatement insertUrlStatement = con.prepareStatement("INSERT INTO urls_linkins(url, source_name, is_active, is_periodic, Link_Type, New_Entry) VALUES(?, ?, ?, ?, ?, ?)");
            //insertUrlStatement.setInt(1, 21211);
            insertUrlStatement.setString(1, link);
            insertUrlStatement.setString(2, source);
            insertUrlStatement.setInt(3, 1);
            insertUrlStatement.setInt(4, 0);
            insertUrlStatement.setString(5, rssvar);
            insertUrlStatement.setInt(6, 1);
            insertUrlStatement.executeUpdate();
            insertUrlStatement.close();
            return "The URL has been added to the Database";}
        catch(Exception e){
            e.printStackTrace();
            return e.getMessage();
        }finally{
            if(stmtR!=null){
                stmtR.close();
            }
            if(stmt!=null){
                stmt.close();
            }
            if(con!= null){
                con.close();
            }
        }


}

public String addURL1(String link,String source)throws SQLException{
        Connection con=null;
        Statement stmt=null;
        Statement stmtR=null;
        final String other="Other";
        if(con==null){
                SQLConnection.setURL("jdbc:sqlserver://192.168.2.53\\SQL2005;user=sa;password=365media;DatabaseName=LN_ADWEEK");
                con=SQLConnection.getNewConnection();
                stmt=con.createStatement();
                stmtR=con.createStatement();
    }
        try{
            PreparedStatement insertUrlStatement = con.prepareStatement("INSERT INTO urls_linkins(url, source_name, is_active, is_periodic, Link_Type, New_Entry) VALUES(?, ?, ?, ?, ?, ?)");
            //insertUrlStatement.setInt(1, 21211);
            insertUrlStatement.setString(1, link);
            insertUrlStatement.setString(2, source);
            insertUrlStatement.setInt(3, 1);
            insertUrlStatement.setInt(4, 0);
            insertUrlStatement.setString(5, other);
            insertUrlStatement.setInt(6, 1);
            insertUrlStatement.executeUpdate();
            insertUrlStatement.close();
            return "The URL has been added to the Database";}
        catch(Exception e){
            e.printStackTrace();
            return e.getMessage();
        }finally{
            if(stmtR!=null){
                stmtR.close();
            }
            if(stmt!=null){
                stmt.close();
            }
            if(con!= null){
                con.close();
            }
        }
}

public String addmultiple(String file)throws SQLException{
        return file;
}
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T22:24:28+00:00Added an answer on May 17, 2026 at 10:24 pm

    This means your code is compiled against the java version that is not supported by the tomcat server you are running it in. May be you moved your code to older version of tomcat than 5.5 that is using older version of java

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I worked on a JSP code that is runnning on a Tomcat5.5 server in
I have a web application, which was designed and always worked under root context
this is a newbie question for you guys. In file /home/myhome/apache-tomcat-6.0.29/webapps/view/test.jsp I have <link
Friends, Previously I have worked with EJB-WEBSTART CLIENT project, and Now i have joined
Right now I have a JSP page that allows to sort some items, when
I'm running tomcat and have some jsp pages that display a subset of a
This worked a month ago and now i reload the code and it doesn't
For quite a while I have worked in the LAMP stack. But now I
I have a JSP page that creates a treeview using jQuery treeview plugin. Now
I have worked on generating PDF about 3 years ago and used FPDF lib

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.