[Tomcat Wiki] Update of "HowTo" by KonstantinKolinko

2015-12-09 Thread Apache Wiki
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Tomcat Wiki" for change 
notification.

The "HowTo" page has been changed by KonstantinKolinko:
https://wiki.apache.org/tomcat/HowTo?action=diff=143=144

Comment:
Update options for obtaining a thread dump. Add StuckThreadDetectionValve.

  
  If you cannot use any of the above methods, it is also possible to obtain a 
thread dump programmatically, with a Servlet or JSP page that runs within 
Tomcat. For example, you can use `java.lang.Thread.getAllStackTraces()` method.
  
- Tomcat Manager web application in Tomcat 8 and later supports a command that 
outputs a thread dump.
+ Tomcat Manager web application starting with Tomcat 7.0.58 / 8.0.0 supports a 
command that outputs a thread dump.
- ([[https://issues.apache.org/bugzilla/show_bug.cgi?id=57261|Not yet 
documented]])
+ 
([[http://tomcat.apache.org/tomcat-8.0-doc/manager-howto.html#Thread_Dump|Tomcat
 8 documentation]], 
[[https://issues.apache.org/bugzilla/show_bug.cgi?id=57261|BZ 57261]])
  
+ `StuckThreadDetectionValve` valve logs stacktraces of request processing 
threads that are busy for longer than configured time limit. It is available 
starting with Tomcat 6.0.36 / 7.0.14. 
([[http://tomcat.apache.org/tomcat-8.0-doc/config/valve.html#Stuck_Thread_Detection_Valve|Tomcat
 8 documentation]])
+ 
+ 
  
  == How do I read a Java thread dump ? ==
  Java thread dumps are just text files, so you can read them with any text 
editor. There are some tools that can make your life easier, especially if you 
need to look at more than one thread dump at once.

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Tomcat Wiki] Update of HowTo by KonstantinKolinko

2014-11-29 Thread Apache Wiki
Dear Wiki user,

You have subscribed to a wiki page or wiki category on Tomcat Wiki for change 
notification.

The HowTo page has been changed by KonstantinKolinko:
https://wiki.apache.org/tomcat/HowTo?action=diffrev1=137rev2=138

Comment:
Simplify section on using jstack tool. Add link to JDK documentation.

  
  Getting a thread dump depends a lot on your environment. Please choose the 
section below that matches your environment best. The more universal and 
convenient options are presented first, while the more difficult ones or those 
for specific setups are provided later. Generally, you should start at the top 
of the list and work your way down until you find a technique that works for 
you.
  
- === If you are running Sun JDK 1.6 or higher ===
+ === If you are running Oracle (Sun) JDK ===
- Sun's JDK (not the JRE) ships with a program called ''jstack'' (or 
''jstack.exe'' on Microsoft Windows) which will give you a thread dump on 
standard output. Pipe the output into a file and you have your thread dump. You 
will need the process id (pid) of the process to dump. Use of the program 
''jps'' (''jps.exe'' on Microsoft Windows) can help you determine the pid of a 
specific Java process.
+ Oracle JDK (not the JRE) (formerly Sun JDK) since version 1.6 (and since 1.4 
on *nix systems) ships with a program called ''jstack'' (or ''jstack.exe'' on 
Microsoft Windows) which will give you a thread dump on standard output. Pipe 
the output into a file and you have your thread dump. You will need the process 
id (pid) of the process to dump. Use of the program ''jps'' (''jps.exe'' on 
Microsoft Windows) can help you determine the pid of a specific Java process.
  
+ See [[http://docs.oracle.com/javase/8/docs/technotes/tools/|Tools page]] in 
JDK documentation for usage reference.
- === If you are on *NIX running Sun JDK ===
- Sun provides ''jstack'' on *nix systems from version 1.4 onward. See the 
above tip if you have such an environnment.
  
  === If you are running on *NIX ===
  Send a SIGQUIT to the process. The thread dump will be sent to stdout which 
is likely to be redirected to CATALINA_BASE/logs/catalina.out.

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Tomcat Wiki] Update of HowTo by KonstantinKolinko

2014-11-29 Thread Apache Wiki
Dear Wiki user,

You have subscribed to a wiki page or wiki category on Tomcat Wiki for change 
notification.

The HowTo page has been changed by KonstantinKolinko:
https://wiki.apache.org/tomcat/HowTo?action=diffrev1=138rev2=139

Comment:
Rewrite section on using Thread Dump command in Windows service monitoring 
application.

  You can try to use SendSignal, developed specifically for this purpose. Make 
sure you read the comments for certain sitautions (e.g. running as a service, 
RDP connections, etc.). 
http://www.latenighthacking.com/projects/2003/sendSignal/
  
  === If you are running Tomcat as a service on Microsoft Windows ===
- Edit your service to add the //MS// option to the command line. This 
enabled the Monitor Service which puts an icon in the system tray while 
Tomcat is running. Right-clicking the Tomcat monitor in the system tray allows 
you to produce a thread dump in stdout.
+ Tomcat service has a monitoring application with it. When it is running it 
puts an icon in the Windows system tray area. Right-click the icon, a menu will 
appear. Select Thread Dump command from the menu. It will cause thread dump 
to be printed to stdout. The service captures stdout into a log file 
(`logs/tomcat`''NN''`-stdout.`''DATE''`.log`).
+ 
+ If the monitoring application is not running, you can start it manually. The 
command is
+ 
+  `Tomcat8w.exe //MS//`
+ 
+ or
+ 
+  `Tomcat8w.exe //MS//servicename`
+ 
+ If you installed Tomcat with an exe installer, Apache Tomcat ''version'' 
''servicename'' group in the Windows menu has shortcut Monitor Tomcat that 
starts the monitoring application.
+ 
+ For details, see 
[[http://tomcat.apache.org/tomcat-8.0-doc/windows-service-howto.html|Windows 
service page]] in Tomcat documentation.
  
  === If you have Tomcat running in a console ===
  *NIX: Press CRTL-\ Microsoft Windows: press CRTL-BREAK

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Tomcat Wiki] Update of HowTo by KonstantinKolinko

2014-11-29 Thread Apache Wiki
Dear Wiki user,

You have subscribed to a wiki page or wiki category on Tomcat Wiki for change 
notification.

The HowTo page has been changed by KonstantinKolinko:
https://wiki.apache.org/tomcat/HowTo?action=diffrev1=139rev2=140

Comment:
Note that threaddump can be obtained programmatically and via Manager webapp.

  
  This will produce a thread dump on standard output, but may not be possible 
to capture to a file.
  
+ === Using Java code ===
+ 
+ If you cannot use any of the above methods, it is also possible to obtain a 
thread dump programmatically, with a Servlet or JSP page that runs within 
Tomcat. For example, you can use `java.lang.Thread.getAllStackTraces()` method.
+ 
+ Tomcat Manager web application in Tomcat 8 and later supports a command that 
outputs a thread dump.
+ ([[https://issues.apache.org/bugzilla/show_bug.cgi?id=57261|Not yet 
documented]])
+ 
+ 
  == How do I read a Java thread dump ? ==
  Java thread dumps are just text files, so you can read them with any text 
editor. There are some tools that can make your life easier, especially if you 
need to look at more than one thread dump at once.
  

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Tomcat Wiki] Update of HowTo by KonstantinKolinko

2013-03-29 Thread Apache Wiki
Dear Wiki user,

You have subscribed to a wiki page or wiki category on Tomcat Wiki for change 
notification.

The HowTo page has been changed by KonstantinKolinko:
http://wiki.apache.org/tomcat/HowTo?action=diffrev1=134rev2=135

