maven


jetty-maven-plugin setting buffers sizes


Returning to jetty-maven-plugin I've trouble to set buffers size.
My use-case imply file upload (usual size is ~700Ko).
Because the upload is too big for jetty-maven-plugin default configuration I get Http response with error status code 413 (request too large)
I tryied using plugin configuration :
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>${jetty-maven.version}</version>
<configuration>
<scanIntervalSeconds>3</scanIntervalSeconds>
<connectors>
<connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
<port>8080</port>
<maxIdleTime>60000</maxIdleTime>
<requestHeaderSize>8192</requestHeaderSize>
<requestBufferSize>2097152</requestBufferSize>
</connector>
</connectors>
</configuration>
</plugin>
Then I tried to use jetty-maven-plugin with a jetty.xml file
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>${jetty-maven.version}</version>
<configuration>
<scanIntervalSeconds>3</scanIntervalSeconds>
<jettyConfig>${basedir}/src/main/config/jetty/jetty.xml</jettyConfig>
</configuration>
</plugin>
The jetty.xml is below:
<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd">
<Configure id="Server" class="org.eclipse.jetty.server.Server">
<Call name="addConnector">
<Arg>
<New class="org.eclipse.jetty.server.nio.SelectChannelConnector">
<Set name="port"><SystemProperty name="jetty.port" default="8080"/></Set>
<Set name="requestHeaderSize">8192</Set>
<Set name="requestBufferSize">2097152</Set>
</New>
</Arg>
</Call>
</Configure>
Nothing works.
Could someone hand me the correct configuration please?
I'm not sure whether this fixes the problem in your use case, but you could try adding the following to your <configuration> section of the maven-jetty-plugin:
<systemProperties>
<systemProperty>
<name>org.eclipse.jetty.server.Request.maxFormContentSize</name>
<value>-1</value> <!-- or any other value -1 is for max -->
</systemProperty>
<systemProperties>
as mentioned by jesse mcconnell the property was renamed in jetty 7/8 to org.eclipse.jetty.server.Request.maxFormContentSize.
For jetty 6 for me org.mortbay.jetty.Request.maxFormContentSize is working.
change your pom as per this and add this two xml file into your project. I hope, it will work for you.
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>9.2.11.v20150529</version>
<configuration>
<contextPath>/random-api</contextPath>
<scanIntervalSeconds>5</scanIntervalSeconds>
<jettyXml>jetty.xml,jetty-http.xml</jettyXml>
</configuration>
</plugin>
===============jetty.xml and jetty-http.xml=================
https://github.com/xwiki/xwiki-platform/blob/master/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/etc/jetty.xml
https://github.com/xwiki/xwiki-platform/blob/master/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/etc/jetty-http.xml
After a pause (lunch) I grabed the code of the web-app I was supposed to test.
There was a redundant limitation into its "internal" configuration (use an upload agent with it's own size limit).
In fact the two configuration proposed for jetty are working (now that web-app doesn't have any redundant limitation)

Related Links

Creating an external Maven packaging POM
How to Integrate BIRT Chart Engine 4.6.0 into maven project
Maven dependency plugin downloads POM instead of tar.gz
Maven get from Wrong repository
Artifactory Dependency Declaration does not match maven-metadata.xml or pom
Jenkins is not showing all executed Tests / Test Results in Build Overview
jBCrypt dependency not working
Maven not importing External Library into project after adding to .pom file in Intellij
docker-maven-plugin build assembly fail
Maven - How to override version?
Dependencies and Repositories?
DriverManager.getConnection never been executen in my maven project
Maven projects - how to read a property that is defined in the pom file of a project that is added as a dependency
Travis CI: Maven fails to get Kotlin 1.1.1 dependency on Linux
How to tell versions-maven plugin to act on non-child modules?
Can soapui maven plugin execute multiple projects parallel?

Categories

HOME
pandas
google-chrome-extension
webpack
fme
youtube-dl
bookshelf.js
google-oauth
infragistics
sharepoint-designer
twitter-bootstrap-4
disassembler
alpha
enterprise-library-5
constraint-programming
qore
add
amazon-cloudformation
zend-framework3
php-7.1
n-gram
hex-editors
vaadin7
dosgi
telephony
http-status-code-504
nhibernate-envers
rundeck
fish
user-interaction
phpfox
fifo
replaceall
subdomains
quote
nameservers
xquery-3.0
textmate
azure-sql-database
language-concepts
sequential
dosbox
lto
impersonation
webdriver-manager
gulp-sourcemaps
dynamic-reports
flashair
btrace
outlook-2013
react-scripts
mplayer
setter
diagnostics
multi-level
etsy
gridview-sorting
qcustomplot
master-slave
rhino-servicebus
tform
two-factor-authentication
lib.web.mvc
cartesian-product
python-3.2
comobject
mutation-observers
operation
web-controls
p2
key-management
pretty-print
umbraco6
npapi
qpainter
codeigniter-url
coldbox
tld
undefined-reference
concurrent-collections
easy-install
rabl
chronoforms
sqlperformance
free-variable
dmoz
hamiltonian-cycle
mt
coderush
first-responder
viewswitcher
stage
gdlib
remember-me
radcombobox
blitz++
coda-slider
.nettiers
zend-tool
sector
geneva-server

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App