File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes NoClassDefFoundError Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Reply locked New topic


smita mishra
Ranch Hand

Joined: May 18, 2006
Posts: 31
how can I fix this error?
index.html code is
<title> weblogic 7 bibleapp </title>
<meta http-equiv="Content-Type" content="text/html">
welcome to BibleAPP

<form action="http://localhost:7001/BibleApp/Hello">
<br> Name: <input type="text" name="stdname" value="pinky" >
<input type="submit" >



my servlet code is :
import javax.servlet.*;
import javax.servlet.http.*;

public class HelloServlet extends HttpServlet
public void doGet(HttpServletRequest req,HttpServletResponse resp) throws ServletException,IOException
PrintWriter out = resp.getWriter();
String param = req.getParameter("stdname");
if(param == null )
out.println("<html>"+"<body>" + "no parameter"+"</body>" +"</html>");

"my name is"+ param +"</body>"+


my web.xml code is:

<?xml version="1.0" ?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"

<servlet-name> servlet12 </servlet-name>
<servlet-class> servlet1 </servlet-class>

<servlet-name> servlet12 </servlet-name>
<url-pattern> /ser </url-pattern>

<servlet-name> Servlet2 </servlet-name>

<servlet-name> Servlet2 </servlet-name>
<url-pattern> /Hello </url-pattern>


I deploy this application is in weblogic 8 platform.
when I click on submit button I got an error messaage:
Error 500--Internal Server Error
java.lang.NoClassDefFoundError: java/lang/StringBuilder
at HelloServlet.doGet(
at javax.servlet.http.HttpServlet.service(
at javax.servlet.http.HttpServlet.service(
at weblogic.servlet.internal.ServletStubImpl$
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(
at weblogic.servlet.internal.WebAppServletContext$
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(
at weblogic.servlet.internal.ServletRequestImpl.execute(
at weblogic.kernel.ExecuteThread.execute(

why do I get this error message?How can I fix it?
Rahul Bhattacharjee
Ranch Hand

Joined: Nov 29, 2005
Posts: 2308
Is the jdk version which the weblogic is using is below 1.5?
I guess yes as StringBuilder is from jdk1.5

While compiling the classes you have used jdk1.5 , but at runtime you are using jdk1.4.

Rahul Bhattacharjee
LinkedIn - Blog
Muthukrishnan Palanichamy

Joined: Nov 24, 2006
Posts: 2
I think version 1.5xof Java is causing a naming conflict with them.
Carol Enderlin
Ranch Hand

Joined: Oct 10, 2000
Posts: 1364
Please don't post the same question multiple times.

Over here I made the same suggestion that you are running into a problem with java versions since StringBuilder was added with java 5.

WebLogic 7.0 supports JDK 1.3/1.4
WebLogic 8.1 supports JDK 1.4
WebLogic 9.x supports JDK 1.5 aka 5

You can check the BEA documentation for yourself at
I agree. Here's the link:
subject: NoClassDefFoundError
It's not a secret anymore!