Comment:
Remove wrong part of r101(How do I add my own custom MBean...). Someone 
confuses JVM API (calls it Tomcat's one) and uses wrong arguments.

  == How do I obtain a heap dump? ==
  See 
[[http://wiki.eclipse.org/index.php/MemoryAnalyzer#Getting_a_Heap_Dump|Getting 
a Heap Dump]] on the help pages of [[http://eclipse.org/mat/|Eclipse Memory 
Analysis Tool]].
  
- == How do I add my own custom MBean to monitor my application within Tomcat 
5/6? ==
+ == How do I add my own custom MBean to monitor my application within Tomcat 
6? ==
  First of all, you can read [[http://oss.wxnet.org/mbeans.html|this great 
tutorial]] from Christopher Blunck ( ch...@wxnet.org ). I will just add my 
comments and improvements.
  
- 1. Start your Tomcat and check that you have access to 
http://localhost:8080/manager/jmxproxy/. It means that JMX is enabled on your 
Tomcat configuration (if not, check if the following line is in your 
/conf/server.xml file :   `Listener 
className=org.apache.catalina.mbeans.ServerLifecycleListener /`. Otherwise, 
check the Tomcat documentation to activate it). Let this page opened to check 
further if your custom Mbean is detected by Tomcat.BR
+ 1. Start your Tomcat and check that you have access to 
http://localhost:8080/manager/jmxproxy/. It means that JMX is enabled on your 
Tomcat configuration (if not, check if the following line is in your 
/conf/server.xml file:   `Listener 
className=org.apache.catalina.mbeans.ServerLifecycleListener /`. Otherwise, 
check the Tomcat documentation to activate it). Let this page opened to check 
further if your custom Mbean is detected by Tomcat.BR
  
- 2. Build your custom MBean by following the Christopher Blunck's example : 
BR '''ServerMBean.java''' :
+ 2. Build your custom MBean by following the Christopher Blunck's example:
+ 
+ '''ServerMBean.java''' :
  
  {{{
package org.wxnet.mbeans;
@@ -882, +884 @@

  public long getUptime();
}
  }}}
+ 
  '''Server.java''' :
  
  {{{
@@ -936, +939 @@

  public long getUptime() { return System.currentTimeMills() - _startTime; }
}
  }}}
- In this implementation, firstly notice the ''ObjectName'' representing the 
MBean (in the constructor) : ''name = new 
ObjectName('''Application''':Name='''Server''',Type='''Server''');'' Do not 
hesitate to change the domain name (the first parameter) by your own to easily 
find your MBean reference in the http://localhost:8080/manager/jmxproxy 
page.BR Secondly, take a look at your MBean constructor : BR
+ In this implementation, firstly notice the ''ObjectName'' representing the 
MBean (in the constructor): ''name = new 
ObjectName('''Application''':Name='''Server''',Type='''Server''');'' Do not 
hesitate to change the domain name (the first parameter) by your own to easily 
find your MBean reference in the http://localhost:8080/manager/jmxproxy 
page.BR Secondly, take a look at your MBean constructor:
  
-  a. First step is to get a reference to the Tomcat's MBeanServer with 
''MBeanServer server = getServer();''.BR b. The ''getServer()'' method 
returns the default Tomcat's MBean server.BR
+ a. First step is to get a reference to the Tomcat's MBeanServer with 
''MBeanServer server = getServer();''.BR
+ b. The ''getServer()'' method returns the first MBean server in the list of 
MBean servers registered in JVM, which is the one used by Tomcat.
  
- A good question right now could be : what happens if I decide to create my 
own MBeanServer? The answer is very simple : '''nothing'''.BR After many 
research in the (empty) Tomcat's documentation and on the internet, after many 
tests, I conclued that you can't create your custom MBean server. More 
precisely, you can create it but Tomcat won't keep any reference to it.BR 
You can replace the previous ''getServer()'' method by this one to test:
- 
- {{{
- private MBeanServer getServer() {
- MBeanServer mbserver = null;
- 
- MBeanServer myMBServer = 
MBeanServerFactory.createMBeanServer(myMBServer);
- 
- ArrayListMBeanServer mbservers = 
MBeanServerFactory.findMBeanServer(null);
- System.out.println(** TOMCAT'S LIST OF REGISTERED MBEANSERVERS 
** );
- System.out.println(mbservers);
- 
- System.out.println(** TRYING TO RETRIEVE MY OWN MBEANSERVER FROM 
ITS AgentId ** );
- ArrayListMBeanServer mbservers_2 = 
MBeanServerFactory.findMBeanServer(myMBServer);
- System.out.println(mbservers_2);
- 
- 
- if (mbservers.size()  0) {
- mbserver = (MBeanServer) mbservers.get(0);
- }
- 
- if (mbserver != null) {
- System.out.println(MBeanServer has been found!);
- } else {
- mbserver = MBeanServerFactory.createMBeanServer();
- }
- 

[Tomcat Wiki] Update of HowTo by KonstantinKolinko

2013-02-09 Thread Apache Wiki
Dear Wiki user,

You have subscribed to a wiki page or wiki category on Tomcat Wiki for change 
notification.

The HowTo page has been changed by KonstantinKolinko:
http://wiki.apache.org/tomcat/HowTo?action=diffrev1=132rev2=133

Comment:
Correct markup

  
  First of all, you can read [[http://oss.wxnet.org/mbeans.html|this great 
tutorial]] from Christopher Blunck ( ch...@wxnet.org ). I will just add my 
comments and improvements.
  
- 1. Start your Tomcat and check that you have access to 
http://localhost:8080/manager/jmxproxy/. It means that JMX is enabled on your 
Tomcat configuration (if not, check if the following line is in your 
/conf/server.xml file :   ''Listener 
className=org.apache.catalina.mbeans.ServerLifecycleListener /''. Otherwise, 
check the Tomcat documentation to activate it). Let this page opened to check 
further if your custom Mbean is detected by Tomcat.BR
+ 1. Start your Tomcat and check that you have access to 
http://localhost:8080/manager/jmxproxy/. It means that JMX is enabled on your 
Tomcat configuration (if not, check if the following line is in your 
/conf/server.xml file :   `Listener 
className=org.apache.catalina.mbeans.ServerLifecycleListener /`. Otherwise, 
check the Tomcat documentation to activate it). Let this page opened to check 
further if your custom Mbean is detected by Tomcat.BR
  
  2. Build your custom MBean by following the Christopher Blunck's example : 
BR '''ServerMBean.java''' :
  
@@ -984, +984 @@

  return mbserver;
  }
  }}}
