473,396 Members | 1,834 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Reg:NETBEANS

kaleeswaran
132 100+
Hi..

I am running web application using NetBeans ID...

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

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


the code is....


<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@ page import="java.util.ArrayList" %>
<%@ page import="com.myapp.struts.sample" %>
<%@ page import="com.myapp.struts.userForm" %>
<%@ page import="java.util.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.getAllCols();


Iterator colIterator = allCols.iterator();

while (colIterator.hasNext()) {
u = (userForm)colIterator.next();
String name=u.getName();
String pwd=u.getPwd();

%>

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

</tr>

<%
}
%>
</table>



</body>
</html>

Regards
Kaleesh
Jul 23 '07 #1
2 4027
Hi..

I am running web application using NetBeans ID...

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

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


the code is....


<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@ page import="java.util.ArrayList" %>
<%@ page import="com.myapp.struts.sample" %>
<%@ page import="com.myapp.struts.userForm" %>
<%@ page import="java.util.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.getAllCols();


Iterator colIterator = allCols.iterator();

while (colIterator.hasNext()) {
u = (userForm)colIterator.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


Expand|Select|Wrap|Line Numbers
  1. while (colIterator.hasNext()) {
  2.                 u = (userForm)colIterator.next();
  3.                 String name=u.getName();
  4.                 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!!!
Jul 25 '07 #2
sumittyagi
202 Expert 100+
Hi..

I am running web application using NetBeans ID...

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

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


the code is....


<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@ page import="java.util.ArrayList" %>
<%@ page import="com.myapp.struts.sample" %>
<%@ page import="com.myapp.struts.userForm" %>
<%@ page import="java.util.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.getAllCols();


Iterator colIterator = allCols.iterator();

while (colIterator.hasNext()) {
u = (userForm)colIterator.next();
String name=u.getName();
String pwd=u.getPwd();

%>

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

</tr>

<%
}
%>
</table>



</body>
</html>

Regards
Kaleesh
A NoClassDefFoundException 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).
Jul 26 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

23
by: Alberto | last post by:
An OUTSTANDING example of a rebuttal. Worth a glance. Rather long, OBVIOUSLY feel fee to dismiss it entirely if not interested. But this habit of the rebuttals must go to a stop (forgive odd...
11
by: swethak | last post by:
Hi, My Requirement is to upload the images into database through jsp. For that i write a code .And it works fine .But in that File imgfile = new File("C:/Program Files/Apache Software...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.