Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » jetty continuations help!(unable to compile servlet which uses jetty continuations.)
icon8.gif  jetty continuations help! [message #665809] Sat, 16 April 2011 09:13 Go to next message
ravi  is currently offline ravi Friend
Messages: 4
Registered: April 2011
Junior Member
hi!
i have recently started using jetty (version 7.3.0.v20110203).
i'm unable to compile the following servlet which uses jetty continuations.

Please HELP.
thanks,
ravi.


import java.lang.*;
import java.io.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*; 
import org.eclipse.jetty.continuation.Continuation;
import org.eclipse.jetty.continuation.ContinuationSupport; 



public class ContinuationServlet extends HttpServlet {

  public void service(HttpServletRequest req, HttpServletResponse res)
                                              throws java.io.IOException {

    String reqId = req.getParameter("id");
    
   Continuation cc = ContinuationSupport.getContinuation(req);

    res.setContentType("text/plain");
    res.getWriter().println("Request: "+reqId+"\tstart:\t"+new Date());
    res.getWriter().flush();

    cc.suspend(2000);
    
    res.getWriter().println("Request: "+reqId+"\tend:\t"+new Date());
  }
}


i'm able to compile HelloWorld.java but not this servlet.
i'm using windows and C:\jetty7 is my jetty installation directory.



for compiling:

javac -cp C:\jetty7\lib\servlet-api-2.5.jar;C:\jetty7\lib\jetty-all-$J ETTY_VERSION.jar ContinuationServlet.java


i'm getting the following error:

package org.eclipse.jetty.continuation does not exist

[Updated on: Sat, 16 April 2011 09:16]

Report message to a moderator

Re: jetty continuation help! [message #665824 is a reply to message #665809] Sat, 16 April 2011 14:55 Go to previous messageGo to next message
David Wegener is currently offline David WegenerFriend
Messages: 1445
Registered: July 2009
Senior Member
On Sat, 2011-04-16 at 05:13 -0400, ravi wrote:
> hi!
> i have recently started using jetty (version 7.3.0.v20110203).
> i'm unable to compile the following servlet which uses jetty continuations.
>
> Please HELP.
> thanks,
> ravi.
>
>
> import java.lang.*;
> import java.io.*;
> import java.util.*;
> import javax.servlet.*;
> import javax.servlet.http.*;
> import org.eclipse.jetty.continuation.Continuation;
> import org.eclipse.jetty.continuation.ContinuationSupport;
>
>
>
> public class ContinuationServlet extends HttpServlet {
>
> public void service(HttpServletRequest req, HttpServletResponse res)
> throws java.io.IOException {
>
> String reqId = req.getParameter("id");
>
> Continuation cc = ContinuationSupport.getContinuation(req);
>
> res.setContentType("text/plain");
> res.getWriter().println("Request: "+reqId+"\tstart:\t"+new Date());
> res.getWriter().flush();
>
> cc.suspend(2000);
>
> res.getWriter().println("Request: "+reqId+"\tend:\t"+new Date());
> }
> }
>
> i'm able to compile HelloWorld.java but not this servlet.
> i'm using windows and C:\jetty7 is my jetty installation directory.
>
>
> for compiling:
>
> javac -cp C:\jetty7\lib\servlet-api-2.5.jar;C:\jetty7\lib\jetty-all-$J ETTY_VERSION.jar ContinuationServlet.java
>
> i'm getting the following error:
>
> package org.eclipse.jetty.continuation does not exist
>
You need to include the jetty-continuation-{version}.jar file in your
classpath.
Re: jetty continuation help! [message #665853 is a reply to message #665824] Sun, 17 April 2011 06:45 Go to previous messageGo to next message
ravi  is currently offline ravi Friend
Messages: 4
Registered: April 2011
Junior Member
hi David!
First off all thanks for your reply.I'm still unable to compile the servlet which uses jetty continuations.I'm still getting
package org.eclipse.jetty does not exist even after including the continuation file in classpath !.I have used the following code for compiling. Embarrassed Please check for any error.

javac -cp C:\jetty7\lib\servlet-api-2.5.jar;C:\jetty7\lib\jetty-contin uation-7.3.0.v20110203.jar ContinuationServlet.java


thanks in advance,
ravi.
Re: jetty continuation help! [message #665896 is a reply to message #665853] Mon, 18 April 2011 04:29 Go to previous message
David Wegener is currently offline David WegenerFriend
Messages: 1445
Registered: July 2009
Senior Member
On Sun, 2011-04-17 at 02:45 -0400, ravi wrote:
> hi David!
> First off all thanks for your reply.I'm still unable to compile the servlet which uses jetty continuations.I'm still getting
> package org.eclipse.jetty does not exist even after including the continuation file in classpath !.I have used the following code for compiling. :blush: Please check for any error.
>
> javac -cp C:\jetty7\lib\servlet-api-2.5.jar;C:\jetty7\lib\jetty-contin uation-7.3.0.v20110203.jar ContinuationServlet.java
>
>
> thanks in advance,
> ravi.
>

You need to include ALL the required jars in your class path. You
removed one that you probably need and replaced it with one you
definitely need. Check the documentation for Jetty to find out what
jars are needed to compile/run servlets that use the continuation api.
Previous Topic:Configure JTA Datasouce in Persistence.xml
Next Topic:Content assist and classes
Goto Forum:
  


Current Time: Wed Apr 24 23:24:57 GMT 2024

Powered by FUDForum. Page generated in 0.08022 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top