2017-02-23 157 views
0

我得到異常spring.http.multipart.maxRequestSize在春季啓動的應用程序不會被兌現

java.lang.IllegalArgumentException: Request header is too large 

每當我請求頭中JWT令牌是非常漫長的

作爲一個解決方案,我試過將下面的代碼添加到我的屬性文件中,但它沒有解決我的問題。

# Max file size. 
spring.http.multipart.maxFileSize=100Mb 
# Max request size. 
spring.http.multipart.maxRequestSize=100Mb 

這是我的依賴在我的build.gradle

compile("org.springframework.boot:spring-boot-starter-web:1.5.1.RELEASE") 
compile("org.springframework.boot:spring-boot-starter") 
compile 'org.springframework.ws:spring-ws-core:2.4.0.RELEASE' 
compile group: 'org.springframework.boot', name: 'spring-boot-starter-security', version: '1.4.2.RELEASE' 
compile group: 'io.jsonwebtoken', name: 'jjwt', version: '0.7.0' 
compile 'io.jsonwebtoken:jjwt:0.7.0' 
compile 'org.glassfish.jersey.core:jersey-common:2.22.2' 
compile group: 'javax.ws.rs', name: 'javax.ws.rs-api', version: '2.0' 
compile group: 'com.lmax', name: 'disruptor', version: '3.2.0' 
compile group: 'com.ibm.db2.jcc', name: 'jdbc-driver', version: '3.66.46' 
compile group: 'org.json', name: 'json', version: '20140107' 
testCompile('org.springframework.boot:spring-boot-starter-test') 
testCompile group: 'org.springframework.ws', name: 'spring-ws-test', version: '2.4.0.RELEASE' 

不是真的知道我的庫的版本不正確。 任何幫助,將不勝感激。

回答

2

發佈自己的問題的答案,如果它明天幫助某人。 添加到application.properties文件中

server.tomcat.max-http-header-size=10240