tomcat6

Change Tomcat's Charset.defaultCharset in windows

梦想与她 提交于 2019-11-27 20:10:52
I'm using tomcat 6.0.32 in windows 7. Inside a very simple servlet, inside the init method, I'm printing: System.out.println(Charset.defaultCharset()); The output is: windows-1253 As far as I understand this is how tomcat start's in the JVM since I'm printing the same in standalone java class and I get "UTF8" as a response. So, how can I change this to UTF-8? thanks Just create a setenv.bat file inside the TOMCAT/bin directory with the following contents: set "JAVA_OPTS=%JAVA_OPTS% -Dfile.encoding=UTF8" You may also add this setting in the Tomcat 7.0 windows service manager. from Dr James

Using EL 2.2 with Tomcat 6.0.24

徘徊边缘 提交于 2019-11-27 19:08:05
With JSF 2 you should be able to do this: <h:commandButton action="#{myBean.myAction(myParameter)}"/> which would then call the action method, passing in the parameter (assume it's an Integer): @ManagedBean @SessionScoped public class MyBean { ... public String myAction(Integer myParameter) { // do something return null; } ... } This works on Glassfish v3 perfectly. However not on Tomcat, you get an ELException notifying of the parse error Caused by: javax.el.ELException: Error Parsing: ... Now, there's a documented way of making this work using EL 2.2 and Glassfish's implementation by

Tomcat6 can't connect to MySql (The driver has not received any packets from the server)

痞子三分冷 提交于 2019-11-27 18:33:56
问题 i'm running an Apache Tomcat 6.0.20 / MySQL 5.1.37-lubuntu / sun-java6-jdk /sun-java6-jre / sun-java6-bin on my local machine using Ubuntu 9.10 as OS. I'm trying to get a simple DB-query example running for 2 days now, but i still get this Exception: org.apache.jasper.JasperException: javax.servlet.ServletException: javax.servlet.jsp.JspException: Unable to get connection, DataSource invalid: "org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Communications

use multiple CATALINA_BASE to setup tomcat 6 instances on windows

我只是一个虾纸丫 提交于 2019-11-27 17:28:15
The RUNNING.txt that comes with tomcat distribution indicates the use of CATALINA_BASE variable to enable multiple tomcat instance. But how can I set the CATALINA_BASE environment variable for each tomcat instance directory? Having multiple Tomcat instances on your development machine is great. Here's how I usually do it for Windows (the important parts for setup are in steps 2, 3, 4 and 5): Install a copy of Tomcat 6 to a directory (like C:\apache-tomcat-6.0.20 ). Copy the conf directory to another directory (like C:\tomcat-1 ) Under C:\tomcat-1 , create a bin directory In the C:\tomcat-1\bin

CATALINA_OPTS vs JAVA_OPTS - What is the difference?

假如想象 提交于 2019-11-27 17:02:30
I was trying to find out the difference between Apache Tomcat variables - CATALINA_OPTS and JAVA_OPTS in SO and surprised to see that there is no question/answer posted here yet. So I thought of sharing it here (with answer) after finding out the difference. Check the answer/difference below. NOTE: At the time of this posting, we're running Apache Tomcat v6.0.10 with JDK 6u32 on CentOS5 64-bit arch. There are two environment variables - CATALINA_OPTS and JAVA_OPTS - which are both used in the catalina.sh startup and shutdown script for Tomcat. They are described in comments within that file as

How to deploy war files to tomcat manually?

丶灬走出姿态 提交于 2019-11-27 16:35:55
问题 I have a war at location "C:\Documents and Settings\myProj.war". The web project is also available at "C:\Documents and Settings\myProj". I want to deploy this to one tomcat. location of the tomcat is "C:\Documents and Settings\tomcat6x". Please tell me how to do this manually or through command prompt. One application is already running in Tomcat. It is a maven project. I want to deploy another application on same tomcat which is not maven application. 回答1: These are the steps I follow when

java.lang.OutOfMemoryError: PermGen space

吃可爱长大的小学妹 提交于 2019-11-27 15:04:50
问题 i'm getting the following error "http-9000-5" java.lang.OutOfMemoryError: PermGen space org.apache.catalina.core.ApplicationDispatcher invoke SEVERE: Servlet.service() for servlet jsp threw exception java.lang.OutOfMemoryError: PermGen space. My application using axis2.I increased the heap size 1024mb.But its not working.What would be the problem.Solution please 回答1: If you're using Tomcat as a Server of Eclipse, go to Server view, then double click on Tomcat, then "Open Launch Configuration"

Shutdown ExecutorService gracefully in webapp?

情到浓时终转凉″ 提交于 2019-11-27 13:33:08
In my webapp, I created a service that is using an ExecutorService with fixed size ThreadPool. I reuse the same ExecutorService during the whole application lifetime. private static ExecutorService pool = Executors.newFixedThreadPool(8); All is running in Tomcat which gives me the following error while shuting down: appears to have started a thread named [pool-1-thread-1] but has failed to stop it. This is very likely to create a memory leak. I do realize I need to shutdown the ExecutorService before shuting tomcat down. Soms SO thread already speak about this but I could not find a clean way

Tomcat, keep session when moving from HTTPS to HTTP

ⅰ亾dé卋堺 提交于 2019-11-27 13:12:49
问题 I have a Java application running on Tomcat 6.0.29, with Apache 2.2.3 in front. The login page uses HTTPS, while most pages use HTTP. If a user tries to access a page (HTTP) that is login protected, he gets redirected to the login page (HTTPS), logs in, then gets redirected back to the originally requested page. This works great, as the JSESSIONID cookie is set as non-secure, and used for both HTTP and HTTPS. However, if the user starts at the login page (HTTPS), the JSESSIONID cookie is set

Why does tomcat replace context.xml on redeploy?

坚强是说给别人听的谎言 提交于 2019-11-27 12:59:34
问题 Documentation says if you have a context file here: $CATALINA_HOME/conf/Catalina/localhost/myapp.xml it will NOT be replaced by a context file here: mywebapp.war/META-INF/context.xml It is written here: http://tomcat.apache.org/tomcat-6.0-doc/config/context.html Only if a context file does not exist for the application in the $CATALINA_BASE/conf/[enginename]/[hostname]/, in an individual file at /META-INF/context.xml inside the application files. But everytime I re-deploy the war it replaces