context.xml

Java - Tomcat: Reload context.xml without restarting server

泪湿孤枕 提交于 2021-02-11 15:19:28
问题 I'm using spring mvc and tomcat as a server. I want to be able to change a jndi field that is Autowired(as String): <jee:jndi-lookup id="someMessage" jndi-name="someMessage"/> in one of the my services, that is referenced to conf/context.xml of Tomcat, that looks something like this: <Environment name="someMessage" value="Change this." type="java.lang.String" />. However, when I change the value on context.xml, this change is not reflected on my service managed by spring, unless I restart

Spring MVC, Spring Security and Hibernate cannot autowire properties between contexts

南楼画角 提交于 2020-01-07 08:19:11
问题 I am using Spring MVC 3.0.6 and Spring security 3.0.7. I cannot @Autowire the RoleDao class to my user class when in the security context. my web.xml file: <context-param> <param-name>contextConfigLocation</param-name> <param-value> /WEB-INF/spring/root-context.xml /WEB-INF/security-app-context.xml </param-value> </context-param> <!-- Creates the Spring Container shared by all Servlets and Filters --> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener

Spring MVC, Spring Security and Hibernate cannot autowire properties between contexts

孤人 提交于 2020-01-07 08:19:08
问题 I am using Spring MVC 3.0.6 and Spring security 3.0.7. I cannot @Autowire the RoleDao class to my user class when in the security context. my web.xml file: <context-param> <param-name>contextConfigLocation</param-name> <param-value> /WEB-INF/spring/root-context.xml /WEB-INF/security-app-context.xml </param-value> </context-param> <!-- Creates the Spring Container shared by all Servlets and Filters --> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener

Tomcat 8 - context.xml use Environment Variable in Datasource

て烟熏妆下的殇ゞ 提交于 2019-12-31 11:42:21
问题 I have a Tomcat 8 project that uses a datasource (see below) <Resource auth="Container" name="jdbc/JtmDS" driverClassName="org.apache.derby.jdbc.EmbeddedDriver" type="javax.sql.DataSource" username="xfer" password="xfer10" url="jdbc:derby:/home/PUID/tm/control/JtmDB" initialSize="25" maxTotal="100" maxIdle="30" maxWaitMillis="10000" removeAbandonedOnBorrow="true" removeAbandonedTimeout="20" /> This works perfectly well. However the url is a hard-coded path /home/PUID/tm/control/JtmDB When

Tomcat 8 - context.xml use Environment Variable in Datasource

纵然是瞬间 提交于 2019-12-31 11:40:16
问题 I have a Tomcat 8 project that uses a datasource (see below) <Resource auth="Container" name="jdbc/JtmDS" driverClassName="org.apache.derby.jdbc.EmbeddedDriver" type="javax.sql.DataSource" username="xfer" password="xfer10" url="jdbc:derby:/home/PUID/tm/control/JtmDB" initialSize="25" maxTotal="100" maxIdle="30" maxWaitMillis="10000" removeAbandonedOnBorrow="true" removeAbandonedTimeout="20" /> This works perfectly well. However the url is a hard-coded path /home/PUID/tm/control/JtmDB When

HTTP Status 404 after deploying a web application with a custom realm to Tomcat 6

耗尽温柔 提交于 2019-12-24 12:12:32
问题 I develop a web application for Tomcat 6, and I'm face to face with a problem I don't know how to resolve. Let's consider the following small scenario. Imagine that it's required to authenticate users not just by user and password, the authentication is only granted if some extra conditions are true (e.g. user, password, and his IP address matches). As far I understood, Tomcat introduced the concept of realms. A simple JDBCRealm was enough for the application, because the user and password

tomcat does not pick the context.xml, it is getting coopied to CATALINA_HOME> conf>Catalina>localhost though

好久不见. 提交于 2019-12-24 11:26:48
问题 My context.xml (in META_INF) folder looks like this: <?xml version="1.0" encoding="UTF-8"?> <Context path="MY_CONTEXT_NAME" docBase="${catalina.home}/webapps/MY_APP_NAME" debug="0" privileged="true"> </Context> The problem is, context.xml is getting copied to the CATALINA_HOME> conf>Catalina>localhost folder when I deploy my application war via tomcat manager. However, it is somehow still deploying from default context, that is , app_war_name. Earlier, it was not even getting copied to

Understanding context.xml in tomcat 6

泪湿孤枕 提交于 2019-12-21 01:20:48
问题 I created a mainly empty dynamic web project in eclipse. It has no servlets no jsp files The web.xml is <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5"> <display-name>testprojekt</display-name> <welcome

How to get resource from the context.xml file in tomcat webapp?

烂漫一生 提交于 2019-12-20 09:05:05
问题 This is my context.xml file: ... <Resource auth="Container" driverClass="net.sourceforge.jtds.jdbc.Driver" type="com.jolbox.bonecp.BoneCPDataSource" idleMaxAge="240" idleConnectionTestPeriod="60" partitionCount="3" acquireIncrement="1" maxConnectionsPerPartition="10" minConnectionsPerPartition="3" statementsCacheSize="50" releaseHelperThreads="4" name="jdbc/MyDatasource" username="my_username" password="my_password" factory="org.apache.naming.factory.BeanFactory" jdbcUrl="jdbc:jtds:sqlserver:

Tomcat: Custom form authenicator in a web application, not as a stand-alone JAR module. Possible?

两盒软妹~` 提交于 2019-12-20 04:34:51
问题 Our web application requires custom form authentication with specific logic inside. The current form authenticator implementation requires the authenticator module, let's call it custom.auth.jar , to be present in %CATALINA_HOME%/lib before the web application starts. The web application uses that custom authenticator module using the following context.xml directive: <Valve className="foo.bar.CustomAuth" characterEncoding="UTF-8"/> As far as I understand Tomcat requirements, this module,