- Here is a capture of the println() : 
https://picasaweb.google.com/lh/photo/jzVX9-NBGwF57A0m8qqv2Q?feat=directlink. 
Tomcat seems to register 2 Mbean server but when I try to fetch mine from its 
AgentId (here myMBServer), nothing is found. In my opinion, Tomcat might 
re-implement the ''MBeanServerFactory'' java class to control the server 
creation. Then, it doesn't keep a reference to the newly created MBean server. 
Moreover, if Tomcat re-implement the MBeanFactory class, there is no method to 
directly add MBean (see the 
http://tomcat.apache.org/tomcat-6.0-doc/api/index.html).BR
+ Here is a capture of the println() : 
https://picasaweb.google.com/lh/photo/jzVX9-NBGwF57A0m8qqv2Q?feat=directlink. 
Tomcat seems to register 2nd Mbean server but when I try to fetch mine from its 
!AgentId (here myMBServer), nothing is found. In my opinion, Tomcat might 
re-implement the ''MBeanServerFactory'' java class to control the server 
creation. Then, it doesn't keep a reference to the newly created MBean server. 
Moreover, if Tomcat re-implement the MBeanFactory class, there is no method to 
directly add MBean (see the 
[[http://tomcat.apache.org/tomcat-6.0-doc/api/index.html]]).BR
  
  In my application architecture, I placed the 2 MBeans files (the interface 
and its implementation) in a particular package (I don't think its compulsary 
but definitely more aesthetic). Compile those one in a jar archive and place it 
in the Tomcat's library folder (/lib).BR
  
- 3. Build your '''ContextListener''' : According to the 
http://tomcat.apache.org/tomcat-6.0-doc/config/listeners.html|Tomcat's 
documentation]], a Listener is a ''a component that performs actions when 
specific events occur, usually Tomcat '''starting''' or Tomcat stopping.''. We 
need to instantiate and load our MBean at Tomcat's start. So we build a 
ContextListener.java file which is placed wherever you want in your project 
architecture :
+ 3. Build your '''!ContextListener''' : According to the 
[[http://tomcat.apache.org/tomcat-6.0-doc/config/listeners.html|Tomcat's 
documentation]], a Listener is a ''a component that performs actions when 
specific events occur, usually Tomcat '''starting''' or Tomcat stopping.''. We 
need to instantiate and load our MBean at Tomcat's start. So we build a 
!ContextListener.java file which is placed wherever you want in your project 
architecture :
  
  {{{
  package '''org.bonitasoft.context''';
@@ -1033, +1033 @@

/listener
  /web-app
  }}}
- In his tutorial, Christopher Blunck suggests to compile the 
ContextListener.java file in a jar archive and then place it into our 
WEB-INF/lib folder. In my own experiments, I never found any difference without 
doing this.BR
+ In his tutorial, Christopher Blunck suggests to compile the 
!ContextListener.java file in a jar archive and then place it into our 
WEB-INF/lib folder. In my own experiments, I never found any difference without 
doing this.BR
  
  4. The 'mbeans-descriptor.xml' file : The only entry in the Tomcat 
documentation about custom MBean is about this file. It says ''You may also 
add MBean descriptions for custom components in a mbeans-descriptor.xml file, 
located in the same package as the class files it describes.''. Unfortunately, 
instead of reading this file, Tomcat applied its own templates to replace my 
MBeans attributes and operations descriptions... I really didn't figure out 
what is the correct way of using and placing this file. So 

[Tomcat Wiki] Update of HowTo by KonstantinKolinko

2013-02-02 Thread Apache Wiki
Dear Wiki user,

You have subscribed to a wiki page or wiki category on Tomcat Wiki for change 
notification.

The HowTo page has been changed by KonstantinKolinko:
http://wiki.apache.org/tomcat/HowTo?action=diffrev1=120rev2=121

Comment:
Remove How do I use log4j for all Tomcat log output? entry. The text was old 
and wrong. This topic is covered by Tomcat docs.

  No.  If you can edit Tomcat's startup scripts (or better create a 
{{{setenv.sh}}} file), you can add -D options to Java.  But there is no way 
in Java to have different values of system properties for different classes in 
the same JVM.
  
  There are some other methods available, like using 
{{{ServletContext.getContextPath()}}} to get the context name of your web 
application and locate some resources accordingly, or to define 
{{{context-param}}} elements in {{{WEB-INF/web.xml}}} file of your web 
application and then set the values for them in Tomcat context file 
({{{META-INF/context.xml}}}). See 
http://tomcat.apache.org/tomcat-7.0-doc/config/context.html .
- 
- == How do I use log4j for all Tomcat log output? ==
- To have Tomcat use log4j universally, place both `log4j.jar` and the Jakarta 
`commons-logging.jar` into the `$TOMCAT_HOME/common/lib` directory.  Create 
your log4j properties file as `$TOMCAT_HOME/common/classes/log4j.properties` 
and configure the root logger.  Here is the basic `log4j.properties` that I 
used to do this myself:
- 
- {{{
- log4j.rootLogger=info, R
- log4j.appender.R=org.apache.log4j.ConsoleAppender
- log4j.appender.R.layout=org.apache.log4j.PatternLayout
- log4j.appender.R.layout.ConversionPattern=%-5p %-30.30c{1} %x - %m%n
- }}}
- If you only need to use log4j in your own web app, just include log4j (and 
any log4j properties file) in your WAR file.
  
  == How do I configure Tomcat Connectors? ==
  On the Tomcat FAQ, there is a list of Other Resources which should have 
information pointing you to the relevant pages.

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Tomcat Wiki] Update of HowTo by KonstantinKolinko

2013-02-02 Thread Apache Wiki
Dear Wiki user,

You have subscribed to a wiki page or wiki category on Tomcat Wiki for change 
notification.

The HowTo page has been changed by KonstantinKolinko:
http://wiki.apache.org/tomcat/HowTo?action=diffrev1=121rev2=122

Comment:
Correction. ROOT/index.jsp was precompiled in Tomcat 5.5, but not in Tomcat 6 
and later.

  See HowTo/FasterStartUp
  
  == How do I override the default home page loaded by Tomcat? ==
- After successfully installing Tomcat, you usually test it by loading 
http://localhost:8080 . The contents of that page are compiled into the 
`index_jsp` servlet. The page even warns against modifying the `index.jsp` 
files for this reason. Luckily, it is quite easy to override that page. Inside 
{{{$TOMCAT_HOME/conf/web.xml}}} there is a section called `welcome-file-list` 
and it looks like this:
+ After successfully installing Tomcat, you usually test it by loading 
http://localhost:8080 . It is quite easy to override that page. Inside 
{{{$TOMCAT_HOME/conf/web.xml}}} there is a section called `welcome-file-list` 
and it looks like this:
  
  {{{
  welcome-file-list

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Tomcat Wiki] Update of HowTo by KonstantinKolinko

2013-02-02 Thread Apache Wiki
Dear Wiki user,

You have subscribed to a wiki page or wiki category on Tomcat Wiki for change 
notification.

The HowTo page has been changed by KonstantinKolinko:
http://wiki.apache.org/tomcat/HowTo?action=diffrev1=122rev2=123

Comment:
Remove How do I edit the default JSP home page loaded by Tomcat? entry. It 
was for Tomcat 5.5 and is not applicable for Tomcat 6 and later.

  /html
  }}}
  This change takes effect immediately and does not require a restart of Tomcat.
- 
- == How do I edit the default JSP home page loaded by Tomcat? ==
- See [[EditDefaultJSPPage]]
  
  == How do I enable Server Side Includes (SSI)? ==
  two things have to be done for tomcat to aknowledge SSI scripts:

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Tomcat Wiki] Update of HowTo by KonstantinKolinko

2013-02-02 Thread Apache Wiki
Dear Wiki user,

You have subscribed to a wiki page or wiki category on Tomcat Wiki for change 
notification.

The HowTo page has been changed by KonstantinKolinko:
http://wiki.apache.org/tomcat/HowTo?action=diffrev1=123rev2=124

Comment:
Replace obsolete configuring SSI recipe with a link to documentation

  This change takes effect immediately and does not require a restart of Tomcat.
  
  == How do I enable Server Side Includes (SSI)? ==
+ See http://tomcat.apache.org/tomcat-7.0-doc/ssi-howto.html
- two things have to be done for tomcat to aknowledge SSI scripts:
- 
- 1.  Rename $CATALINA_BASE/server/lib/servlets-ssi.renametojar to 
$CATALINA_BASE/server/lib/servlets-ssi.jar.
- 
- 2.  Uncomment the section of web.xml found in $CATALINA_BASE/conf/web.xml 
that deals with SSI.  it looks like this when it is uncommented:
- 
- {{{
- servlet
- servlet-namessi/servlet-name
- servlet-class
-   org.apache.catalina.ssi.SSIServlet
- /servlet-class
- init-param
-   param-namebuffered/param-name
-   param-value1/param-value
- /init-param
- init-param
-   param-namedebug/param-name
-   param-value0/param-value
- /init-param
- init-param
-   param-nameexpires/param-name
-   param-value666/param-value
- /init-param
- init-param
-   param-nameisVirtualWebappRelative/param-name
-   param-value0/param-value
- /init-param
- load-on-startup4/load-on-startup
- /servlet
- }}}
- additional information can be found at: 
http://tomcat.apache.org/tomcat-5.5-doc/ssi-howto.html
  
  == How do I install the Administration web app? ==
  If you install Tomcat 5.5 binaries, the Administration web app is not bundled 
