jetty 1 « jetty « Java Enterprise Q&A

Java Enterprise Q&A
39.Web Service
Java Enterprise Q&A » jetty » jetty 1 

1. Best way of restarting a jetty instance

I'm using start.jar and stop.jar to stop and start my jetty instance. I restart by calling stop.jar, then start.jar. The problem is, if I don't sleep long enough between stop.jar and start.jar I ...

2. How to use a ThrottlingFilter for Jetty in Restlet

I would like to configure a webservice so that once the accept queue is full the service returns 503. Currently, these requests seem to just time out. I did set paramters ...

3. Use spnego credentials to access different page

I have an application that is served using jetty 6.1.12 from serverA. serverA is kerberized using the spnego filter and runs fine when I run it from the browser. I am ...

4. Application server - to use or not use?

Typically we use WebLogic or JBoss to deploy our apps. I understand that when using open source solutions like Spring you can develop your app and run it on a ...

5. Has anyone successfully deployed Sonar on Jetty 7?

I am trying to deploy Sonar (automatic code monitoring tool) on a Jetty 7 servlet container. I would like to use the default config first (embedded Derby DB) as a POC and ...

6. Running resource filters when using jetty:run

I'm using resource filtering on jsps, based on profiles. I'm also developing locally using mvn jetty:run, but the filtering phase does not run. How can I perform filtering using the jetty plugin?

7. What are "Jetty 6 Continuations" and how do they compare to the continuations found in programming languages?

I'm looking for an answer that describes a "continuataion' mechanism in a web server vs. a programming language. My understanding is that using continuations, it is trivial to have a "digits of ...

8. Jetty Hosting Providers

I am looking for a good Hosting provider for Java either running Jetty or Tomcat. I currently use PairOne/OddHost and my monthly rate is 5.99 which isn't bad, but I ...

9. Mule/Jetty Setup

I have a working Mule application that I want to setup Jetty on to respond to http requests. The following config:

<jetty:endpoint address="http://localhost:8080" 

10. Redistributing jetty

I need to redistribute my software with from Jetty site. Am I allowed to remove from this zip all unnecessary cruft (docs, samples, etc.) and than redistribute such ...

11. why does Jetty not use all allocated memory?

we develop the webapp with Grails. In productio the webapp runs on Jetty. We used JMeter to run performance-test and yourkit to analyse the memory consumtion of jetty. We started Jetty with ...

12. How to setup a self contained project running jetty+sinatra+jruby?

I already installed jruby and gems seems to be installed nicely under jruby's directory so I don't have to worry about that. Now I would like to be able create a ...

13. jetty - noSuchMethodError

I get the following error when running mvn jetty:run-war:

2009-11-14 15:19:28.459:/:INFO:  Initializing Spring root WebApplicationContext
* ERROR 15:19:28,491 Context initialization failed ( [main])
java.lang.NoSuchMethodError: org.springframework.util.ReflectionUtils.makeAccessible(Ljava/lang/reflect/Constructor;)V
(Not including the whole stacktrace) I know that there is ...

14. VisualVM breaks jetty

I'm trying to profile application that is run by "mvn jetty:run", when I connect VisualVM to it and click on Profile jetty crashes with:

Profiler Agent: Waiting for connection on port 5140 ...

15. Does jetty 6.1.8 supports jdk 1.5?

Hello i install jetty 6.1.8 on windows for development, I configure it in eclipse to run with jdk 1.5, and my project is configured to build using the same jdk. my problem is ...

16. Is Jetty guarenteed to be up after start() returns?

I am seeing a phenomenon where sometimes, connections to the port Jetty is configured on fail with connection refused, shortly after the server starts (after Server.start() returns). Is there some asynch behaviour ...

17. How scalable is Jetty?

Greetings! I wrote a highly scalable HTTP event (long-polling) server in C/C++ using libevent. However, it's messy, hardly portable, and lets face it: it's C. Let alone that I've been having ...

18. Synchronization help in Java

looking at, I don't seem to understand why there needs to be a synchronization block in a synchronized method, like so:

private synchronized void chat(HttpServletRequest request,HttpServletResponse response,String username,String message)
throws ...

19. How can i deliver jetty with many webapps via jnlp?

