ClassCastException: javax.servlet.http.NoBodyResponse
Hi all,
I Have an EAR containing a web application containing a bunch of servlets and an applet accessed through jnlp. When I start the applet, everything works perfectly well, all the functionnalities work. But in my log file, I get about 4 exceptions (always the same) and sometime later on (using the applet) I get one or two more. I know some people on the net had the same problem in various situations but I never found replies to their posts in the archives.
So it runs on sun JSAS 9.0, Windows XP64.
This is the exceptionx I get in the server log just when webstart starts:
(sorry, it is long and ugly in this small text box).
--> The "com.zerobase..." line is just because I override service() and call super() there.
java.lang.ClassCastException: javax.servlet.http.NoBodyResponse
at org.apache.catalina.core.ApplicationDispatcherForward.getStatus(ApplicationDispatcherForward.java:335)
at org.apache.catalina.core.ApplicationDispatcherForward.commit(ApplicationDispatcherForward.java:79)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:355)
at com.zerobase.chaplin.action.PostActionServlet.processActionForward(PostActionServlet.java:692)
at com.zerobase.chaplin.action.PostActionServlet.process(PostActionServlet.java:336)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:492)
at javax.servlet.http.HttpServlet.doHead(HttpServlet.java:281)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:724)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at com.zerobase.chaplin.action.PostActionServlet.service(PostActionServlet.java:114)
at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:397)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:278)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:536)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:240)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:179)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:73)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:182)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
at com.sun.enterprise.web.VirtualServerPipeline.invoke(VirtualServerPipeline.java:120)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:137)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:536)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:239)
at com.sun.enterprise.web.connector.grizzly.ProcessorTask.invokeAdapter(ProcessorTask.java:667)
at com.sun.enterprise.web.connector.grizzly.ProcessorTask.processNonBlocked(ProcessorTask.java:574)
at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:844)
at com.sun.enterprise.web.connector.grizzly.ReadTask.executeProcessorTask(ReadTask.java:287)
at com.sun.enterprise.web.connector.grizzly.ReadTask.doTask(ReadTask.java:212)
at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:252)
at com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:75)
Thanks for reporting this issue!
I've filed a GlassFish issue at
https://glassfish.dev.java.net/issues/show_bug.cgi?id=2210
Please add yourself to the issue's "cc" list, so you'll get notified of any progress.
Jan
Similar Messages
-
ClassCastException: javax.servlet.http.NoBodyOutputStream
Can anyone tell me what is going on with the following ? Runing WL 6.1 SP2.
We are getting a fair number of these.
####<Mar 27, 2003 6:04:50 PM CST> <Error> <HTTP> <vusdfwdevbld2>
<VSWA420B91Server> <ExecuteThread: '66' for queue: 'default'> <admin> <>
<101020> <[WebAppServletContext(1229058,vissys-web,/vissys-web)] Servlet
failed with Exception>
java.lang.ClassCastException: javax.servlet.http.NoBodyOutputStream
at
weblogic.servlet.ClasspathServlet.sendResource(ClasspathServlet.java:229)
at weblogic.servlet.ClasspathServlet.doGet(ClasspathServlet.java:94)
at javax.servlet.http.HttpServlet.doHead(HttpServlet.java:313)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:757)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:265)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:200)
at
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletCo
ntext.java:2495)
at
weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java
:2204)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
Can anyone tell me what is going on with the following ? Runing WL 6.1 SP2.
We are getting a fair number of these.
####<Mar 27, 2003 6:04:50 PM CST> <Error> <HTTP> <vusdfwdevbld2>
<VSWA420B91Server> <ExecuteThread: '66' for queue: 'default'> <admin> <>
<101020> <[WebAppServletContext(1229058,vissys-web,/vissys-web)] Servlet
failed with Exception>
java.lang.ClassCastException: javax.servlet.http.NoBodyOutputStream
at
weblogic.servlet.ClasspathServlet.sendResource(ClasspathServlet.java:229)
at weblogic.servlet.ClasspathServlet.doGet(ClasspathServlet.java:94)
at javax.servlet.http.HttpServlet.doHead(HttpServlet.java:313)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:757)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:265)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:200)
at
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletCo
ntext.java:2495)
at
weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java
:2204)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
-
When running weblogic 4.5.1 on our staging server we get the following
exceptions happening intermitently
Our other servers have identical code and properties files and they are fine
Tue Jul 11 12:03:53 GMT+01:00 2000:<E> <ServletContext-Servlets> Servlet
failed with RuntimeException
Tue Jul 11 12:03:53 GMT+01:00 2000:<E> <ServletContext-Servlets>
java.lang.ClassCastException: javax.servlet.http.NoBodyOutputStream
at weblogic.servlet.FileServlet.sendFile(Compiled Code)
at weblogic.servlet.FileServlet.doGet(Compiled Code)
at javax.servlet.http.HttpServlet.doHead(Compiled Code)
at javax.servlet.http.HttpServlet.service(Compiled Code)
at javax.servlet.http.HttpServlet.service(Compiled Code)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(Compiled Code)
at weblogic.servlet.internal.ServletContextImpl.invokeServlet(Compiled
Code)
at weblogic.servlet.internal.ServletContextImpl.invokeServlet(Compiled
Code)
at weblogic.socket.MuxableSocketHTTP.invokeServlet(Compiled Code)
at weblogic.socket.MuxableSocketHTTP.execute(Compiled Code)
at weblogic.t3.srvr.ExecuteThread.run(Compiled Code)
Tue Jul 11 12:03:53 GMT+01:00 2000:<E> <HTTP> Servlet request terminated
with IOException:
Tue Jul 11 12:03:53 GMT+01:00 2000:<E> <HTTP> java.net.ProtocolException:
Exceeded stated content-length of: 1230 bytes
at java.lang.Throwable.fillInStackTrace(Native Method)
at java.lang.Throwable.fillInStackTrace(Compiled Code)
at java.lang.Throwable.<init>(Compiled Code)
at java.lang.Exception.<init>(Compiled Code)
at java.io.IOException.<init>(Compiled Code)
at java.net.ProtocolException.<init>(Compiled Code)
at weblogic.servlet.internal.ServletOutputStreamImpl.print(Compiled Code)
at javax.servlet.ServletOutputStream.println(ServletOutputStream.java:252)
at
weblogic.servlet.internal.ServletResponseImpl.sendError(ServletResponseImpl.
java:307)
at weblogic.servlet.internal.ServletResponseImpl.sendError(Compiled Code)
at weblogic.servlet.internal.ServletContextImpl.invokeServlet(Compiled
Code)
at weblogic.servlet.internal.ServletContextImpl.invokeServlet(Compiled
Code)
at weblogic.socket.MuxableSocketHTTP.invokeServlet(Compiled Code)
at weblogic.socket.MuxableSocketHTTP.execute(Compiled Code)
at weblogic.t3.srvr.ExecuteThread.run(Compiled Code)
Any ideas ?When running weblogic 4.5.1 on our staging server we get the following
exceptions happening intermitently
Our other servers have identical code and properties files and they are fine
Tue Jul 11 12:03:53 GMT+01:00 2000:<E> <ServletContext-Servlets> Servlet
failed with RuntimeException
Tue Jul 11 12:03:53 GMT+01:00 2000:<E> <ServletContext-Servlets>
java.lang.ClassCastException: javax.servlet.http.NoBodyOutputStream
at weblogic.servlet.FileServlet.sendFile(Compiled Code)
at weblogic.servlet.FileServlet.doGet(Compiled Code)
at javax.servlet.http.HttpServlet.doHead(Compiled Code)
at javax.servlet.http.HttpServlet.service(Compiled Code)
at javax.servlet.http.HttpServlet.service(Compiled Code)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(Compiled Code)
at weblogic.servlet.internal.ServletContextImpl.invokeServlet(Compiled
Code)
at weblogic.servlet.internal.ServletContextImpl.invokeServlet(Compiled
Code)
at weblogic.socket.MuxableSocketHTTP.invokeServlet(Compiled Code)
at weblogic.socket.MuxableSocketHTTP.execute(Compiled Code)
at weblogic.t3.srvr.ExecuteThread.run(Compiled Code)
Tue Jul 11 12:03:53 GMT+01:00 2000:<E> <HTTP> Servlet request terminated
with IOException:
Tue Jul 11 12:03:53 GMT+01:00 2000:<E> <HTTP> java.net.ProtocolException:
Exceeded stated content-length of: 1230 bytes
at java.lang.Throwable.fillInStackTrace(Native Method)
at java.lang.Throwable.fillInStackTrace(Compiled Code)
at java.lang.Throwable.<init>(Compiled Code)
at java.lang.Exception.<init>(Compiled Code)
at java.io.IOException.<init>(Compiled Code)
at java.net.ProtocolException.<init>(Compiled Code)
at weblogic.servlet.internal.ServletOutputStreamImpl.print(Compiled Code)
at javax.servlet.ServletOutputStream.println(ServletOutputStream.java:252)
at
weblogic.servlet.internal.ServletResponseImpl.sendError(ServletResponseImpl.
java:307)
at weblogic.servlet.internal.ServletResponseImpl.sendError(Compiled Code)
at weblogic.servlet.internal.ServletContextImpl.invokeServlet(Compiled
Code)
at weblogic.servlet.internal.ServletContextImpl.invokeServlet(Compiled
Code)
at weblogic.socket.MuxableSocketHTTP.invokeServlet(Compiled Code)
at weblogic.socket.MuxableSocketHTTP.execute(Compiled Code)
at weblogic.t3.srvr.ExecuteThread.run(Compiled Code)
Any ideas ? -
today i had the following exception, which blows my mind away. what can be wrong?
java.lang.ClassCastException: javax.servlet.jsp.jstl.fmt.LocalizationContext
at org.apache.taglibs.standard.tag.common.fmt.BundleSupport.getLocalizationContext(Ljavax.servlet.jsp.PageContext;)Ljavax.servlet.jsp.jstl.fmt.LocalizationContext;(BundleSupport.java:127)
at org.apache.taglibs.standard.tag.common.fmt.MessageSupport.doEndTag()I(MessageSupport.java:152)
at jsp_servlet._web_45_inf._jsp._templates.__template._jspService(Ljavax.servlet.http.HttpServletRequest;Ljavax.servlet.http.HttpServletResponse;)V(__template.java:235)environment: weblogic 8.1-sp4, jstl 1.0.6well the fact is that the JSPs are 100% correct. i'm migrating some legacy project, which builds, deploys and runs in its old state with no errors at all (and the old state is current PRO, so every bit of code is supposed to be correct). hence i presume it's not the JSPs that are wrong (because i never touched them), that's something else, probably the configuration of things, or conflicts between container libs and webapp libs, or sort of like that.
so if this error doesn't ring a bell, then i'll try to fiddle around, i thought maybe that's something "famous" :). -
Package javax.servlet.http does not exist
Hello All,
A few problems here
1. My classpath doesnt seem to work.:
.;"C:\Program Files\Apache Software Foundation\Tomcat 6.0\lib\servlet-api.jar"
2. As a result, i get many errors in my simple code, but there are still a few that are not related to javac not recognizing the servlet api.
I also tried setting the classpath at the command line (event hough its temporary)
set classpath="C:\Program Files\Apache Software Foundation\Tomcat 6.0\lib\servlet-api.jar"
but the servlet package is still not recognized
I have 2 classes, one to read the database connection details from a file and another class, my servlet.
Servlet Code:
import java.io.*;
import java.sql.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class CustomQuery extends HttpServlet
public void init() throws ServletException
EstablishDBConnetion.establishConnection();
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
response.setContentType("text/html");
PrintWriter printer = new response.getWriter();
String title = "Result from custom query";
Statement stmt = EstablishDBConnetion.establishConnection.con.createStatement();
ResultSet rs = stmt.executeQuery("select customerID from customer");
while(rs.next())
printer.println("<html> <head><title>" + title + "</title><br><br><table border=\"0\"> <tr><td>" + rs.getString(1));
rs.close();
stmt.close();
EstablishDBConnetion.establishConnection.con.close();
Database connection code
import java.io.*;
import java.sql.*;
import java.util.StringTokenizer;
class EstablishDBConnetion
public static void establishConnection()
try
String dbDriver = "";
String dbUrl = "";
String dbName = "";
String dbUser = "";
String dbPassword = "";
String newLine = "";
BufferedReader fileRead = new BufferedReader(new FileReader("connection.txt"));
boolean readerStatus = fileRead.ready();
newLine = fileRead.readLine();
while (readerStatus)
StringTokenizer st = new StringTokenizer(newLine, ",");
while (st.hasMoreTokens())
dbDriver = st.nextToken();
dbUrl = st.nextToken();
dbName = st.nextToken();
dbUser = st.nextToken();
dbPassword = st.nextToken();
readerStatus = fileRead.ready();
Class.forName(dbDriver);
String url = dbUrl + dbName;
System.out.print(url);
Connection con = DriverManager.getConnection(url, dbUser, dbPassword);
catch (IOException e)
System.out.println("IO exception in establishConnection()");
e.printStackTrace();
catch (java.lang.Exception ex)
System.out.println("General exception in establishConnection()");
ex.printStackTrace();
public static void main(String[] args)
//EstablishDBConnetion edbc = new EstablishDBConnetion();
establishConnection();
}also, full error list below
CustomQuery.java:4: package javax.servlet does not exist
import javax.servlet.*;
^
CustomQuery.java:5: package javax.servlet.http does not exist
import javax.servlet.http.*;
^
CustomQuery.java:7: cannot find symbol
symbol: class HttpServlet
public class CustomQuery extends HttpServlet
^
CustomQuery.java:10: cannot find symbol
symbol : class ServletException
location: class CustomQuery
public void init() throws ServletException
^
CustomQuery.java:16: cannot find symbol
symbol : class HttpServletRequest
location: class CustomQuery
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
^
CustomQuery.java:16: cannot find symbol
symbol : class HttpServletResponse
location: class CustomQuery
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
^
CustomQuery.java:16: cannot find symbol
symbol : class ServletException
location: class CustomQuery
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
^
CustomQuery.java:19: package response does not exist
PrintWriter printer = new response.getWriter();
^
CustomQuery.java:24: cannot find symbol
symbol : variable establishConnection
location: class EstablishDBConnetion
Statement stmt = EstablishDBConnetion.establishConnection.con.createStatement();
^
CustomQuery.java:39: cannot find symbol
symbol : variable establishConnection
location: class EstablishDBConnetion
EstablishDBConnetion.establishConnection.con.close();
^
10 errors
I appreciate your help
Message was edited by:
paulchwd
null
Message was edited by:
paulchwdThe library is in tomcat/common/lib, not in tomcat/lib.
-
Javax.servlet.http.* package does not exist ?
i am using j2sdk which does not include servlets, so in the forums i found that including servlet.jar file in jdk1.6.0\jre\lib\ext javax.servlet.* was included but javax.servlet.http did not ..... now this is strange either both do not work or both work. here is the code
import javax.servlet.*;
import javax.servlet.Http.*;
class login
error is package javax.servlet.Http.*; does not exist.Dear,
javax.servlet is one of the J2EE (Java Enterprise Edition) packages that is not included in the J2SE (Java Standard Edition) , so that one used for developing server side application.
I hope this help.
Regards. -
Error: package javax.servlet.http does not exist
Hi all,
How do I import javax.servlet?
package com.example.web;
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
public class BeerSelect extends HttpServlet {
public void doPost(HttpServletRequest request,
HttpServletResponse response)
throws IOException, ServletException {
response.setContentType("text/html");
PrintWriter out = response.getWrite();
out.println ("Beer Selection Advide<br>");
String c = request.getParameter("color");
out.println ("<br>Got beer color " + c);
}What does this error mean? The error message:
Compiling 1 source file to C:\Program Files\Apache Software Foundation\MyProjects\J2EE\build\classes
C:\Program Files\Apache Software Foundation\MyProjects\J2EE\src\com\example\web\BeerSelect.java:3:
package javax.servlet does not exist
import javax.servlet.*;
C:\Program Files\Apache Software Foundation\MyProjects\J2EE\src\com\example\web\BeerSelect.java:4:
package javax.servlet.http does not exist
import javax.servlet.http.*;
C:\Program Files\Apache Software Foundation\MyProjects\J2EE\src\com\example\web\BeerSelect.java:7:
cannot find symbol
symbol: class HttpServlet
public class BeerSelect extends HttpServlet {
C:\Program Files\Apache Software Foundation\MyProjects\J2EE\src\com\example\web\BeerSelect.java:8:
cannot find symbol
symbol : class HttpServletRequest
location: class com.example.web.BeerSelect
public void doPost(HttpServletRequest request,
C:\Program Files\Apache Software Foundation\MyProjects\J2EE\src\com\example\web\BeerSelect.java:9:
cannot find symbol
symbol : class HttpServletResponse
location: class com.example.web.BeerSelect
HttpServletResponse response)
C:\Program Files\Apache Software Foundation\MyProjects\J2EE\src\com\example\web\BeerSelect.java:10:
cannot find symbol
symbol : class ServletException
location: class com.example.web.BeerSelect
throws IOException, ServletException {
6 errors
BUILD FAILED (total time: 0 seconds)Thank you.Hi,
The file servlet-api.jar / servlet.jar is not available in your classpath.
To compile an Servlet you need the jar file to be in classpath.
The jar file can be found in your webserver / application server lib folder.
Regards,
Zack -
Package javax.servlet does not exist, package javax.servlet.http does not
Dear All,
I am a newbie to JAVA.
I installed JDK1.6.0_04, then NetBeans IDE 6.0
I tried compiling an example servlet, but got this error message:
package javax.servlet does not exist, package javax.servlet.http does not exist
I tried locating these packages, but in vain. I also tried setting the CLASSPATH to many values, still it did not work.
Can anyone, please, help me with this.
Should I be able to see/locate these packages, do I have to download them?
Thank you very much.davidgoodman wrote:
Dear All,
I am a newbie to JAVA.
I installed JDK1.6.0_04, then NetBeans IDE 6.0
I tried compiling an example servlet, but got this error message:
package javax.servlet does not exist, package javax.servlet.http does not exist
What servlet/JSP engine do you plan to deploy to? Tomcat, perhaps?I think it's Tomcat (C:\Program Files\Apache Software Foundation\Apache Tomcat 6.0.14). Are there other engines that come with NetBeans IDE 6.0 (when I downloaded NetBeans, I chose ALL)
>
If so, you'll need to put the servlet JAR in your CLASSPATH. (servlet-api.jar for Tomcat 5.5 and earlier, servlet.jar for 6.0 >and later.)
I tried locating these packages, but in vain.
You won't find them until you realize that you have to deploy that servlet someplace.How to deploy?
I also tried setting the CLASSPATH to many values, still it did not work.
See above. What were you planning to set CLASSPATH to?First I set to:
C:\Program Files\Apache Software Foundation\Apache Tomcat 6.0.14\lib (because I found jar named servlet-api.jar in this folder)
Later I added this:
C:\Program Files\Java\jdk1.6.0_04\lib (out of trial-and-fail)
Finally I added some paths that lead to a library such as
C:\Program Files\glassfish-v2\lib
C:\Program Files\glassfish-v2\lib\ant\lib
Can anyone, please, help me with this.
Should I be able to see/locate these packages, do I have to download them?
You have to get a servlet/JSP engine. Step 1.Thank you for your help -
Javax.servlet.http.* error
I am trying to compile a file, but got the error message "package javax.servlet.http does not exist",
"import javax.servlet.http.*"
It seems to me that this particular package is missing. how and where exactlly do I get this particular package and make it to work??
thanksAs you are using the package I assume that you're targetting a servlet engine (such as Tomcat) or a J2EE server. The package is in servlet.jar which is part of the binary release of the container that you are using.
You can download containers from the following links:
http://java.sun.com/products/servlet/index.html
http://jakarta.apache.org/tomcat/index.html -
Why I got package javax.servlet.http do not exist
I have package javax.servlet.http do not exist problem, can anyone tell me why?
Thank youHi all
Thank you for all kinds of replies. It is Windows problems. but I got a new questions here
1) it seems I don't need to including
install_dir\common\lib\jsp-api.jar in classpath!!
2) when I try servletUtilities,
from http://www.coreservlets.com/Apache-Tomcat-Tutorial/#Configure-Tomcat
I got error
HelloServlet3.java:23: cannot resolve symbol
symbol : variable ServletUtilities
location: class coreservlets.HelloServlet3
out.println(ServletUtilities.headWithTitle(title) +
^
1 error
both my HelloServlet3 and servletUtilities under
WEB-INF\classes\coreservlets
thank you -
Package javax.servlet.http does not exists
Hi,
I am new to J2EE and am writing my first servlet. I tried to compile a servlet I wrote and got the following error.
"package javax.servlet.http does not exists".
What do i do to correct this error?
Also is there any links which has a complete servlet tutorial.
Please advice
ThanxMost probably you need to include the servlet-api library in your classpath when compiling.
You should find this file in the lib directory of your container.
It will be called servlet-api.jar (Tomcat) or j2ee.jar (Suns J2EE server) or something along those lines.
The j2ee tutorial is a decent place to start learning about servlets...
http://java.sun.com/j2ee/1.4/docs/tutorial/doc/
Good luck,
evnafets -
Hi
I am trying to compile one servlet code using commancd prompt and i get
package javax.servlet.http does not exist import javax.servlet.http.HttpServlet;
error for following code
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
public class SampleServlet extends HttpServlet
public void saveToSession(HttpServletRequest request)
String testparam = request.getParameter("testparam");
request.getSession().setAttribute("testAttribute", testparam);
please help meTry giving servlet..jar path in the class path variable
-
Cannot Import javax.servlet.* and javax.servlet.http.*
Hello,
I am a University Student and now doing a project using Servlet and JSP
I have installed WinXP and Tomcat 5.0 on my computer
When I compile the servlet , there are error messages "package javax.servlet does not exist" and "package javax.servlet.http does not exist" coming out.
I have set the classpath already
i.e. %CATALINA_HOME%\common\lib\servlet-api.jar;%CATALINA_HOME%\common\lib\jsp-api.jar
( Of course "%CATALINA_HOME%" = my folder that install the Tomcat )
Can Anybody Explain what is happening and suggest a solution to me?
Please give a hand.When you ran that command, what happened? Let javac.exe tell you the right answer.
I'd advise two things:
(1) Installing any s'ware in a directory whose name contains spaces (e.g., "Apache Software Foundation" or "Tomcat 5.0") is a very bad idea, IMO. I'd reinstall to a new directory.
(2) Your HelloServlet.java servlet probably doesn't have a package statement in it. Tomcat 5.0 won't play nicely with servlets or beans that aren't in packages. I'd add one and use the -d . option on javac.exe to make sure it created the package directory structure for me. -
SAPNoClassDefFoundError: javax.servlet.http.HttpSessionListener
Hi,
I have deployed an application in to Netweaver WAS, and have given a hard reference to one of the libraries which is already deployed in the same server. But when starting the application, it gives an error telling that <b><i>javax.servlet.http.HttpSessionListener</i></b> is not available. I gave the servlet.jar in the classpath and still its giving the same error.
Can anyone tell me what can i do to get rid of this problem? This is the error message iam getting in the defaulttrace file:
<b><i>The error is: com.sap.engine.frame.core.load.SAPNoClassDefFoundError: javax.servlet.http.HttpSessionListener</i></b>Hi Venkat
Check in the visual admin-deploy service,whether or not your application is deployed.Try to start it.
Also check out the below link
http://help.sap.com/saphelp_nw2004s/helpdata/en/1b/92e4e701b242c2833a7adde6ecad09/frameset.htm
Message was edited by:
Rajat Anand
Message was edited by:
Rajat Anand -
Package javax.servlet.http
Hi,
i work whith Solaris 2.6
my java version is 1.3.0
The package javax.servlet.http is not a standard package?
Where he is?
I can download it?
look my error when i start weblogic server:
Servlet failed with Exception
java.lang.NoClassDefFoundError: javax/servlet/http/HttpServletRequest
Thanks!Download latest version of j2ee.jar from http://java.sun.com/j2ee/index.jsp
Amar.
Maybe you are looking for
-
Regarding Autogeneration of Business Partner Code.
Dear All, I have a unique requirement. My client wants autogeneration of Business Partner Code in the Business Partner Master. Please guide me in regard to this. Regards Hitesh Parsawala
-
The siri that was supposed to come with the newest update iOS 6 did not download onto my ipad. Neither did some of the other updates that were to come with it, yet some did. I cannot redownload this update, but I really want siri. It worked for my fr
-
Have a brand new iPhone 5S and Nano iPod. 5 days old. Using original charging cord and getting message from both units that the cord is unsupported. Is the cord damaged somehow? It looks fine . Today I was trying to SYNC Nano with laptop to transf
-
Converting seconds to hours + minutes + seconds
hey all, was just looking for the quickest way to convert seconds to hours + minutes + seconds eg, 18084 s is 5h, 1m, 24s.
-
Improvements of NWDI in NW2004s vs NW2004
Hello, we are studying to upgrade the Netweaver Application Server in order to gain improvements in NWDI. We are using NW2004 support package 15, wich is the las sp to make changes in NWDI (at least that says the doc I've read about the support packa