Run Time Error .. Pls help .. Urgent


Web tier: servlets, JSP, Web frameworks: Run Time Error .. Pls help .. Urgent

  1. Run Time Error .. Pls help .. Urgent (3 messages)

    Hello Friends

    I have a problem to connect the JSP Page with database. My bean class is working when i check it as stand alone application. when i include it with the jsp it gives the listed error message. i cant able to contineue my project with this. please help to figure out the problem.



    Bean Coding :

    import java.sql.*;
    import java.util.Vector;

    public class OnlineShop {

    public Connection con=null;
    public Statement st=null;
    public ResultSet rs=null;

    public OnlineShop() { }

    public Vector Categories() throws ClassNotFoundException,SQLException{

    con =DriverManager.getConnection("jdbc:odbc:Test");
    st = con.createStatement();
    rs = st.executeQuery("Select Description from Products");
    Vector v = new Vector();
    String s = rs.getString(1);
    String[] sa = new String[v.size()];
    for(int i=0;i<v.size();++i)
    return v;


    JSP Coding

    <%@ page language="java" import="OnlineShop,java.util.Vector" %>
    <jsp:useBean id="sb" class="OnlineShop" scope = "application" />

    Vector v = new Vector();
    v = sb.Categories();

    <center > calculators </center>
    <% for(int i=0;i<v.size();i++) { %>
    <table border="1">
    <%=v.elementAt(i); %>
    <% } %>


    Error Message :

    Error during JSP page processing
    java.lang.NoSuchMethodError: java.util.Vector: method add(Ljava/lang/Object;)Z not found
    at OnlineShop.Categories(Compiled Code)
    at pagecompile.jsp._Calculator._jspService(
    at com.sun.server.http.pagecompile.jsp.runtime.HttpJspBase.service(
    at javax.servlet.http.HttpServlet.service(
    at com.sun.server.http.pagecompile.jsp.runtime.JspServlet.runServlet(
    at com.sun.server.http.pagecompile.jsp.runtime.JspServlet.processJspPage(
    at com.sun.server.http.pagecompile.jsp.runtime.JspServlet.service(
    at javax.servlet.http.HttpServlet.service(
    at com.sun.server.ServletState.callService(
    at com.sun.server.ServletManager.callServletService(
    at com.sun.server.ProcessingState.invokeTargetServlet(
    at com.sun.server.http.HttpProcessingState.execute(
    at com.sun.server.http.stages.Runner.process(
    at com.sun.server.ProcessingSupport.process(Compiled Code)
    at com.sun.server.Service.process(
    at com.sun.server.http.HttpServiceHandler.handleRequest(
    at com.sun.server.http.HttpServiceHandler.handleRequest(Compiled Code)
    at Code)

  2. Run Time Error .. Pls help .. Urgent[ Go to top ]

    chk ur server classpath.
  3. try


    instead of


    hope this helps.

  4. v.addElement(s) works fine. thanks for ur kind help