embedded-tomcat-8

Spring Boot Embedded Tomcat Dependency Throws Exception On Startup

这一生的挚爱 提交于 2019-12-01 04:35:38
问题 I'm porting an old application from JBoss/Wildfly to run on tomcat. Most everything I've been able to accomplish with the resources found on the web. However, I am not having much luck with the latest issue. I learned early on that I had to add providedRuntime('org.apache.tomcat.embed:tomcat-embed-jasper') as a dependency for request routing. If I don't include this dependency, I will get 404 errors when making a request. Now, this doesn't appear to have any adverse effect on my application,

Multipart file maximum size exception - spring boot embbeded tomcat

喜夏-厌秋 提交于 2019-11-30 19:25:46
I have set max file size to multipart.maxFileSize: 1mb multipart.maxRequestSize: 1mb This is my controller : @RequestMapping(method=RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.MULTIPART_FORM_DATA_VALUE) @ResponseStatus(HttpStatus.CREATED) @Secured(Privileges.CAN_USER_READ) public void create(@RequestParam("file")final MultipartFile file,Principal principal) throws IllegalStateException, IOException,MultipartException{ medicalHistoryService.create(new MedicalHistory(file)); } this is error message 2016-03-03 13:48:24.560 WARN 4992 --- [nio-8080-exec-1]

Spring Boot Stomp WebSocket

感情迁移 提交于 2019-11-30 18:23:33
问题 I seem to be running into an issue bumping up against the 8k size limit that embedded tomcat has for stomp websocket messages. When sending a message from server to client I am getting the following error. Based on the documentation I've read, it seems that tomcat has a limit of 8k for messages going across websockets, but ive also read that Stomp can send partial messages and have the client reassemble them which doesnt seem to be happening. The message is never getting to the client side

Spring MVC (Boot) does not send MIME type for certain files (WOFF, etc)

心不动则不痛 提交于 2019-11-30 07:14:05
I am writing a spring boot based application and noticed a few warnings in chrome. It complains that for example web fonts (extension woff) are send as plain/text instead of their correct mime type. I am using the regular mechanism for static files without special configuration. The sourcecode I found looks like it's not possible to add more mimetypes for the "stock" ResourceHandler. The Resourcehandler dispatches the mime type recognition to the servlet container, which is the default tomcat for spring-boot 1.2. Am I missing something? Does someone know an easy way to to enhance the resource

Multipart file maximum size exception - spring boot embbeded tomcat

我怕爱的太早我们不能终老 提交于 2019-11-30 03:41:28
问题 I have set max file size to multipart.maxFileSize: 1mb multipart.maxRequestSize: 1mb This is my controller : @RequestMapping(method=RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.MULTIPART_FORM_DATA_VALUE) @ResponseStatus(HttpStatus.CREATED) @Secured(Privileges.CAN_USER_READ) public void create(@RequestParam("file")final MultipartFile file,Principal principal) throws IllegalStateException, IOException,MultipartException{ medicalHistoryService.create(new

Spring Boot Using Embedded Tomcat with JNDI

╄→尐↘猪︶ㄣ 提交于 2019-11-29 11:42:39
I am using Spring Boot with Embedded Tomcat and attempting to use JNDI but getting the following error: javax.naming.NameNotFoundException: Name [jdbc/dataSource] Any tips would be greatly appreciated. Here is my code: @Configuration public class TomcatJndiConfiguration{ @Value("${database.driver}") private String driverClassName; @Value("${database.url}") private String databaseUrl; @Value("${database.username}") private String databaseUsername; @Value("${database.password}") private String databasePassword; @Bean public TomcatEmbeddedServletContainerFactory tomcatFactory() { return new

Spring Boot with Hazelcast and Tomcat

喜夏-厌秋 提交于 2019-11-29 04:47:58
How do you use Hazelcast as a http session store with embedded Tomcat with Spring Boot and Spring Security? I see there is a EmbeddedServletContainerCustomizer and SpringAwareWebFilter but I don't understand how to use it. Andy Wilkinson As described in Hazelcast's documentation , you need to configure Hazelcast's SpringAwareWebFilter and SessionListener . You can do so in Spring Boot by declaring a FilterRegistrationBean and a ServletListenerRegistrationBean respectively: @Bean public FilterRegistrationBean hazelcastFilter() { FilterRegistrationBean registration = new FilterRegistrationBean

Spring MVC (Boot) does not send MIME type for certain files (WOFF, etc)

岁酱吖の 提交于 2019-11-29 04:35:09
问题 I am writing a spring boot based application and noticed a few warnings in chrome. It complains that for example web fonts (extension woff) are send as plain/text instead of their correct mime type. I am using the regular mechanism for static files without special configuration. The sourcecode I found looks like it's not possible to add more mimetypes for the "stock" ResourceHandler. The Resourcehandler dispatches the mime type recognition to the servlet container, which is the default tomcat

Spring boot embedded tomcat logs

谁说我不能喝 提交于 2019-11-28 10:00:07
i'm using spring boot embedded tomcat with spring boot 1.5.9 , im also using Log4j2. recently i exerience problems during load, so i want to understand better the tomcat logs [Not the access Logs] , i tried (in application.properties) : logging.level.org.apache.tomcat: INFO logging.level.org.apache.catalina: INFO but none of the above worked. is there any other way to achieve it ? Found it !! You are now able to see the internal Logs of Embedded Tomcat in your App's Log4j log file with 3 easy steps: 1] add to your pom: <dependency> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j

Invalid character found in the request target in spring boot

邮差的信 提交于 2019-11-28 09:46:16
My application is started with java -jar with version 1.5.6.RELEASE of spring boot. The content of one of my request has the character "{".When it is sended to server the following exception is raised: java.lang.IllegalArgumentException: Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC 3986 at org.apache.coyote.http11.Http11InputBuffer.parseRequestLine(Http11InputBuffer.java:472) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:683) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at