tomcat8

Can't access static file from Spring Boot application running in Tomcat servlet

坚强是说给别人听的谎言 提交于 2019-12-11 05:13:43
问题 All I want to do is access a specific file in a Java class. I am using Spring Boot 2.0.0.M7. When I run from my development machine using mvn spring-boot:run then everything works well. In that case I am using: File jFile = new File("src/main/resources/static/folder/fileName.txt"); When I deploy this to a Tomcat server (8.5) as a war, the file is put into: WEB-INF/classes/static/folder/fileName.txt I've tried everything I could find or think of, but always get an error of some sort, usually a

What does this messge java.net.ConnectException/Connection timed out mean in log.jtl file of Jmeter?

主宰稳场 提交于 2019-12-11 04:49:33
问题 I'd like to do a loading test with Jmeter. On google compute engine, I've creared 4 VMs, one running tomcat server, one running jmeter master and two running jmeter-server. My test plan is just a HTTP Request to the splash page(i.e. default home page, http://***.***.***.***/8080 ) of tomcat. There are 2000 users in each slave, and the plan will be executed in 5 minutes. Message on the terminal of the jmeter master are as following: Waiting for possible Shutdown/StopTestNow/Heapdump message on

java.lang.NoClassDefFoundError: Lorg/slf4j/Logger

跟風遠走 提交于 2019-12-11 04:13:28
问题 I am launching tomcat using Intellij with maven support. Once I add the following tomcat maven dependency: <!-- https://mvnrepository.com/artifact/org.apache.tomcat/tomcat-catalina --> <dependency> <groupId>org.apache.tomcat</groupId> <artifactId>tomcat-catalina</artifactId> <version>8.5.38</version> </dependency> Upon launching, it will throw this exception: Caused by: java.lang.NoClassDefFoundError: Lorg/slf4j/Logger; at java.lang.Class.getDeclaredFields0(Native Method) at java.lang.Class

How to configure setenv.sh for tomcat8?

十年热恋 提交于 2019-12-11 02:29:22
问题 How can I add custom memory parameters to tomcat8 service? I created the following file: -rwxr-xr-x 1 root root 211 Jun 13 10:51 setenv.sh Content: #! /bin/sh export CATALINA_OPTS="$CATALINA_OPTS -Xmx1024m" export CATALINA_OPTS="$CATALINA_OPTS -Xms512m" After restart: ps aux | grep java Result: I cannot see my defined memory options. Only: ... -Xmx128m But why? How can I check if or why setenv.sh is loaded correctly? 回答1: Solution: I took the wrong directory. setenv.sh must be placed here:

Tomcat8 on Ubuntu .log.gz already exists not overwritten

别来无恙 提交于 2019-12-11 02:12:29
问题 On our Tomcat servers I regularly see warnings like below: /etc/cron.daily/tomcat8: gzip: /var/log/tomcat8/app1/app1.log.gz already exists; not overwritten gzip: /var/log/tomcat8/app2/app2.log.gz already exists; not overwritten gzip: /var/log/tomcat8/app3/app3.log.gz already exists; not overwritten gzip: /var/log/tomcat8/app4/app4.log.gz already exists; not overwritten I found a similar issue as discussed in Tomcat7 logrotate: superx_default_xml.log.gz already exists however an answer was

Jsf implementation version NullPointerException when migrating from Tomcat 7 to 8

末鹿安然 提交于 2019-12-11 00:58:55
问题 I am currently using JSF 2.2.7 and Icefaces version 4.0.0. My project was running on Tomcat 7, but I am having trouble trying to get it working on Tomcat 8. I am getting a null pointer exception as a method in the icefaces code seems to check the current version of jsf being used. This always return null and i do not seem to be setting the correct implementation of jsf. The stack trace is as follows: java.lang.NullPointerException at org.icefaces.util.EnvUtils.isJSF22(EnvUtils.java:976) at

Change time zone for tomcat [duplicate]

孤者浪人 提交于 2019-12-10 21:00:48
问题 This question already has answers here : Change Timezone in Tomcat (4 answers) Closed 3 years ago . I have downloaded Tomcat 8 and copied the unzipped folder in my required path. I am using this tomcat as my server while running my web app. When I access system default time zone using java time package, actually the time zone of what I get. Is it system's clock setting? Or is it tomcat's settings. Where can I set time zone in tomcat. 回答1: Tomcat uses OS time settings. Best place is to set

Tomcat 8 giving JSP compilation error

荒凉一梦 提交于 2019-12-10 20:13:33
问题 I was using tomcat 7 and just upgraded to tomcat 8. But when I run my web application on tomcat server. It gives this error. Stacktrace:] with root cause org.apache.jasper.JasperException: Unable to compile class for JSP: An error occurred at line: [42] in the generated java file: [/home/jamil/LunaWorkspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/work/Catalina/localhost/svc/org/apache/jsp/index_jsp.java] The method getDispatcherType() is undefined for the type HttpServletRequest

Spring SseEmitter causes Cannot forward after response has been committed exception

夙愿已清 提交于 2019-12-10 18:25:17
问题 Given a simple controller with a method like this: @RequestMapping(method = RequestMethod.GET, value = "{id}/update") public ResponseEntity<SseEmitter> update() throws IOException { final SseEmitter sseEmitter = new SseEmitter(); return ResponseEntity.ok(sseEmitter); } I tried it this way also: @RequestMapping(method = RequestMethod.GET, value = "{id}/update") public SseEmitter update() throws IOException { final SseEmitter sseEmitter = new SseEmitter(); return sseEmitter; } But both way

Ignore certificate validation - Tomcat8 WebSocket (JSR-356)

落花浮王杯 提交于 2019-12-10 15:54:45
问题 SslContextFactory sec = new SslContextFactory(); sec.setValidateCerts(false); WebSocketClient client = new WebSocketClient(sec); The above code is implemented for Jetty WebSockets, to tell the java client to disable certificate validation. Is there any way I can achieve the same in Java API for Tomcat8 WebSockets (JSR-356)? PS: I have tried this method. It didn't work for Secure WebSocket connection of Tomcat WebSockets 回答1: Did you generate self signed certificate and trying to use it? Then