catalina

apache tomcat catalina as maven dependency for CORS filter

南笙酒味 提交于 2019-12-12 08:27:04
问题 I'm using org.apache.catalina.filters.CorsFilter in my webapp. So I specify the maven dependency <dependency> <groupId>org.apache.tomcat</groupId> <artifactId>tomcat-catalina</artifactId> <version>7.0.50</version> </dependency> Now, If I say the scope is "provide" or "runtime" the server doesn't start, because of java.lang.ClassNotFoundException: org.apache.catalina.filters.CorsFilter This class is not available in the catalina jar from jbossews/lib which is 7.0.40 Is it easy to "upgrade"

java:comp/env is not bound

天涯浪子 提交于 2019-12-11 12:38:15
问题 I currently have a few libraries in my $CATALINA_HOME/lib directory to handle some system/DB authentication. One of those files foo.jar contains a class that extends org.apache.catalina.realm.DataSourceRealm and is being used to authentication. This file needs to access a few properties that I'm storing in server.xml However, when attempting to access it I'm getting an error. The segment of code is as follows try{ Context ctx = new InitialContext(); Context envCtx = (Context)ctx.lookup("java

Having a custom catalina.sh when using a tomcat image from Docker

不问归期 提交于 2019-12-11 12:22:52
问题 I'm currently using Dockerfile to create Tomcat 6.0.44. It looks like this: FROM tomcat:6.0.44-jre7 ... ADD catalina.sh /usr/local/tomcat/bin Building the image from the Dockerfile is fine, but when I go to run it I get the following error: exec: "catalina.sh": executable file not found in $PATH. Any idea of how to fix this? What I'm trying to do is pass in this parameter -DentityExpansionLimit=100000 . Is there an easier way of doing it than in the catalina.sh ? Any help/suggestions would be

How to correct JAVA_HOME which should point to a JDK not a JRE folder? [duplicate]

我们两清 提交于 2019-12-10 18:33:25
问题 This question already has answers here : JAVA_HOME should point to a JDK not a JRE (19 answers) Closed last year . I'm trying to run Catalina on Ubuntu Linux using the debug command. I'm getting the following error: JAVA_HOME should point to a JDK in order to run in debug mode. /bin/sh died with exit status 1 However, I have tried setting JAVA_HOME in the .bashrc to all of the following: export JAVA_HOME="/usr/lib/jvm/java-1.7.0-openjdk-i386/" export JAVA_HOME="/usr/lib/jvm/java-1.7.0-openjdk

Getting tomcat's installation directory using java

╄→гoц情女王★ 提交于 2019-12-08 01:58:35
I want to get tomcat's installation directory in my computer using java. I tried using : System.getProperty("catalina.base"); and System.getProperty("catalina.home"); But both methods return null as the answer. I tried it with System.getProperty("java.home"); and it correctly returns the java path. Any ideas as to what the problem is? Thanks Try installing this JSP and passing various values for the "property" parameter: <% String propertyName = request.getParameter("property"); Object propertyValue; String typeString; if(null == propertyName) propertyValue = null; else propertyValue = System

Log4j daily rolling catalina.out without restarting Tomcat?

爱⌒轻易说出口 提交于 2019-12-07 20:13:09
问题 i am having trouble with configuring Log4j correctly. I was expecting Log4j to rotate my catalina.out file at midnight when configuring it like the following.. log4j.properties: log4j.rootLogger=INFO, CATALINA # Define all the appenders log4j.appender.CATALINA=org.apache.log4j.DailyRollingFileAppender log4j.appender.CATALINA.File=/var/log/tomcat7/catalina.out log4j.appender.CATALINA.Append=true log4j.appender.CATALINA.Encoding=UTF-8 # Roll-over the log once per day log4j.appender.CATALINA

Spring Boot “Request method 'GET' not supported” while redirecting POST request to https port through Catalina Connector

徘徊边缘 提交于 2019-12-07 07:05:16
问题 I'm trying to redirect http to https through Catalina Connector in my Spring Boot application. If the incoming POST request is "https" then it is working as expected. But if my incoming POST request is "http" and after the redirection to "https" through below code, somewhere it is getting changed to GET because of which I'm getting - WARN 45028 --- [nio-8443-exec-8] o.s.web.servlet.PageNotFound : Request method 'GET' not supported Below are the methods in my @SpringBootApplication class:

Starting Tomcat Failed to initialize end point associated with ProtocolHandler

妖精的绣舞 提交于 2019-12-06 23:15:38
问题 I'm trying to start a tomcat instance(the only tomcat I have), and I'm getting some weird problems, I know that this error: Failed to initialize end point associated with ProtocolHandler is because some other application is using the same port, but if I change the port in the server.xml and run the startup.bat again I get the same error but now pointing to the new port, every time y change it I get the same error, also I check for other apps listening the same port using the command netstat

Log4j daily rolling catalina.out without restarting Tomcat?

房东的猫 提交于 2019-12-06 13:34:18
i am having trouble with configuring Log4j correctly. I was expecting Log4j to rotate my catalina.out file at midnight when configuring it like the following.. log4j.properties: log4j.rootLogger=INFO, CATALINA # Define all the appenders log4j.appender.CATALINA=org.apache.log4j.DailyRollingFileAppender log4j.appender.CATALINA.File=/var/log/tomcat7/catalina.out log4j.appender.CATALINA.Append=true log4j.appender.CATALINA.Encoding=UTF-8 # Roll-over the log once per day log4j.appender.CATALINA.DatePattern='.'yyyy-MM-dd-HH-mm'.log' log4j.appender.CATALINA.layout = org.apache.log4j.PatternLayout

Spring Boot “Request method 'GET' not supported” while redirecting POST request to https port through Catalina Connector

寵の児 提交于 2019-12-05 12:27:35
I'm trying to redirect http to https through Catalina Connector in my Spring Boot application. If the incoming POST request is "https" then it is working as expected. But if my incoming POST request is "http" and after the redirection to "https" through below code, somewhere it is getting changed to GET because of which I'm getting - WARN 45028 --- [nio-8443-exec-8] o.s.web.servlet.PageNotFound : Request method 'GET' not supported Below are the methods in my @SpringBootApplication class: @Bean public EmbeddedServletContainerFactory servletContainer() { TomcatEmbeddedServletContainerFactory