with it; this describes how to add the Administration web app to your Tomcat 
5.5 installation.  (Tomcat 4.1 comes with the Administration web app as part of 
the binary).

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Tomcat Wiki] Update of HowTo by KonstantinKolinko

2013-02-02 Thread Apache Wiki
Dear Wiki user,

You have subscribed to a wiki page or wiki category on Tomcat Wiki for change 
notification.

The HowTo page has been changed by KonstantinKolinko:
http://wiki.apache.org/tomcat/HowTo?action=diffrev1=124rev2=125

Comment:
Administration webapp is not available for Tomcat 6 and later

  See http://tomcat.apache.org/tomcat-7.0-doc/ssi-howto.html
  
  == How do I install the Administration web app? ==
+ === Tomcat 5.5 ===
  If you install Tomcat 5.5 binaries, the Administration web app is not bundled 
with it; this describes how to add the Administration web app to your Tomcat 
5.5 installation.  (Tomcat 4.1 comes with the Administration web app as part of 
the binary).
  
  The following refers to a Tomcat 5.5 set up on Windows 2000, so your path 
names will be different on *nix platforms.  In this example, Tomcat 5.5.17 in 
installed in ''c:\Program Files\Apache Software Foundation\Tomcat 5.5'' (this 
is my '''CATALINA_HOME''').
@@ -210, +211 @@

   1. Restart Tomcat.
  
   1. Now when you visit ''http://localhost:8080/admin'' you should see a page 
that asks for a user name and password.  If you still see the no longer 
loaded error message in your browser, you must either force a full reload of 
the web page (in Firefox, hold down Shift key while clicking on the Reload 
button) or just restart your browser completely.
+ 
+ === Tomcat 6.0 and later ===
+ Development of Administration web app was ceased and it is no longer provided 
for Tomcat 6.0 and later versions.
+ 
+ An alternative is to use 3-rd party applications, such as PSI Probe. See 
[[AddOns]] page for links.
  
  == How do I add JARs or classes to the common classloader without adding them 
to $CATALINA_HOME/lib? ==
  Either

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Tomcat Wiki] Update of HowTo by KonstantinKolinko

2013-02-02 Thread Apache Wiki
Dear Wiki user,

You have subscribed to a wiki page or wiki category on Tomcat Wiki for change 
notification.

The HowTo page has been changed by KonstantinKolinko:
http://wiki.apache.org/tomcat/HowTo?action=diffrev1=125rev2=126

Comment:
Slightly improve wording

  == How do I add JARs or classes to the common classloader without adding them 
to $CATALINA_HOME/lib? ==
  Either
  
- a) Run Tomcat with separate {{{$CATALINA_BASE}}} and {{{$CATALINA_HOME}}} (as 
documented in {{{RUNNING.txt}}}) and place those classes into 
{{{$CATALINA_BASE/lib}}}, or
+ a) Configure Tomcat to run with separate {{{$CATALINA_BASE}}} and 
{{{$CATALINA_HOME}}} directories (as documented in {{{RUNNING.txt}}}), and 
place your JARs and classes into {{{$CATALINA_BASE/lib}}}, or
  
  b) Edit the file ''catalina.properties'' under {{{$CATALINA_BASE/conf}}}; 
there is a property called ''common.loader'' to which you can add additional 
paths to find JARs or classes for the common classloader.
  

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Tomcat Wiki] Update of HowTo by KonstantinKolinko

2013-02-02 Thread Apache Wiki
Dear Wiki user,

You have subscribed to a wiki page or wiki category on Tomcat Wiki for change 
notification.

The HowTo page has been changed by KonstantinKolinko:
http://wiki.apache.org/tomcat/HowTo?action=diffrev1=126rev2=127

Comment:
Rewrite the recipe on Tomcat memory configuration. Use CATALINA_OPTS instead of 
JAVA_OPTS.

  ADS insists that the CN of every group be unique, but the Manager app. always 
uses the group CN=manager.  The default can be changed, but it's hard to find 
and you have to do it over every time you upgrade.  Instead, pick an attribute 
other than the common name -- for example, description -- that doesn't have 
to be unique, name it as the `RoleName` attribute of the `Realm` (in 
server.xml, which you'll be editing anyway), and set that  attribute to 
manager in each group you create.  Create an OU for each Tomcat instance's 
groups and give that OU's DN as the `RoleBase` in that instance's server.xml.  
Create a uniquely-named group in each instance's OU with the chosen attribute 
(description for example) set to manager.
  
  == Where and how do I set memory related settings to improve Tomcat 
performance? ==
- When your web application is using large memory as this memory size default 
setting can be too small, 64MB by default,thus the application becomes slower 
because the garbage collector is invoked more often, and it can even run out of 
memory (outofmemory / heap space error ). One way to address this problem is to 
set a larger heap size . In Windows system, this can be done by editing / 
adding JAVA_OPTS variable (should be early in the file) in 
CATALINA_HOME/bin/catalina.bat or catalina.sh for Linux/Unix systems.Parameters 
to be added are , let say you want to increase it to 256 MB (as you required 
but make sure you have enough amount of physical memory/RAM and for 32bit 
system , use no more than 1-1.1 GB heap space size ) , use '-Xms256m -Xmx256m' 
.In some cases , it is better to set slightly lower size for -Xms . There are 
other parameters can be added , some of them :{{{'-XX:MaxNewSize -XX:NewSize 
-XX:MaxPermSize'}}} , depending on your application and requirements .
+ When your web application is using large memory as this memory size default 
setting can be too small. One way to address this problem is to set a larger 
heap size.
  
- For catalina.bat there now should be a line in the file that looks like this: 
 {{{ set JAVA_OPTS=-Xms256m -Xmx256m }}}
+ If you start Tomcat by using the standard '''script files''' (such as 
`CATALINA_HOME/bin/catalina.bat` or `catalina.sh`), this can be done by setting 
`CATALINA_OPTS` environment variable. The recommended way to do so is to create 
a `setenv.bat` or `setenv.sh` file, mdash; read 
[[http://tomcat.apache.org/tomcat-7.0-doc/RUNNING.txt|RUNNING.txt]] for details.
  
- For catalina.sh:  {{{ JAVA_OPTS='-Xms256m -Xmx256m' }}}
+ Let say you want to increase it to 256 MB (as you required but make sure you 
have enough amount of physical memory/RAM and for 32bit system, use no more 
than 1.0-1.1 GB heap space size ). Set the `CATALINA_OPTS` to the value of 
{{{-Xms256m -Xmx256m}}}. In some cases it is better to set slightly lower size 
for `-Xms`.
  
- For other parameters , go to * http://wiki.apache.org/tomcat/FAQ/Memory * 
http://wiki.apache.org/tomcat/OutOfMemory
+ For `setenv.bat` use the following line:  {{{ set CATALINA_OPTS=-Xms256m 
-Xmx256m }}} BR
+ For `setenv.sh` use the following:  {{{ CATALINA_OPTS='-Xms256m -Xmx256m' }}}
  
- and Google and Yahoo are your friends.
+ There are other parameters that can be added, depending on your application 
and requirements, e.g: {{{'-XX:MaxPermSize'}}}.
+ 
+ For other parameters, look at the following pages:
+ 
+  * [[FAQ/Memory]]
+  * [[OutOfMemory]]
+ 
+ If you are running Tomcat as a '''Windows service''', then environment 
variables and `setenv.bat` script have no effect. The relevant settings for the 
service wrapper application are stored in the Windows registry. They can be 
edited via Configuration application (`tomcatNw.exe`). See Java tab in the 
configuration dialog. The`-Xms` and `-Xmx` options are configured in fields 
named Initial memory pool and Maximum memory pool. Other options can be 
added to Java Options field as if they were specified on the command line of 
java executable.
  
  == How do I make my web application be the Tomcat default application? ==
  Congratulations.  You have created and tested a first web application 
(traditionally called mywebapp), users can access it via the URL 
http://myhost.company.com/mywebapp;.  You are very proud and satisfied.   But 
now, how do you change the setup, so that mywebapp gets called when the user 
enters the URL http://myhost.company.com; ?

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Tomcat Wiki] Update of HowTo by KonstantinKolinko

2013-02-02 Thread Apache Wiki
Dear Wiki user,

You have subscribed to a wiki page or wiki category on Tomcat Wiki for change 
notification.

The HowTo page has been changed by KonstantinKolinko:
http://wiki.apache.org/tomcat/HowTo?action=diffrev1=127rev2=128

Comment:
Add a warning. There should be a better recipe somewhere in the mailing list 
archives.

  Context context = (Context) host.findChild(myContext);
  Realm realm = context.getRealm();
  }}}
+ 
+ '''Warning:''' The above recipe on how to obtain a `Context` for a web 
application is a bit obsolete and does not work in Tomcat 7 and later (as 
Server is no longer a singleton). There are other ways to achieve that. An easy 
one is to add a `Valve` or `Listener` to a context, as those classes have 
access to Tomcat internals. There may be other ways mentioned in the archives 
of the [[FAQ/Tomcat_User|users mailing list]].
+ 
  == How do I redirect System.out and System.err to my web page? ==
  I have met a situation where I needed to redirect a portion of standard ouput 
(`System.out`, STDOUT) and standard error (`System.err`, STDERR) to my web page 
instead of a log file. An example of such an application is a compiler research 
platform that our resarch team is putting online for anybody to be able to 
quickly compile-test their programs on line. Naturally, the compilers dump some 
of their stuff to STDERR or STDOUT and they are not web application `.jar`. 
Thus, I needed badly these streams related to the compiler output to be 
redirected to my web editor interface. Having found no easy instructions on how 
to do that lead me writing up this quick HOWTO. The HOWTO is based on Servlets, 
but similar arrangements can be done for JSPs. The below example shows the 
essentials, with most non-essentials removed.
  

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Tomcat Wiki] Update of HowTo by KonstantinKolinko

2013-02-02 Thread Apache Wiki
Dear Wiki user,

You have subscribed to a wiki page or wiki category on Tomcat Wiki for change 
notification.

The HowTo page has been changed by KonstantinKolinko:
http://wiki.apache.org/tomcat/HowTo?action=diffrev1=128rev2=129

Comment:
Add try and finally

  PrintStream oStdOutBackup = System.out;
  PrintStream oStdErrBackup = System.err;
  
+ try {
+ 
- // Redired STDOUT and STDERR to the ServletOuputStream
+   // Redired STDOUT and STDERR to the ServletOutputStream
- System.setOut(new PrintStream(out));
+   System.setOut(new PrintStream(out));
- System.setErr(new PrintStream(out));
+   System.setErr(new PrintStream(out));
  
- 
- try
+   try {
- {
  // ... call compiler here that produces
  // tons of STDOUT/STDERR messages ...
+   } catch(Exception e) {
+ out.println(e);
+   }
+ 
+ } finally {
+ 
+   // Restore original STDOUT and STDERR
+   System.setOut(oStdOutBackup);
+   System.setErr(oStdErrBackup);
+ 
  }
- catch(Exception e)
- {
- out.println(e);
- }
- 
- // Restore original STDOUT and STDERR
- System.setOut(oStdOutBackup);
- System.setErr(oStdErrBackup);
  
  out.println(hr /);
  out.println(/body);

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Tomcat Wiki] Update of HowTo by KonstantinKolinko

2013-02-02 Thread Apache Wiki
Dear Wiki user,

You have subscribed to a wiki page or wiki category on Tomcat Wiki for change 
notification.

The HowTo page has been changed by KonstantinKolinko:
http://wiki.apache.org/tomcat/HowTo?action=diffrev1=129rev2=130

Comment:
Add note, update a link

  }
  }
  }}}
