context.xml

Custom Tomcat Valve contained in web app WAR file

我的未来我决定 提交于 2019-12-01 04:37:26
I'm looking to implement a custom Valve and configuring it using META-INF/context.xml. At the moment though, when context.xml is parsed during deployment, Tomcat (6.0.32) dies with a ClassNotFoundException on my custom Valve implementation. I'm under the impression that I'm running into a class loading context issue and I'm not 100% sure I understand it. Is my class not found because it is located in the WEB-INF/classes file and the Context level class loader is unable to locate the class because of the hierarchy? Thanks in advance. You can not load Valve s from inside the webapp class loader.

how to setup load-time weaving with Spring and Tomcat WITHOUT using the -javaagent on the command line

依然范特西╮ 提交于 2019-12-01 04:27:07
I am using Spring 3.2.9, Tomcat 6.0.44 I am trying to configure my application's Spring instrumentation provider (e.g. spring-instrumentation.jar) for load-time weaving, when it is deployed on Tomcat. I have a requirement to NOT use: "-javaagent:/path/path/spring-instrument.jar" on the command line to do the configuration. I've read that I can configure the Spring instrumentation by modifying the <Context> element of my application's Tomcat configuration (in either Tomcat's server.xml or my web app's context.xml). Adding the appropriate <Context> element to the server.xml results in my

how to setup load-time weaving with Spring and Tomcat WITHOUT using the -javaagent on the command line

徘徊边缘 提交于 2019-12-01 02:35:06
问题 I am using Spring 3.2.9, Tomcat 6.0.44 I am trying to configure my application's Spring instrumentation provider (e.g. spring-instrumentation.jar) for load-time weaving, when it is deployed on Tomcat. I have a requirement to NOT use: "-javaagent:/path/path/spring-instrument.jar" on the command line to do the configuration. I've read that I can configure the Spring instrumentation by modifying the <Context> element of my application's Tomcat configuration (in either Tomcat's server.xml or my

Custom Tomcat Valve contained in web app WAR file

◇◆丶佛笑我妖孽 提交于 2019-12-01 02:23:33
问题 I'm looking to implement a custom Valve and configuring it using META-INF/context.xml. At the moment though, when context.xml is parsed during deployment, Tomcat (6.0.32) dies with a ClassNotFoundException on my custom Valve implementation. I'm under the impression that I'm running into a class loading context issue and I'm not 100% sure I understand it. Is my class not found because it is located in the WEB-INF/classes file and the Context level class loader is unable to locate the class

SQLNestedException: Cannot create JDBC driver

ぃ、小莉子 提交于 2019-11-30 20:06:14
用DataSource 通过JNDI取得连接问题 ,抛出如下异常: java.lang.RuntimeException: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null' 原因是:部署webapp应用方式的问题,导致tomcat启动时找不到/META-INF/context.xml文件 往tomcat部署webapp应用有很多方式: 第1种方式: 这种方式最简单,就是在$CATALINA_BASE/conf/server.xml文件里做如下配置: <Context docBase="D:\java\workspace\JspServletNote\WebContent" path="/JspServletNote" reloadable="true" /> 这种方式,就能导致 tomcat启动时找不到/META-INF/context.xml文件 解决方法就是: 把自个的WebAppProject里的 /META-INF/context.xml 的内容复制到 $CATALINA_BASE/conf/context.xml里或者 $CATALINA_BASE/conf/server.xml里 参见: http:/

How do you create “Aliases” in Apache Tomcat?

ぐ巨炮叔叔 提交于 2019-11-30 12:36:31
I am working on a web application that allows users to upload attachments. These attachments are stored on a different drive than that of the web application. How can I create an alias (equivalent to Apache HTTP server's aliases) to this drive so that users can download these attachments? Currently I am creating a context file and dumping it in CATALINA_HOME/conf/Catalina/localhost, but it gets randomly deleted every so often. The context file is named attachments.xml and the contents are shown below. I have also read about virtual hosts, but if I understand correctly, then a virtual host is

Replace spring bean in one context with mock version from another context

谁说胖子不能爱 提交于 2019-11-30 06:57:32
I'm writing an integration test where an application context xml is initialized during startup. There are several test methods in the test class which make use of a specific bean 'X'(already defined in the xml). My actual requirement is to mock bean X only for one of the test methods. Inside a test method: I tried creating a separate application context using ClassPathXMLApplicationContext with only the mock bean 'M'. Now I have two Application Contexts (AC): 1. One created during test case startup (which contains the actual bean X) and 2. One created using ClassPathXMLApplicationContext

How do you create “Aliases” in Apache Tomcat?

☆樱花仙子☆ 提交于 2019-11-29 18:11:44
问题 I am working on a web application that allows users to upload attachments. These attachments are stored on a different drive than that of the web application. How can I create an alias (equivalent to Apache HTTP server's aliases) to this drive so that users can download these attachments? Currently I am creating a context file and dumping it in CATALINA_HOME/conf/Catalina/localhost, but it gets randomly deleted every so often. The context file is named attachments.xml and the contents are

Replace spring bean in one context with mock version from another context

核能气质少年 提交于 2019-11-29 09:26:33
问题 I'm writing an integration test where an application context xml is initialized during startup. There are several test methods in the test class which make use of a specific bean 'X'(already defined in the xml). My actual requirement is to mock bean X only for one of the test methods. Inside a test method: I tried creating a separate application context using ClassPathXMLApplicationContext with only the mock bean 'M'. Now I have two Application Contexts (AC): 1. One created during test case

Which Tomcat 5 context file takes precedence?

余生长醉 提交于 2019-11-28 17:18:31
Tomcat documentation says: The locations for Context Descriptors are; $CATALINA_HOME/conf/[enginename]/[hostname]/context.xml $CATALINA_HOME/webapps/[webappname]/META-INF/context.xml On my server, I have at least 3 files floating around: 1 ...tomcat/conf/context.xml 2 ...tomcat/Catalina/localhost/myapp.xml 3 ...tomcat/webapps/myapp/META-INF/context.xml What is the order of precedence? For the files you listed, the simple answer assuming you are using all the defaults, the order is (note the conf /Catalina/localhost): ...tomcat/conf/context.xml ...tomcat/conf/Catalina/localhost/myapp.xml ..