Reg:NETBEANS

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kaleeswaran
    New Member
    • Mar 2007
    • 132

    #1

    Reg:NETBEANS

    Hi..

    I am running web application using NetBeans ID...

    While i am running this code i got an error like this...

    java.lang.NoCla ssDefFoundError : org/netbeans/modules/web/project/ant/JspCSingle
    Exception in thread "main"


    the code is....


    <%@page contentType="te xt/html"%>
    <%@page pageEncoding="U TF-8"%>
    <%@ page import="java.ut il.ArrayList" %>
    <%@ page import="com.mya pp.struts.sampl e" %>
    <%@ page import="com.mya pp.struts.userF orm" %>
    <%@ page import="java.ut il.Iterator" %>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>View Books</title>
    </head>
    <body>
    <%ArrayList allCols = null;%>
    <table>
    <tr>
    <td>
    USER NAME
    </td>
    <td>
    PASSWORD
    </td>

    </tr>
    <%
    sample s=new sample();
    userForm u=new userForm();
    allCols=s.getAl lCols();


    Iterator colIterator = allCols.iterato r();

    while (colIterator.ha sNext()) {
    u = (userForm)colIt erator.next();
    String name=u.getName( );
    String pwd=u.getPwd();

    %>

    <tr>
    <td>
    <%=pwd%>
    </td>
    <td>
    <%=name%>
    </td>

    </tr>

    <%
    }
    %>
    </table>



    </body>
    </html>

    Regards
    Kaleesh
  • nanhiPari
    New Member
    • Jul 2007
    • 8

    #2
    Originally posted by kaleeswaran
    Hi..

    I am running web application using NetBeans ID...

    While i am running this code i got an error like this...

    java.lang.NoCla ssDefFoundError : org/netbeans/modules/web/project/ant/JspCSingle
    Exception in thread "main"


    the code is....


    <%@page contentType="te xt/html"%>
    <%@page pageEncoding="U TF-8"%>
    <%@ page import="java.ut il.ArrayList" %>
    <%@ page import="com.mya pp.struts.sampl e" %>
    <%@ page import="com.mya pp.struts.userF orm" %>
    <%@ page import="java.ut il.Iterator" %>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>View Books</title>
    </head>
    <body>
    <%ArrayList allCols = null;%>
    <table>
    <tr>
    <td>
    USER NAME
    </td>
    <td>
    PASSWORD
    </td>

    </tr>
    <%
    sample s=new sample();
    userForm u=new userForm();
    allCols=s.getAl lCols();


    Iterator colIterator = allCols.iterato r();

    while (colIterator.ha sNext()) {
    u = (userForm)colIt erator.next();
    String name=u.getName( );
    String pwd=u.getPwd();

    %>

    <tr>
    <td>
    <%=pwd%>
    </td>
    <td>
    <%=name%>
    </td>

    </tr>

    <%
    }
    %>
    </table>



    </body>
    </html>

    Regards
    Kaleesh

    i dont know much of doing JSP..but have done this thing using Java..& this ERROR is very common..

    what i got thrugh ur code is that u are Making a DataBase Connection

    in this case when u are doing


    Code:
    while (colIterator.hasNext()) {
                    u = (userForm)colIterator.next();
                    String name=u.getName();
                    String pwd=u.getPwd();
    this While statements Throws an Exception which in Java we can clear up with a Try- Catch Block..

    so i think u also need to do the same thing..but dont know how this is done in JSP...

    Take care..
    Cheerz!!!

    Comment

    • sumittyagi
      Recognized Expert New Member
      • Mar 2007
      • 202

      #3
      Originally posted by kaleeswaran
      Hi..

      I am running web application using NetBeans ID...

      While i am running this code i got an error like this...

      java.lang.NoCla ssDefFoundError : org/netbeans/modules/web/project/ant/JspCSingle
      Exception in thread "main"


      the code is....


      <%@page contentType="te xt/html"%>
      <%@page pageEncoding="U TF-8"%>
      <%@ page import="java.ut il.ArrayList" %>
      <%@ page import="com.mya pp.struts.sampl e" %>
      <%@ page import="com.mya pp.struts.userF orm" %>
      <%@ page import="java.ut il.Iterator" %>
      <html>
      <head>
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <title>View Books</title>
      </head>
      <body>
      <%ArrayList allCols = null;%>
      <table>
      <tr>
      <td>
      USER NAME
      </td>
      <td>
      PASSWORD
      </td>

      </tr>
      <%
      sample s=new sample();
      userForm u=new userForm();
      allCols=s.getAl lCols();


      Iterator colIterator = allCols.iterato r();

      while (colIterator.ha sNext()) {
      u = (userForm)colIt erator.next();
      String name=u.getName( );
      String pwd=u.getPwd();

      %>

      <tr>
      <td>
      <%=pwd%>
      </td>
      <td>
      <%=name%>
      </td>

      </tr>

      <%
      }
      %>
      </table>



      </body>
      </html>

      Regards
      Kaleesh
      A NoClassDefFound Exception is thrown if a class is referenced with Java’s “new” operator (i.e. static loading) but the runtime system cannot find the referenced class.

      So I think your system is not able to find userForm class. I don't know much about struts framework, as I havn't worked on it, but I think you need to check out for the entry of userForm in your struts-config.xml file. (or may be any other setting).

      Comment

      Working...