- A few caveats arise, as for instance while the `System.out` and `System.err` 
are redirected as per above, no logging of these is done to files. You will 
need more legwork to do to make the additional logging. It is important to 
backup and restore the original streams as the above example does. Also, notice 
the use of `getOutputStream()`: when this method is called, the `getWriter()` 
method can no longer be used in the same response object.
+ A few caveats arise, as for instance while the `System.out` and `System.err` 
are redirected as per above, no logging of these is done to files. You will 
need more legwork to do to make the additional logging. It is important to 
backup and restore the original streams as the above example does. The servlet 
should not be used to process several requests in parallel (some 
synchronization should be added to the above code to prevent that). Also, 
notice the use of `getOutputStream()`: when this method is called, the 
`getWriter()` method can no longer be used in the same response object.
  
  Corrections and comments are most welcome!
  
  == How do I connect to a Websphere MQ (MQ Series) server using JMS and JNDI? 
==
- Basically, this works just as described in  
http://tomcat.apache.org/tomcat-5.5-doc/jndi-resources-howto.html: Within your 
application, you are using the standard JNDI and JMS API calls. In web.xml (the 
container independent application descriptor), you specify resource references 
(stub resources). And in context.xml (the container specific application 
descriptor), you are actually configuring the JMS connection.
+ Basically, this works just as described in  
http://tomcat.apache.org/tomcat-7.0-doc/jndi-resources-howto.html: Within your 
application, you are using the standard JNDI and JMS API calls. In web.xml (the 
container independent application descriptor), you specify resource references 
(stub resources). And in context.xml (the container specific application 
descriptor), you are actually configuring the JMS connection.
  
  More to the point. Here's some example code, which might be added to a 
Servlet. The example is sending a message to an MQ server:
  

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Tomcat Wiki] Update of HowTo by KonstantinKolinko

2013-02-02 Thread Apache Wiki
Dear Wiki user,

You have subscribed to a wiki page or wiki category on Tomcat Wiki for change 
notification.

The HowTo page has been changed by KonstantinKolinko:
http://wiki.apache.org/tomcat/HowTo?action=diffrev1=130rev2=131

Comment:
Remove dead link. (The target site is occupied by a squatter).

  TOMCAT_HOME\bin\catalina jpda start
  }}}
   * Use your IDE to connect to Tomcat through port 1044
- 
- If Eclipse happens to be your IDE of choice, you can get more information at 
[[http://www.jacoozi.com/index.php?option=com_contenttask=viewid=119Itemid=134|Remote
 Debugging with Eclipse (Jacoozi Article)]].
  
  See also:  [[FAQ/Developing]]
  

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Tomcat Wiki] Update of HowTo by KonstantinKolinko

2013-02-02 Thread Apache Wiki
Dear Wiki user,

You have subscribed to a wiki page or wiki category on Tomcat Wiki for change 
notification.

The HowTo page has been changed by KonstantinKolinko:
http://wiki.apache.org/tomcat/HowTo?action=diffrev1=131rev2=132

Comment:
Remove dead link. (The target site is occupied by a squatter).

  
   * Use your IDE to connect to Tomcat through port 1044
  
- If Eclipse happens to be your IDE of choice, you can get more information at 
[[http://www.jacoozi.com/index.php?option=com_contenttask=viewid=119Itemid=134|Remote
 Debugging with Eclipse (Jacoozi Article)]]. For IntelliJ IDEA you choose a 
remote debug target and set transport to socket and mode to attach , then 
you specify the host (127.0.0.1) and port (1044)
+ For IntelliJ IDEA you choose a remote debug target and set transport to 
socket and mode to attach , then you specify the host (127.0.0.1) and port 
(1044)
+ 
+ See also:  [[FAQ/Developing]]
  
  == How do I check whether Tomcat is UP or DOWN? There is no status command ==
  Unfortunately, the `org.apache.catalina.util.ServerInfo` class does not 
