Java SpringBoot 2.0-即使设置了正确的参数,FileSizeLimiteExceedeException也不例外
我已经在应用程序中设置了这些参数。yml:Java SpringBoot 2.0-即使设置了正确的参数,FileSizeLimiteExceedeException也不例外,java,microservices,spring-cloud,netflix-zuul,netflix-eureka,Java,Microservices,Spring Cloud,Netflix Zuul,Netflix Eureka,我已经在应用程序中设置了这些参数。yml: spring: servlet: multipart: max-file-size: -1 max-request-size: -1 当我从IDE运行它时,它工作得很好。当我尝试将它与spring cloud、netflix eureka和zuul proxy一起运行时,问题就出现了。它的行为就像没有这样的参数。它总是抛出: “超出最大上载大小;嵌套异常为java.lang.IllegalStateExceptio
spring:
servlet:
multipart:
max-file-size: -1
max-request-size: -1
当我从IDE运行它时,它工作得很好。当我尝试将它与spring cloud、netflix eureka和zuul proxy一起运行时,问题就出现了。它的行为就像没有这样的参数。它总是抛出:
“超出最大上载大小;嵌套异常为java.lang.IllegalStateException:org.apache.tomcat.util.http.fileupload.FileUploadBase$fileSizeLimitExceedeException:字段文件超出其最大允许大小1048576字节。”
我把它放在别的地方好吗
编辑:
我的bootstrap.yml
spring:
profiles: docker
application:
name: test-service
sleuth:
sampler:
probability: 1
zipkin:
base-url: http://zipkin:9411/
cloud:
config:
discovery:
enabled: true
service-id: config-server
fail-fast: true
retry:
initial-interval: 2000
max-interval: 10000
multiplier: 2
max-attempts: 10
eureka:
instance:
hostname: test-service
prefer-ip-address: true
client:
registerWithEureka: true
fetchRegistry: true
serviceUrl:
defaultZone: http://eureka-server:8761/eureka/
management:
endpoints:
web:
exposure:
include: "*"
endpoint:
health:
show-details: ALWAYS
logging:
file: ./logs/log.log
您是否也有bootstrap.yml?在我看来,不同版本的spring boot都存在类路径问题。1)检查您的spring云依赖项版本,它们可能会带来旧版本的spring boot。2) 检查您的SpringCloud版本是否与SpringBoot2兼容如果您使用maven作为构建系统,您可以使用mvn dependency:tree命令查看您的有效版本pom@Arnaud我已经用bootstrap更新了我的帖子。yml@AnilBacholaSpring boot版本为2.0.4,cloud版本为Finchley.RELEASE