Form too Large Exception

Try setting System properties via jetty.xml <Call class=”java.lang.System” name=”setProperty”> <Arg>org.mortbay.jetty.Request.maxFormContentSize</Arg> <Arg>500000</Arg> </Call> ok you can configure it from your web app Add WEB-INF/jetty-web.xml file in your web application and configure the parameter in that file: <?xml version=”1.0″?> <!DOCTYPE Configure PUBLIC “-//Mort Bay Consulting//DTD Configure//EN” “http://jetty.mortbay.org/configure.dtd”> <Configure id=”WebAppContext” class=”org.mortbay.jetty.webapp.WebAppContext”> <Set name=”maxFormContentSize” type=”int”>600000</Set> </Configure> Document Version 7 … Read more

Strange java.lang.ArrayIndexOutOfBoundsException thrown on jetty startup

For your 2 errors .. javax.servlet.ServletException: jersey-serlvet This means you have a typo in your WEB-INF/web.xml As for this one .. java.lang.ArrayIndexOutOfBoundsException: 6241 at org.objectweb.asm.ClassReader.<init>(Unknown Source) I’ve seen similar ones when using an old version of asm.jar with newer compiled Java bytecode. For Java 15 bytecode, use asm 7.3.1+ For Java 14 bytecode, use asm … Read more

Restricting IP addresses for Jetty and Solr

Solr 4.2.1 uses Jetty 8.1.8. Jetty 8 (as noted by jonas789) doesn’t support .htaccess. Instead, it uses IPAccessHandler, which doesn’t have great documentation available. I had to play with it quite a bit to get it work, so I’m posting an updated solution here. IPAccessHandler manages a blacklist and a whitelist, accepts arbitrary ranges of … Read more

Tomcat VS Jetty [closed]

I love Jetty for its low maintenance cost. It’s just unpack and it’s ready to roll. Tomcat is a bit high maintenance, requires more configuration and it’s heavier. Besides, Jetty’s continuations are very cool. EDIT: In 2013, there are reports that Tomcat has gotten easier. See comments. I haven’t verified that.

Programmatically Configure SSL for Jetty 9 embedded

The ServerConnector should be setup with an SslContextFactory. The rest of the work you are doing in the HttpConfiguration is irrelevant to setting up SSL. A good example of setting up SSL in embedded mode is maintained in the embedded jetty examples project. http://git.eclipse.org/c/jetty/org.eclipse.jetty.project.git/tree/examples/embedded/src/main/java/org/eclipse/jetty/embedded/LikeJettyXml.java Edit: to be more clear (thanks Erik) Update: June 2016 The … Read more

How to control VM arguments for maven-jetty-plugin?

The enviroment variable MAVEN_OPTS is the answer. The string content of MAVEN_OPTS is passed to JVM (java.exe). Linux: in shell type export MAVEN_OPTS=…. Windows: in shell (cmd.exe) type set MAVEN_OPTS=… For example: on Windows set MAVEN_OPTS=”-Xmx1024m” sets the heap size of the Maven process to 1024mb. Update (01.04.2013): Pass it directly to Jetty. Matthew Farwell … Read more

Debugging Scala code with simple-build-tool (sbt) and IntelliJ

There’s a very convenient -jvm-debug flag in the official SBT packages for Mac, Linux & Windows. You can use the flag to specify the debug port: sbt -jvm-debug 5005 Under the covers, this starts the JVM for SBT with the typical verbose debugging incantation: -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005 You now can run your code as normal, for … Read more

What is difference between ServletContextHandler.setResourceBase and ResourceHandler.setResourceBase when using Jetty embedded container?

With that setup, the resourceHandler will never be called, as the DefaultServlet processing (or Default404Servlet) at the end of the ServletContextHandler chain will always respond, not allowing resourceHandler to even execute. If you have a ServletContextHandler, do not use ResourceHandler use the DefaultServlet in that ServletContextHandler to setup and serve your static files. ResourceHandler is … Read more