determine if Tomcat is UP or DOWN. It is possible to do an HTTP GET on the root 
url but this is not accurate. In my case I sometimes use a regular Apache HTTPd 
to display a maintainence message while upgrading, etc. and using that method 
would give false positives.

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Tomcat Wiki] Update of HowTo by KonstantinKolinko

2013-01-29 Thread Apache Wiki
Dear Wiki user,

You have subscribed to a wiki page or wiki category on Tomcat Wiki for change 
notification.

The HowTo page has been changed by KonstantinKolinko:
http://wiki.apache.org/tomcat/HowTo?action=diffrev1=119rev2=120

Comment:
Remove suggestion of replacing the default servlet. It is irrelevant to the 
issue. Correct links.

  
  Just by doing this, you have already made you webapp into the Tomcat 
''default webapp''.
  
- One step is left : you also need to have, within your application, a 
''default servlet''.  If you don't want to use the standard one supplied by 
Tomcat that does nothing but deliver static content, you'll need to supply one 
of your own. This you do by means of an appropriate url-mapping in the 
WEB-INF/web.xml configuration file of your application. Make sure you have 
something like this in that file:
- 
- {{{
-servlet
- servlet-nameMy First Servlet/servlet-name
- servlet-classmy.Servlet.Number1/servlet-class
- /servlet
- 
- servlet-mapping
- servlet-nameMy First Servlet/servlet-name
- url-pattern/*/url-pattern
- /servlet-mapping
- }}}
- The above will override the mapping for Tomcat's DefaultServlet in the global 
conf/web.xml file.
- 
  Restart Tomcat and you're done.BR Call up http://myhost.company.com/; 
and enjoy.
  
  '''Addendum 1 : If you are deploying your application as a war file..'''
  
  The above instructions relate to the situation where you are manually 
deploying your application as a directory-and-files structure under the 
/webapps directory.  If instead you are using the war method to deploy your 
application, the principle is about the same :BR - delete the ROOT 
directoryBR - name your war file ROOT.war (capitals mandatory)BR - 
drop the ROOT.war file directly in the /webapps directory.BR Tomcat will 
automatically deploy it.
  
- For more information about this topic in general, consult this page :  
[[http://tomcat.apache.org/tomcat-6.0-doc/config/context.html|The Context 
Container]]
+ For more information about this topic in general, consult this page :  
[[http://tomcat.apache.org/tomcat-7.0-doc/config/context.html|Configuration 
Reference / Context]]
  
  '''Addendum 2 : If for some reason you want another method..'''
  
- If, for some reason, you do not want to deploy your application under the 
CATALINA_BASE/webapps/ROOT subdirectory, or you do not want to name your 
war-file ROOT.war, then read on.  But you should first read this : 
[[http://tomcat.apache.org/tomcat-6.0-doc/config/context.html|The Context 
Container]] and make sure you understand the implications.
+ If, for some reason, you do not want to deploy your application under the 
CATALINA_BASE/webapps/ROOT subdirectory, or you do not want to name your 
war-file ROOT.war, then read on.  But you should first read this : 
[[http://tomcat.apache.org/tomcat-7.0-doc/config/context.html|Configuration 
Reference / Context]] and make sure you understand the implications.
  
  The method described above is the simple method.  The two methods below are 
more complex, and the second one has definite implications on the way you 
manage and run your Tomcat.
  

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Tomcat Wiki] Update of HowTo by KonstantinKolinko

2013-01-09 Thread Apache Wiki
Dear Wiki user,

You have subscribed to a wiki page or wiki category on Tomcat Wiki for change 
notification.

The HowTo page has been changed by KonstantinKolinko:
http://wiki.apache.org/tomcat/HowTo?action=diffrev1=118rev2=119

Comment:
Add link to HowTo/SSLCiphers

  
  == How to configure two-way SSL authentication on Tomcat using self-signed 
certificates for testing/development ==
  See http://java-notes.com/index.php/two-way-ssl-on-tomcat
+ 
+ == How do I restrict the list of SSL ciphers used for HTTPS ==
+ See [[HowTo/SSLCiphers]].
  
  == How do I make Tomcat startup faster? ==
  See HowTo/FasterStartUp

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Tomcat Wiki] Update of HowTo by KonstantinKolinko

2012-03-22 Thread Apache Wiki
Dear Wiki user,

You have subscribed to a wiki page or wiki category on Tomcat Wiki for change 
notification.

The HowTo page has been changed by KonstantinKolinko:
http://wiki.apache.org/tomcat/HowTo?action=diffrev1=115rev2=116

Comment:
Add answer on How to create a heap dump. There is a link to on 
FAQ/Troubleshooting_and_Diagnostics page

  
  This will produce a thread dump on standard output, but may not be possible 
to capture to a file.
  
+ 
+ == How do I obtain a heap dump? ==
+ 
+ See 
[[http://wiki.eclipse.org/index.php/MemoryAnalyzer#Getting_a_Heap_Dump|Getting 
a Heap Dump]]
+ on the help pages of [[http://eclipse.org/mat/|Eclipse Memory Analysis Tool]].
+ 
+ 
  == How do I add my own custom MBean to monitor my application within Tomcat 
5/6? ==
+ 
  First of all, you can read [[http://oss.wxnet.org/mbeans.html|this great 
tutorial]] from Christopher Blunck ( ch...@wxnet.org ). I will just add my 
comments and improvements.
  
  1. Start your Tomcat and check that you have access to 
http://localhost:8080/manager/jmxproxy/. It means that JMX is enabled on your 
Tomcat configuration (if not, check if the following line is in your 
/conf/server.xml file :   ''Listener 
className=org.apache.catalina.mbeans.ServerLifecycleListener /''. Otherwise, 
check the Tomcat documentation to activate it). Let this page opened to check 
further if your custom Mbean is detected by Tomcat.BR

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Tomcat Wiki] Update of HowTo by KonstantinKolinko

2011-07-31 Thread Apache Wiki
Dear Wiki user,

You have subscribed to a wiki page or wiki category on Tomcat Wiki for change 
notification.

The HowTo page has been changed by KonstantinKolinko:
http://wiki.apache.org/tomcat/HowTo?action=diffrev1=110rev2=111

Comment:
Add horizontal bars between sections

  
  Note, that the Tomcat web site is updated with every release, so that 
documentation changes will not be visible until next Tomcat release. It is 
possible to view documentation for unreleased versions of Tomcat 7 and Tomcat 
6, that is published by ASF Buildbot. See links on the 
[[http://tomcat.apache.org/ci.html|buildbot]] page on Apache Tomcat web site.
  
- 
+ 
  = Installation =
  
  == How do I set up and run Tomcat on Macintosh OS X? ==
@@ -101, +101 @@

  }}}
  
  
- 
+ 
  = Configuration =
  
  == How do I set up multiple sites sharing the same war application/war file? 
==
@@ -333, +333 @@

  See TomcatDevelopmentVirtualHosts
  
  
- 
+ 
  = Programming =
  
  == How do call tomcat ant tasks to deploy webapps? ==
@@ -622, +622 @@

  == How do I use DataSourceRealms for authentication and authorization? ==
  See TomcatDataSourceRealms
  
- 
+ 
  = Troubleshooting =
  
  == Tomcat crashed! What do I do now? ==

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Tomcat Wiki] Update of HowTo by KonstantinKolinko

2011-07-29 Thread Apache Wiki
Dear Wiki user,

You have subscribed to a wiki page or wiki category on Tomcat Wiki for change 
notification.

The HowTo page has been changed by KonstantinKolinko:
http://wiki.apache.org/tomcat/HowTo?action=diffrev1=105rev2=106

Comment:
Improve HOWTO on customizing common.loader property

  
   1. Now when you visit ''http://localhost:8080/admin'' you should see a page 
that asks for a user name and password.  If you still see the no longer 
loaded error message in your browser, you must either force a full reload of 
the web page (in Firefox, hold down Shift key while clicking on the Reload 
button) or just restart your browser completely.
  
- == How do I add JARs or classes to the common classloader without adding them 
to $CATALINA_HOME/common/lib? ==
+ == How do I add JARs or classes to the common classloader without adding them 
to $CATALINA_HOME/lib? ==
+ 
+ Either
+ 
+ a) Run Tomcat with separate {{{$CATALINA_BASE}}} and {{{$CATALINA_HOME}}} (as 
documented in {{{RUNNING.txt}}}) and place those classes into 
{{{$CATALINA_BASE/lib}}}, or
+ 
- Edit the file ''catalina.properties'' under $CATALINA_BASE/conf; there is a 
property called ''common.loader'' to which you can add additional paths to find 
JARs or classes for the common classloader.
+ b) Edit the file ''catalina.properties'' under {{{$CATALINA_BASE/conf}}}; 
there is a property called ''common.loader'' to which you can add additional 
paths to find JARs or classes for the common classloader.
  
  == How do I get Tomcat to start when it says it can't find the file 
'setclasspath.sh'? ==
  If Tomcat was working fine the first few times after installation but 
suddenly refuses to start up and gives the following error message:

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Tomcat Wiki] Update of HowTo by KonstantinKolinko

2011-07-29 Thread Apache Wiki
Dear Wiki user,

You have subscribed to a wiki page or wiki category on Tomcat Wiki for change 
notification.

The HowTo page has been changed by KonstantinKolinko:
http://wiki.apache.org/tomcat/HowTo?action=diffrev1=106rev2=107

Comment:
Remove tip that suggests editing setclasspath.sh. I think it is just wrong.

  
  b) Edit the file ''catalina.properties'' under {{{$CATALINA_BASE/conf}}}; 
there is a property called ''common.loader'' to which you can add additional 
paths to find JARs or classes for the common classloader.
  
- == How do I get Tomcat to start when it says it can't find the file 
'setclasspath.sh'? ==
- If Tomcat was working fine the first few times after installation but 
suddenly refuses to start up and gives the following error message:
- 
- {{{
- $ ./startup.sh
- Cannot find /path/to/tomcat/bin/setclasspath.sh
- This file is needed to run this program
- }}}
- Then all you need to do is to include the complete paths for the BASEDIR and 
CATALINA_HOME variables in the files setclasspath.sh and catalina.sh 
respectively.
- 
- This should be done even if CATALINA_HOME has been defined and exported 
previously on the command line and/or in /etc/profile as well.  Moreover, this 
error message persists even though the file setclasspath.sh is present in 
Tomcat's bin directory.
- 
- {{{
- $ echo BASEDIR=/path/to/tomcat  setclasspath.sh
- $ echo CATALINA_HOME=/path/to/tomcat  catalina.sh
- }}}
  == How do I authenticate Manager access via JNDI to Active Directory for 
multiple Tomcat instances? ==
  ADS insists that the CN of every group be unique, but the Manager app. always 
uses the group CN=manager.  The default can be changed, but it's hard to find 
and you have to do it over every time you upgrade.  Instead, pick an attribute 
other than the common name -- for example, description -- that doesn't have 
to be unique, name it as the `RoleName` attribute of the `Realm` (in 
server.xml, which you'll be editing anyway), and set that  attribute to 
manager in each group you create.  Create an OU for each Tomcat instance's 
groups and give that OU's DN as the `RoleBase` in that instance's server.xml.  
Create a uniquely-named group in each instance's OU with the chosen attribute 
(description for example) set to manager.
  

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Tomcat Wiki] Update of HowTo by KonstantinKolinko

2011-07-29 Thread Apache Wiki
Dear Wiki user,

You have subscribed to a wiki page or wiki category on Tomcat Wiki for change 
notification.

The HowTo page has been changed by KonstantinKolinko:
http://wiki.apache.org/tomcat/HowTo?action=diffrev1=107rev2=108

Comment:
Correct some typos. Update system properties tip.

  == How do I load a properties file? ==
  Here are the three most popular ways::
  
-  * Use a classloader's getResource to get an url to the properties file and 
load it into the Properties. The properties file must be located within the 
webapp classpath (i.e. either WEB-INF/classes/... or in a jar.
+  * Use a classloader's getResource to get an url to the properties file and 
load it into the Properties. The properties file must be located within the 
webapp classpath (i.e. either {{{WEB-INF/classes/...}}} or in a jar in 
{{{WEB-INF/lib/}}}).
  
  A challenge is to get the classloader when you are in a static initializer:
  
@@ -67, +67 @@

  p.load(is);
  is.close();
  }}}
+ 
  == How do I log requests ? ==
  See AccessLogValve
  
  == Can I set Java system properties differently for each webapp? ==
- No.  If you can edit Tomcat's startup scripts, you can add -D options to 
Java.  But there is no way to add such properties in web.xml or the webapp's 
context.
+ No.  If you can edit Tomcat's startup scripts (or better create a 
{{{setenv.sh}}} file), you can add -D options to Java.  But there is no way 
in Java to have different values of system properties for different classes in 
the same JVM.
+ 
+ There are some other methods available, like using 
{{{ServletContext.getContextPath()}}} to get the context name of your web 
application and locate some resources accordingly, or to define 
{{{context-param}}} elements in {{{WEB-INF/web.xml}}} file of your web 
application and then set the values for them in Tomcat context file 
({{{META-INF/context.xml}}}). See 
http://tomcat.apache.org/tomcat-7.0-doc/config/context.html .
  
  == How do I use log4j for all Tomcat log output? ==
  To have Tomcat use log4j universally, place both `log4j.jar` and the Jakarta 
`commons-logging.jar` into the `$TOMCAT_HOME/common/lib` directory.  Create 
your log4j properties file as `$TOMCAT_HOME/common/classes/log4j.properties` 
and configure the root logger.  Here is the basic `log4j.properties` that I 
used to do this myself:

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Tomcat Wiki] Update of HowTo by KonstantinKolinko

2011-07-11 Thread Apache Wiki
Dear Wiki user,

You have subscribed to a wiki page or wiki category on Tomcat Wiki for change 
notification.

The HowTo page has been changed by KonstantinKolinko:
http://wiki.apache.org/tomcat/HowTo?action=diffrev1=102rev2=103

Comment:
Replace http://marc.theaimsgroup.com/ with http://marc.info/

  You might want to try serializing the response of 
'request.getUserPrincipal()' and deserialize it to an instance of 
[webapp]MyPrincipal.
  
  == Setting up SSL ==
- Threads from the 
[[http://jakarta.apache.org/tomcat/faq/tomcatuser.html|tomcat-user list]]
+ Threads from the 
[[http://tomcat.apache.org/lists.html#tomcat-users|tomcat-user list]]
  
  Using VeriSign:
  
-  * http://marc.theaimsgroup.com/?l=tomcat-userm=106285452711698w=2
+  * http://marc.info/?l=tomcat-userm=106285452711698w=2
-  * http://marc.theaimsgroup.com/?l=tomcat-userm=107584265122914w=2
+  * http://marc.info/?l=tomcat-userm=107584265122914w=2
  
  Using [[OpenSSL]]:
  
-  * http://marc.theaimsgroup.com/?l=tomcat-userm=106293430225790w=2
+  * http://marc.info/?l=tomcat-userm=106293430225790w=2
-  * http://marc.theaimsgroup.com/?l=tomcat-userm=106453566416102w=2
+  * http://marc.info/?l=tomcat-userm=106453566416102w=2
-  * http://marc.theaimsgroup.com/?l=tomcat-userm=106621232531781w=2
+  * http://marc.info/?l=tomcat-userm=106621232531781w=2
  
  A description of what SSL is all about anyway:
  
-  * http://marc.theaimsgroup.com/?l=tomcat-userm=106692394104667w=2
+  * http://marc.info/?l=tomcat-userm=106692394104667w=2
  
  == HowTo SSL Client Authentication with Fallback to FORM Authentication ==
  See [[SSLWithFORMFallback]]

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Tomcat Wiki] Update of HowTo by KonstantinKolinko

2011-07-11 Thread Apache Wiki
Dear Wiki user,

You have subscribed to a wiki page or wiki category on Tomcat Wiki for change 
notification.

The HowTo page has been changed by KonstantinKolinko:
http://wiki.apache.org/tomcat/HowTo?action=diffrev1=103rev2=104

Comment:
Replace jakarta references with something more up-to-date

  == How do I add a question to this page? ==
  Anyone may edit this page to add their own content. That is why this page is 
part of a Wiki and not a hardcoded static file in the FAQ.
  
- However, ''do not'' add questions without answers to this page. If you have a 
question about how to do something in Tomcat which has not been addressed yet, 
ask the [[http://jakarta.apache.org/tomcat/faq/tomcatuser.html|tomcat-user 
list]]. Once you've figured out how to fix your problem, come back and update 
the Wiki to allow the rest of us to benefit from what you've learned!
+ However, ''do not'' add questions without answers to this page. If you have a 
question about how to do something in Tomcat which has not been addressed yet, 
ask the [[http://tomcat.apache.org/lists.html#tomcat-users|tomcat-user list]]. 
Once you've figured out how to fix your problem, come back and update the Wiki 
to allow the rest of us to benefit from what you've learned!
  
  == How do I set up and run Tomcat on Macintosh OS X? ==
  See [[TomcatOnMacOS]]
@@ -91, +91 @@

  
  In particular, here are a number of locations for Tomcat Connectors:
  
-  * [[http://jakarta.apache.org/tomcat/connectors-doc/index.html|Tomcat 
Connectors Documentation]]
+  * [[http://tomcat.apache.org/connectors-doc/index.html|Tomcat Connectors 
Documentation]]
-  * [[http://jakarta.apache.org/tomcat/connectors-doc/faq.html|Tomcat 
Connectors FAQ]]
+  * [[http://tomcat.apache.org/connectors-doc/miscellaneous/faq.html|Tomcat 
Connectors FAQ]]
-  * 
[[http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jk2/config/apache.html|Configuring
 Tomcat Connectors for Apache]]
+  * 
[[http://tomcat.apache.org/connectors-doc/webserver_howto/apache.html|Configuring
 Tomcat Connectors for Apache]]
+  * [[http://tomcat.apache.org/tomcat-7.0-doc/connectors.html|Connectors How 
To]]
+  * [[http://tomcat.apache.org/tomcat-7.0-doc/config/ajp.html|AJP Connector in 
Tomcat 7 Configuration Reference]]
  
  The following '''excellent''' article was written by Mladen Turk. He is a 
Developer and Consultant for JBoss Inc in Europe, where he is responsible for 
native integration. He is a long time commiter for Jakarta Tomcat Connectors, 
Apache Httpd and Apache Portable Runtime projects.
  
@@ -123, +125 @@

   1. Turn off the Java JIT compiler. See the Java Docs on how to do this.
  
  == How do I share sessions across web apps? ==
- You cannot share sessions directly across web apps, as that would be a 
violation of the Servlet Specification.  There are workarounds, including using 
a singleton class loaded from the common classloader repository to hold shared 
information, or putting some of this shared information in a database or 
another data store.  Some of these approaches have been discussed on the 
[[http://jakarta.apache.org/tomcat/faq/tomcatuser.html|tomcat-user mailing 
list]], whose archives you should search for more information.
+ You cannot share sessions directly across web apps, as that would be a 
violation of the Servlet Specification.  There are workarounds, including using 
a singleton class loaded from the common classloader repository to hold shared 
information, or putting some of this shared information in a database or 
another data store.  Some of these approaches have been discussed on the 
[[http://tomcat.apache.org/lists.html#tomcat-users|tomcat-user mailing list]], 
whose archives you should search for more information.
  
  Sharing sessions across containers for clustering or replication purposes is 
a different matter altogether.
- 
- == Why doesn't the NetBeans example build for me? ==
- I have found two issues with the build.xml provided here: 
http://jakarta.apache.org/struts/faqs/netbeans.html
- 
- First, add this to the top of your properties:
- 
- {{{
- property environment=env /
- }}}
- Next find this line in the war target:
- 
- {{{
- classes dir=${build.dir} includes=**/*.properties /
- }}}
- Change it so it reads like this:
- 
- {{{
- classes dir=${src.dir} includes=**/*.properties /
- }}}
- Now it will work!
  
  == I'm encountering classloader problems when using JNI under Tomcat ==
  The important thing to know about using JNI under Tomcat is that one cannot 
place the native libraries OR their JNI interfaces under the WEB-INF/lib or 
WEB-INF/classes directories of a web application and expect to be able to 
reload the webapp without restarting the server. The class that calls 
System.loadLibrary(String) must be loaded by a classloader that is not affected 
by reloading the web application itself.
@@ -283, +265 @@

  See HowTo/FasterStartUp
  
  == How do I contribute to Tomcat's documentation? ==
- - Download the source bundle or grab the source 

[Tomcat Wiki] Update of HowTo by KonstantinKolinko

2011-06-11 Thread Apache Wiki
Dear Wiki user,

You have subscribed to a wiki page or wiki category on Tomcat Wiki for change 
notification.

The HowTo page has been changed by KonstantinKolinko:
http://wiki.apache.org/tomcat/HowTo?action=diffrev1=101rev2=102

Comment:
Undo changes from r100 to remove spam

  
  If Eclipse happens to be your IDE of choice, you can get more information at 
[[http://www.jacoozi.com/index.php?option=com_contenttask=viewid=119Itemid=134|Remote
 Debugging with Eclipse (Jacoozi Article)]].
  
- See also:  [[http://www.pbali.com|.]][[FAQ/Developing]]
+ See also:  [[FAQ/Developing]]
  
  == How do I debug a Tomcat application when Tomcat is run as a Windows 
service ? ==
  You can debug the tomcat service by editing the service parameters as follows.

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Tomcat Wiki] Update of HowTo by KonstantinKolinko

2011-02-27 Thread Apache Wiki
Dear Wiki user,

You have subscribed to a wiki page or wiki category on Tomcat Wiki for change 
notification.

The HowTo page has been changed by KonstantinKolinko.
The comment on this change is: Correct wrong example. Add a link..
http://wiki.apache.org/tomcat/HowTo?action=diffrev1=98rev2=99

--

   * Enter the following in myapp.xml:
  
  {{{
- Context docBase=c:/workspace/myapp/WebRoot path=/HelloWorld/
+ Context docBase=c:/workspace/myapp/WebRoot /
  }}}
   . This assumes you have a web application containing WEB-INF in 
'''c:/workspace/myapp/WebRoot'''
  
@@ -460, +460 @@

   * Use your IDE to connect to Tomcat through port 1044
  
  If Eclipse happens to be your IDE of choice, you can get more information at 
[[http://www.jacoozi.com/index.php?option=com_contenttask=viewid=119Itemid=134|Remote
 Debugging with Eclipse (Jacoozi Article)]].
+ 
+ See also: [[FAQ/Developing]]
  
  == How do I debug a Tomcat application when Tomcat is run as a Windows 
service ? ==
  You can debug the tomcat service by editing the service parameters as follows.

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Tomcat Wiki] Update of HowTo by KonstantinKolinko

2010-03-28 Thread Apache Wiki
Dear Wiki user,

You have subscribed to a wiki page or wiki category on Tomcat Wiki for change 
notification.

The HowTo page has been changed by KonstantinKolinko.
The comment on this change is: Removed obsolete link from the top of the page.
http://wiki.apache.org/tomcat/HowTo?action=diffrev1=86rev2=87

--

+ TableOfContents
- '''Originally taken from: http://wiki.apache.org/jakarta-tomcat/Tomcat/Howto  
'''
- 
- 
- '''Contents''' TableOfContents
  
  
  

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org