i have a webapp ( wich use jsf in a servlet container. This works fine with jetty-maven-plugin run-war target at my local pc. In the future i would like make more ...

20. Detect client has disconnected from jetty server (using continuations)

I am using jetty continuations and I was wondering if I can detect that the client has disconnected(closed connection to jetty server) from the server. Thanks, Alfred

21. Multiple webroot folders with Jetty

I'm using Jetty (version 6.1.22) to service a Java web application. I would like to make Jetty look in two different folders for web resources. Take this layout:

+- project1
|   ...

22. Jetty 6 - VirtualHosting

I am using Jetty 6 to host multiple web applications for various domains. I am doing the exploded WAR route, so how would I configure that in Jetty? Would ...

23. Jetty 7 Continuations: How to *not* redispatch the request?

I'm using Jetty 7 continuations to implement some asynchronous processing. What I'm trying to do is start off the continuation (via .suspend()), and then hand the continuation off to some ...

24. Jetty RewriteHandler and RewriteRegexRule

I'm trying to rewrite a URL for a servlet. The URL gets rewritten correctly, but the context doesn't match after that. Any idea how to get this to work?

RewriteHandler rewriteHandler = ...

25. Jetty offline documentation

Is there any more-or-less comprehensive documentation for Jetty (e.g., similar to Tomcat or, really, in any form)? Theirs online wikis seems to be quite informative, but servers seem to be slow. ...

26. Restrict access of web application other than localhost

I hv 3 java web-apps running in jetty and i want one of them to be accessed only through localhost. I dont want to write filter. Can it be done by ...

27. Problem with cometd and jetty 6 / 7

I'm trying to get started with cometd ( and jetty 6 or 7, but I seem to be having problems. I've got an ant script that packages my code up into ...

28. Cross site scripting help?

I have a piece of javascript executing on a jetty server which is sending a XMLHTTPRequest to a scoket on another server(wamp server). The request gets sent to the socket, however the ...

29. Jetty server handling 1 request at a time

I'm very new to Jetty and have a simple server following their HelloWorld example using a SessionHandler. My class is called OrbVend and it extends SessionHandler. I have overridden ...

30. while running mvn jetty:run showing the following error

C:\source\myproject>mvn jetty:run
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building AppFuse Spring MVC Application
[INFO]    task-segment: [jetty:run]
[INFO] ------------------------------------------------------------------------
[INFO] Preparing jetty:run
[WARNING] POM for 'xfire:xfire-jsr181-api:pom:1.0-M1:compile' is invalid.

Its dependencies (if any) will NOT be available ...

31. Confusion about maven-war-plugin and jetty-maven-plugin

I am trying to get the run-exploded goal of the jetty-maven-plugin to work correctly. I find the documentation somewhat lacking on what I need to do to set this up. I believe ...

32. Can't reach wicket quickstart from outside firewall

I have a project which, for purposes of server configuration, is just a wicket quickstart archetype. I've added some application code, but haven't really done anything to change the default jetty ...

33. Jetty Maxidletime

When does maxidletime in jetty get triggered?

34. How can I pass java system property to jetty?

How can I pass a system property to jetty startup something like -DSERVER="localhost" if it is in start.config what is the exact syntax ? and will it be available to my deployed war ...

35. Jetty JDBCSessionManager not serializable

I have a bit of a problem using the JDBCSessionManager in Jetty 7. For some reason the it tries to persist the SessionManager when persisting the SessionAuthentication : ... 16:46:02,455 WARN org.eclipse.jetty.util.log ...

36. How would node.js stack up vs jetty for an etherpad-like application?

I noticed that etherpad, when it was alive ( and living clones of it ) used Jetty. I'm considering writing a similar program but I want to use node.js instead. Could anyone ...

37. How To Start Jetty Properly

this really silly question probably, as no one else seems to be having this problem. In the Jetty documentation it says jar -jar start.jar starts Jetty, and it does. But when ...

38. Redirect non www version of domain to www in Jetty

I cannot redirect my non www domain version to www with MovedContextHandler, it does not have host to redirect to. Both and point to my web server IP. When someone ...

39. What does $1 mean in JAVA?

Here is a shell script:

echo Starting Jarvis Program D.

# Set SQL_LIB to the location of your database driver.

# These are for Jetty; you will want to change these if you are ...

40. How does one set a custom WebAppClassLoader in Jetty through config?

I am trying to configure a Jetty (6.x) WebAppContext with a custom subclass of WebAppClassLoader. In code (Scala), it's simply this:

  val context = new WebAppContext()

41. Add resources to Jetty programmatically

I have a main class that configures and fires up Jetty. (That's standard practice from Wicket for testing a webapp, but it's really not wicket-specific.)

final Server server = new Server();
//skipped socketconnector ...

42. mysterious console output to stderr from jetty?

When running my embedded jetty web app launcher, I see the following output to stderr. I just started seeing this after moving my build to maven-2. Has anyone seen ...

43. best way for Jetty to serve multiple wars hot

I have a new 64-bit Ubuntu server with 4G of memory. I need to serve several (6 now, maybe 50 later) war files as their own context roots. (Similar ...

44. Jetty - set system property

I run webapp on Jetty. The configuration for the app come from file that lives on the same server where Jetty is running. Inside the app I rely on the system ...

45. Jetty nonblocking by default?

Please tell me, Is Jetty non-blocking web server by default or not? For example, this code below runs Jetty as non-blocking web server?

Server server = new Server(8080);

ServletContextHandler context = new ServletContextHandler(ServletContextHandler.SESSIONS);



context.addServlet(new ServletHolder(new ...

46. Webapp startup fails but Jetty LifeCycle claims "started"

I'm using embedded Jetty to launch a standard Java webapp. My launcher is something like this:

import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.util.component.LifeCycle.Listener;
import org.eclipse.jetty.webapp.WebAppContext;


Listener listener = ...;
Server server = new Server(8080);
WebAppContext webapp = new WebAppContext();

This ...

47. ricfaces xhtml edit problem for jetty

I am using Richfaces with facelets (xhtml). I use maven jetty plugin for development. When jetty is running, I modify a xhtml file but the change does not work until I restart ...

48. maven-jetty-plugin question

I need to start jetty before module tests. Example:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns=""

49. maximum bufferHeaderSize for Jetty

Is there a limit for bufferHeaderSize for Jetty? Thanks...

50. How do I configuration to use "rewrite" by jetty-maven-plugin

When I use jetty7 by command line, do "$ java -jar start.jar OPTIONS=default,rewrite etc/jetty-rewrite.xml" to use "rewrite"(org.eclipse.jetty.rewrite.handler.RewriteHandler). But jetty-maven-plugin and eclipse and m2eclipse can't use "OPTIONS=default,rewrite" by "jetty:run" And "ClassNotFoundException : org.eclipse.jetty.rewrite.handler.RewriteHandler" occurs ...

51. how can i find the temporary folder that Jetty host the web app?

I deployed gwt app to Jetty using maven-jetty-plugin, with 'mvn jetty:run' i have access my app, but it kept telling one file is not found, i need to know where Jetty ...

52. jetty start problem

when i start jetty server in eclipse (jetty-wtp plugin) the console output the problem? Caused by: java.lang.NoClassDefFoundError: javax/transaction/UserTransaction my installed environment is under

  1. JDK 1.6.0
  2. jetty ...

53. Behaviour explanation

Can someone explain why this code halts at startFileHTTP()? The jetty server starts but the rest of the program doesn't work. Do i need to look into multi-threaded programming? ...

54. Scheduled tasks in Jetty

I would like to write a simple Groovlet which runs a task periodically and am using a Jetty container. What's the easiest way to accomplish this task? I'm thinking that Quartz ...

55. RFC 1123 date representation with Jetty

We're using jetty as front end http server, with cache policies. I would like to be clear on the requirements:

  1. Is the quoted below required?
  2. How should I implement this in Java?

56. CruiseControl: Does not start - how to determine reason?

CruiseControl does not start any more (only known change was adding new memory to the machine.) Ok, it seems to start: Calling the web gui brings:

HTTP ERROR: 404    

57. Jetty + intellij idea :: add library

I get java.lang.NoClassDefFoundError when I add 3d party library to my project. I've tried add libraries to web-inf/module dependencies/server libs, but it doesn't work. What the right way to add ...

58. How to use jetty continuations with a Filter and FORWARD dispatching?

I have a servlet Filter that acts as the basis of my web stack. In my web.xml I have specified that I want the filter to also act as a FORWARD ...

59. Problem with publishing using Jetty

I am having trouble publishing to the channel subscribed by two users. It seems that whenever I am publishing a msg, it is sending it 3 times (sometimes twice) to both ...

60. How to set authorization when using cruise control

I am setting cruise control properties in the Ubuntu Linux environment. I have tested by using this address 'http://localhost:8080/dashboard/' This address works fine. However, this can be accessed by anyone if localhost is ...

61. Trouble in starting my jetty server on a remote server

I have started a jetty server in my remote server. But I got problem accessing the default page. I followed the getting started steps and used the command java -jar start.jar ...

62. Jetty server stops running after closing terminal window

I am a newbie when it comes to Java and Jetty app deployment. I use the default settings for setting up my jetty serve and ran java -jar start.jar on my ...

63. Jetty UserRealm redirect on 3th failed login

If I have a custom Jetty UserRealm implementation and its configured for basic authentication (with SSL), is there any way to get it to go to an specific page after the ...

64. Jetty config to redirect all 404s to home page

Google has cached some old URLs to pages that no longer exist on a site. I'd like to redirect any 404 pages to the home page. I have a jetty installation with ...

65. how to set connection/request timeout for jetty sever?

I'm running an embedded jetty sever (jetty 6.1.24) inside my application like this:

    Handler handler=new AbstractHandler()

66. Autologin during development with Jetty

I have the usual setup: A webapp with a login screen and a small Java class which sets up Jetty to launch the app. During development, we all waste a couple of ...

67. Jetty does not recognize internationalized (IDN) SUB domain names

The international form of my sub domain name is like this: XN--80AHAIUUGL4G It is properly setup in my provider and resolves. That is tested. My top-level domain name is so I wrote ...

68. Programmatic Jetty shutdown

How to programmatically shutdown embedded jetty server? I start jetty server like this:

Server server = new Server(8090);
Now, I want to shut it down from a request, such as How ...

69. -XX:OnOutOfMemoryError="kill -9 %p" Problem

I have an issue with trying to pass the -XX:OnOutOfMemoryError="kill -9 %p" command into my jvm args. I am using Jetty7, and have this within the start.ini file. On start up ...

70. How do you run CruiseControl on MacOSX

What am I doing wrong?

  1. Download Cruise Control
  2. Unzip it -- Now it's in ~/Downloads/cruisecontrol-bin-2.8.4
  3. Run ./
I see the server spinning up. The service binds to port 8080. ...

71. Cleaning up Jetty - Removing 'unnecessaries' things

I'm used to use Jetty as my web container. What I did on my install steps is get the original tar ball and cleanup some directories and files from ...

72. jetty 7 continuations

i'm using jetty-7.4.1.v20110513 and servlet-api-2.5 i tried to use continations in the following servlet.

 import java.util.*;
 import javax.servlet.ServletException;
 import javax.servlet.http.HttpServlet;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;

 import org.eclipse.jetty.continuation.*;

public class cs extends HttpServlet ...

73. How do you scale an application server that has daemon tasks?

I have a web application that runs on one server right now. I'd like to switch to a cluster of application servers (jetty), to handle increased load and failover. However, the ...

74. How to run Jetty on IKVM?

I am new in jetty. I am trying to run Jetty with IKVM. However, it throws exception. I am not sure what should I do.

alex@AlexUbuntu:/usr/share/jetty$ ikvm -jar start.jar
5 [main] INFO org.mortbay.log ...

75. Trouble with running JSFUnit 2.0Beta1 & Jetty

Hi all i trying to integrate JSFUnit 2.0.0 "Getting Started" Example
 on Jetty in maven environment.

soucre available in Below URL:

i am able to execute this sample on JBossAs6, but facing problems ...

76. why won't jetty 6.1.x run with java 1.4.2?

Dcoumentation everywhere I can find suggests that jetty 6.1.x should still run with java 1.4.2. Yet, if I download a jetty binary, and "java -jar start.jar", I get variations of: "Exception in ...

77. Jetty QueuedThreadPool property tutorial

I can't find a page that explain how QueuedThreadPool works and what are the meaning of it's set-methods ( like setLowThreads() ). Can you post a link, or answer with a ...

78. doGet called twice jetty server

i am using an embedded jetty server within the java application. But the doGet() method is being called twice. Also it is being called as a result of this (method.equals(METHOD_GET)) condition ...

79. Jetty's DispatcherType (and 1000 other undocumented things)

Can someone tell me, what DispatcherType is doing? Seems to be an important configuration. Class usage didn't helped me as well by pointing to things such as ServletContextHandler#addFilter, which ...

80. Error while starting the application using jetty

I used the maven plugin "wagon-maven-plugin" to create a single jar which contains the war file and jar files. When i try to do "java -jar myApp.jar" I get the following error ...

81. How can I get the NCSARequestLog to roll over hourly?

Jetty provides the NCSARequestLog ( to log the requests. But this seems to rollover on a daily basis by default. Is there an option to have this rollover on an hourly ...

82. Jetty distribution vs hightide

What exactly is the difference? I've been using Jetty 8.0.0 lately and when I try the distribution download I cannot get neither WebSockets nor Servlet 3.0 @WebServlet annotation to work. If ...

83. Jetty 7: OutOfMemoryError: PermGen space on application redeploy

First time app starts correctly. Then I delete webapp/*.war file and paste new version of *.war. Jetty start deploying new war but error java.lang.OutOfMemoryError: PermGen space occurs. How can I configure ...

84. Bind Jetty to IPv6 address

I am trying to bind Jetty to listen only to IPv6 address. I am using Jetty 7.4.2.v20110526. my jetty.xml:

<Call name="addConnector">
      <New class="org.eclipse.jetty.server.nio.SelectChannelConnector">

85. Can I respond to POST requests using Jetty's ResourceHandler?

Can I respond to POST requests using Jetty's ResourceHandler? If so, how? For context, here's snippet configuring a file server using ResourceHandler from the Jetty tutorials:

public class FileServer

86. My Jetty server will dead after a long time, why?

Recently, I host a website in Amazon EC2, and I use Jetty 7.4 as my server. I test it in my machine and EC2, and it works properly. But after a ...

87. The behavior of Jetty DefaultHandlers

I've obverved for some time that our RequestLogHandler has been called out of order -- requests are written to the log before they are executed, so information like bytes returned or ...

88. Jetty RESTful with multiple data formats

I am a newbie in this area, I am using embedded jetty to create web services and I have few existing methods/pojos which I need to make as RESTful API's and ...

89. How to use setThreadPool() in Jetty

I wanted to see how to use the setThreadPool() functionality. Let's say my main class is the following:

import javax.servlet.SingleThreadModel;
import org.eclipse.jetty.server.Server;

public class FServer implements SingleThreadModel {

    public static void ...

90. Jetty 8 does not pick up non standard taglibs

Working with Jetty is supposed to be dead simple, but somehow I managed to screw it up. When deploying PetClinic (springs official sample app) on Jetty 8 (jetty-8.0.1.v20110908 "hightide") I ...

91. Passing java options to

Normally, I'll start jetty (version 8) using this:

 java -jar -Xms1024m -Xmx1024m -server -XX:+UseConcMarkSweepGC start.jar
But now I'm using to run jetty on startup.
Does anyone know how can I pass the ...

92. Auto run Jetty on boot

I'm trying to get Jetty to auto start on my Ubuntu. I've done these commands:

 cp /opt/jetty/bin/ /etc/init.d
 update-rc.d defaults
but when I run it I got a "Not starting jetty - ...

93. How Jetty 7 handles SSO?

Hi Geeks, I am working on ...

94. JProfiler startup error of Jetty application can't find

I am trying to perform a remote profile session of Jetty. I have downloaded, untar'd jprofiler_linux_7_0.tar.gz I ran jpintegrate and produced the Looked into that and snipped out the: -agentpath:/RAID10/home/mbl/profiler/jprofiler7/bin/linux-x86/,nowait and added that to my ...

95. Run JavaExec task in background and then terminate when build completes

I'm trying to figure out how to launch a JavaExec task that spawns a Jetty server without blocking subsequent tasks. Also, I will need to terminate this server after the ...

96. How to configure jetty bundle on virgo

My rap projects runs on an equinox jetty server. The bundles are started and I'm able to connect to it by going to localhost. Now I want to configure the equinox ...

97. Performance: vs. jetty

i'm working on a java web application which will sends and receives JSON strings. The JSON is generated through jersey and maps to a jaxb anotated pojo.
The application itself isn't very ...

98. Get jetty realm credentials in application

It might be a stupid question but we are using jetty basic authentication on our server. Now we want to use the usercredentials in our application. Is it possible to get ...

99. Forcing Jetty to load classes in the parent ClassLoader

I launch a JVM from native code, then launch Jetty. A webapp then loads a library called JPeripheral. Both the native launcher and JPeripheral depend a native library called Jace. When ...

100. Cobertura report has 100% coverage anywhere

I'm running my webApp using Jetty with my instrumented classes. After the shutdown of Jetty i'm taking the generated .set file and creating a cobertura report using the command line tool. I always ...  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.