Tomcat

Configuring base package scan for Spring Boot Application at Runtime

狂风中的少年 提交于 2021-02-07 09:38:00
问题 I'm running a Spring Boot Application within a Tomcat instance packaged as a war file. I would like to be able to add "packages" to my instance in the form of rest services. To that end I need to be able to configure scanBasePackages in the @SpringBootApplication annotation at runtime. i.e. when tomcat starts up. For now I have ... @SpringBootApplication(scanBasePackages="path1, path2") public class RestApplication extends SpringBootServletInitializer { //code } ...but I would like to have

Jersey jdbc @resource not working

浪尽此生 提交于 2021-02-07 09:35:35
问题 I'm trying to have a simple Jersey based jaxrs listener, running on my existing tomcat 7.0.57. Tomcat has a global config in its context.xml for a jdbc datasource, which I want to use. My problem is that I can't get the resource to resolve via the @Resource annotation. Heres a simple test example @Path("/") public class TestJersey { @Resource(name = "jdbc/default") private DataSource dsA; @Resource(name = "java:comp/env/jdbc/default") private DataSource dsB; @Resource(lookup = "java:comp/env

Tomcat - How to persist a session immediately to disk using PersistentManager + FileStore

折月煮酒 提交于 2021-02-07 09:15:50
问题 I want to persist Tomcat's HttpSessions to disk so that it can be used in a scalable cloud environment. The point is that there will be a number of Tomcat nodes up (in a cloud PaaS) and clients can be directed to any of them. We want to persist and load the sessions from a shared disk unit. I have configured the PersistentManager this way: context.xml <Manager className="org.apache.catalina.session.PersistentManager"> <Store className="org.apache.catalina.session.FileStore" directory="c:

Tomcat - How to persist a session immediately to disk using PersistentManager + FileStore

时间秒杀一切 提交于 2021-02-07 09:13:54
问题 I want to persist Tomcat's HttpSessions to disk so that it can be used in a scalable cloud environment. The point is that there will be a number of Tomcat nodes up (in a cloud PaaS) and clients can be directed to any of them. We want to persist and load the sessions from a shared disk unit. I have configured the PersistentManager this way: context.xml <Manager className="org.apache.catalina.session.PersistentManager"> <Store className="org.apache.catalina.session.FileStore" directory="c:

Restore user login after tomcat 7 restart

北城以北 提交于 2021-02-07 08:27:30
问题 The default behaviour of tomcat sessions is to persist them on shutdown and restore them after startup. This works on my simple test application as expected. But when I add form based authentication the user login (User principal) won't get restored on tomcat restart. Even the example application located under /examples/jsp/security/protected/index.jsp does not restore the login. Is there any way to achieve session/authentication restoration without clustering/replication as suggested

Restore user login after tomcat 7 restart

落爺英雄遲暮 提交于 2021-02-07 08:20:07
问题 The default behaviour of tomcat sessions is to persist them on shutdown and restore them after startup. This works on my simple test application as expected. But when I add form based authentication the user login (User principal) won't get restored on tomcat restart. Even the example application located under /examples/jsp/security/protected/index.jsp does not restore the login. Is there any way to achieve session/authentication restoration without clustering/replication as suggested

Tomcat: TLSv1.2 with strong ciphers not working

核能气质少年 提交于 2021-02-07 08:19:36
问题 I installed Tomcat-7, configured support for TLSv1.2 on port 8443. My Connector configuration: protocol="org.apache.coyote.http11.Http11NioProtocol" SSLEnabled="true" scheme="https" secure="true" sslProtocol="TLSv1.2" sslEnabledProtocols="TLSv1.2" I then configured a list of strong ciphers I wanted to use. TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 As I have read, Tomcat can either

eclipse 安装教程

不羁的心 提交于 2021-02-07 07:25:38
eclipse 安装教程 一:安装包下载: 链接: https://pan.baidu.com/s/1qZtt62o 密码: 4ak2 注:若 下载链接失效,请看本文公告的QQ群,请联系群主。 二:安装教程 下一步 下一步 直至结束 三: eclipse配置: 1.jre Window——>Preferences——>Java——>Installed JREs 2.tomcat Window——>Preferences——>Server——>Runtime Environments Eclipse没有自带服务器环境,我们这里需要自己配置一下。刚才已经说了,假设你的tomcat已经下载解压了。然后在Eclipse菜单栏依次点击 Window - Preferences - Server - Runtime Environment - Add,如下图所示 然后选择对应的Tomcat版本,选择之前的Tomcat安装目录就行了。如下图所示,这里用的是Tomcat 8.0版本的服务器。选择了Tomcat目录之后下面还可以选择JRE版本,本机之前装了JDK8了。所以下拉选择一下,不用workbench自带的了。毕竟JDK8和Tomcat8更般配。哈哈哈哈。最后选择Finish。那么服务器环境就搭建好了。 3.maven Window——>Preferences——>Maven

Tomcat Server creating Directories in tmp

允我心安 提交于 2021-02-07 05:25:15
问题 Everytime my embedded virtual tomcat server is ran (spring boot) it creates a directory structure in /tmp/ that is named tomcat.##########################.8080 (I am guessing 8080 is for port or something but the 8080 is consistent). This structure does not take up much space alone but after running the tomcat server often over time this can fill up. Can I prevent this from happening as a configurable option? An example of the path created can look something like: /tmp/tomcat.1185139485157901

The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path

爱⌒轻易说出口 提交于 2021-02-07 04:19:23
新建.jsp报错:The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path 解决方案: 1.检查在eclipse中,有没有配置JDK: 2.检查在eclipse中,tomcat有没有配置好: 3.在导入的jar包上,右键Build Path——Configure Build Path...——在如下图操作 我的问题已经解决了: 来源: oschina 链接: https://my.oschina.net/u/4309500/blog/4019445