<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Web2.0 Tutorials &#187; tomcat6</title>
	<atom:link href="http://www.zulutown.com/blog/tag/tomcat6/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.zulutown.com/blog</link>
	<description>All the Guides You Need to Become a Web2.0 Expert</description>
	<lastBuildDate>Mon, 13 Jul 2009 07:50:00 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Creating Tomcat6 Windows Services</title>
		<link>http://www.zulutown.com/blog/2009/03/12/creating-tomcat6-windows-services/</link>
		<comments>http://www.zulutown.com/blog/2009/03/12/creating-tomcat6-windows-services/#comments</comments>
		<pubDate>Thu, 12 Mar 2009 21:10:49 +0000</pubDate>
		<dc:creator>Zulutown Webmaster</dc:creator>
				<category><![CDATA[Tomcat]]></category>
		<category><![CDATA[catalina_home]]></category>
		<category><![CDATA[java_home]]></category>
		<category><![CDATA[service]]></category>
		<category><![CDATA[service.bat]]></category>
		<category><![CDATA[tomcat6]]></category>
		<category><![CDATA[tomcat_home]]></category>
		<category><![CDATA[webapps]]></category>
		<category><![CDATA[windows]]></category>
		<category><![CDATA[windows service]]></category>

		<guid isPermaLink="false">http://www.zulutown.com/blog/?p=101</guid>
		<description><![CDATA[Running the default Windows Tomcat installer a Tomcat server named Tomcat6 will be created on the Windows machine.
In the case the tomcat zipped installation file has been used, or if during the installation wizard the option for creating a Windows service hasn&#8217;t been checked, or finally, if it is required to have multiple Tomcat services [...]]]></description>
			<content:encoded><![CDATA[<p>Running the default Windows Tomcat installer a Tomcat server named <em>Tomcat6</em> will be created on the Windows machine.</p>
<p>In the case the tomcat zipped installation file has been used, or if during the installation wizard the option for creating a Windows service hasn&#8217;t been checked, or finally, if it is required to have <em>multiple Tomcat services</em> running on the server, the Tomcat features to create new services should be used.</p>
<p>Obviously it&#8217;s required to have Java installed, in this case, it&#8217;s used the JDK.</p>
<p>The following batch script will install a tomcat service named <em>YourTomcat</em> related to a <code>CATALINA_BASE</code> located in <code>c:\YourDir\YourTomcat</code>.</p>
<pre>set JAVA_HOME="c:\Program Files\Java\jdk1.6.0_12\"
set TOMCAT_HOME="c:\Program Files\Apache Software Foundation\Tomcat 6.0"
set CATALINA_BASE="c:\YourDir\YourTomcat"
call service.bat install YourTomcat</pre>
<p><code>JAVA_HOME</code> and  <code>TOMCAT_HOME</code> are obviously the places where Tomcat and Java are installed.</p>
<p>What&#8217;s the <code>CATALINA_BASE</code>? In few words, from the same Tomcat installation (located in this example in <code>c:\Program Files\Apache Software Foundation\Tomcat 6.0</code>, the <code>TOMCAT_HOME</code>) it&#8217;s possible to run more than one server instances. Each Tomcat instance has its own deployed web applications, its own logs, its own configuration and so on.</p>
<p>The <code>CATALINA_BASE</code> needs to have those directories structure:</p>
<pre>conf/
logs/
temp/
webapps/
work/</pre>
<p>In <code>conf/</code> it&#8217;s possible to copy the content of the <code>conf/</code> directory of the Tomcat installation, and obviously these files have to be customized, depending on what is required for that specific Tomcat service, i.e. the HTTP, AJP and SHUTDOWN ports, and so on.</p>
<p>In <code>logs/</code> each tomcat will write its custom <em>Catalina</em> logs or the web application specific logs (i.e. handled by Log4J).</p>
<p>In <code>temp/</code> Tomcat will obviously place temporary files.</p>
<p>In <code>webapps/</code> the web applications <code>.war</code> will be placed (and exploded).</p>
<p>in <code>work/</code> the compiled <code>.jsp</code> will be placed.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.zulutown.com/blog/2009/03/12/creating-tomcat6-windows-services/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Solving Tomcat OutOfMemoryError: Heap space and PermGen space</title>
		<link>http://www.zulutown.com/blog/2009/03/12/solving-tomcat-outofmemoryerror-heap-space-and-permgen-space/</link>
		<comments>http://www.zulutown.com/blog/2009/03/12/solving-tomcat-outofmemoryerror-heap-space-and-permgen-space/#comments</comments>
		<pubDate>Thu, 12 Mar 2009 20:44:04 +0000</pubDate>
		<dc:creator>Zulutown Webmaster</dc:creator>
				<category><![CDATA[Tomcat]]></category>
		<category><![CDATA[heap]]></category>
		<category><![CDATA[java options]]></category>
		<category><![CDATA[jvmmx]]></category>
		<category><![CDATA[jvmoptions]]></category>
		<category><![CDATA[limit]]></category>
		<category><![CDATA[maximum memory pool]]></category>
		<category><![CDATA[maxpermsize]]></category>
		<category><![CDATA[memory]]></category>
		<category><![CDATA[outofmemoryerror]]></category>
		<category><![CDATA[permgen tomcat]]></category>
		<category><![CDATA[space]]></category>
		<category><![CDATA[tomcat6]]></category>
		<category><![CDATA[tomcat6w]]></category>

		<guid isPermaLink="false">http://www.zulutown.com/blog/?p=95</guid>
		<description><![CDATA[It&#8217;s quite common to run In memory problems when running some big Java EE application on a Tomcat server.
Some of the most commmon errors are like the following ones.
This is about a full Heap space:
SEVERE: Servlet.service() for servlet jsp threw exception
java.lang.OutOfMemoryError: Java heap space
This other is about the PermGen space that&#8217;s a memory area, where [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s quite common to run In <em>memory problems</em> when running some big Java EE application on a Tomcat server.<br />
Some of the most commmon errors are like the following ones.</p>
<p>This is about a full <em>Heap space</em>:</p>
<pre>SEVERE: Servlet.service() for servlet jsp threw exception
java.lang.OutOfMemoryError: Java heap space</pre>
<p>This other is about the <em>PermGen space</em> that&#8217;s a memory area, where compiled classes (and <code>JSPs</code>) are kept, and this error might happen often if the running web application have many .java and .jsp.</p>
<pre>MemoryError: PermGen space
java.lang.OutOfMemoryError: PermGen space</pre>
<p>To increase the memory available to Tomcat, about <em>heap</em> and <em>permgen</em> the correct options are the following ones.</p>
<p>This sets the max <em>heap</em> available to Tomcat at 1Gb of memory:</p>
<pre>--JvmMx 1024</pre>
<p>This sets the max <em>permgen</em> available to Tomcat at 256Mb of memory:</p>
<pre>-XX:MaxPermSize=256m</pre>
<p>To change the Tomcat memory settings (when Tomcat is installed on Windows as <em>system service</em>), it&#8217;s required to use the command-line tool <code>tomcat6</code>. The next command changes the memory settings for the Tomcat service named <em>Tomcat6</em></p>
<pre>tomcat6 //US//Tomcat6 --JvmMx 1024 ++JvmOptions="-XX:MaxPermSize=256m"</pre>
<p>The label <code>//US//Tomcat6</code> has the meaning of <em>U</em>pdating <em>S</em>erver parameters for the service named <em>Tomcat6</em>.<br />
Obviously this command should be executed from the directory <code>C:\Program Files\Apache Software Foundation\Tomcat 6.0\bin</code> or from wherever is the <code>bin</code> directory of your Tomcat installation. Or to make things simple, that directoy should be added to your <code>PATH</code> environment variable.</p>
<p>It&#8217;s even possible to update memory settings from a GUI frontend, or to view what happened after running the command line tool. Running the following command:</p>
<pre>tomcat6w //ES//Tomcat6</pre>
<p>a window will open showing all the parameters about the windows service <em>Tomcat6</em>.</p>
<p>It&#8217;s possible to see in this image that, after running the previous command, for setting higher memory limits, in the sections <strong>Maximum memory pool</strong> and at the end of the <strong>Java Options</strong> the new memory limits are set.</p>
<div id="attachment_96" class="wp-caption alignnone" style="width: 426px"><img class="size-full wp-image-96" title="Tomcat Memory Settings on Windows" src="http://www.zulutown.com/blog/wp-content/uploads/2009/03/configuration.png" alt="Tomcat Memory Settings on Windows" width="416" height="403" /><p class="wp-caption-text">Tomcat Memory Settings on Windows</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.zulutown.com/blog/2009/03/12/solving-tomcat-outofmemoryerror-heap-space-and-permgen-space/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Setup Tomcat6 on Eclipse</title>
		<link>http://www.zulutown.com/blog/2009/01/18/setup-tomcat6-on-eclipse/</link>
		<comments>http://www.zulutown.com/blog/2009/01/18/setup-tomcat6-on-eclipse/#comments</comments>
		<pubDate>Sun, 18 Jan 2009 23:10:07 +0000</pubDate>
		<dc:creator>Zulutown Webmaster</dc:creator>
				<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Tomcat]]></category>
		<category><![CDATA[configuration]]></category>
		<category><![CDATA[ganymede]]></category>
		<category><![CDATA[tomcat6]]></category>

		<guid isPermaLink="false">http://www.zulutown.com/blog/?p=5</guid>
		<description><![CDATA[Download Eclipse IDE for Java EE Developers from http://www.eclipse.org/downloads/ and tomcat6 from http://tomcat.apache.org/download-60.cgi
Extract both of them where you prefer. I extracted Eclipse in /opt/eclipse and Tomcat in /opt/tomcat6), then run Eclipse.
When you&#8217;ll run eclipse it asks you about creating a new workspace (that will be used to store all of your projects), so create a [...]]]></description>
			<content:encoded><![CDATA[<p>Download Eclipse IDE for Java EE Developers from <a href="http://www.eclipse.org/downloads/">http://www.eclipse.org/downloads/</a> and tomcat6 from <a href="http://tomcat.apache.org/download-60.cgi">http://tomcat.apache.org/download-60.cgi</a></p>
<p>Extract both of them where you prefer. I extracted Eclipse in /opt/eclipse and Tomcat in /opt/tomcat6), then run Eclipse.</p>
<p>When you&#8217;ll run eclipse it asks you about creating a new workspace (that will be used to store all of your projects), so create a <em>workspace</em>, usually somewhere in your user home directory.</p>
<p>When Eclipse is up and running, choose <em>preferences</em> from the <em>window</em> menu. Choose from the bar on the left: Server, Runtime Environments.</p>
<div id="attachment_6" class="wp-caption aligncenter" style="width: 247px"><img class="size-medium wp-image-6" title="Preferences" src="http://www.zulutown.com/blog/wp-content/uploads/2009/01/screenshot-preferences-237x300.png" alt="Preferences window in Eclipse" width="237" height="300" /><p class="wp-caption-text">Preferences</p></div>
<p>Click the button <em>Add</em>, choose <em>Apache Tomcat 6</em>.</p>
<div id="attachment_7" class="wp-caption aligncenter" style="width: 310px"><img class="size-medium wp-image-7" title="New Server Runtime Environment" src="http://www.zulutown.com/blog/wp-content/uploads/2009/01/screenshot-new-server-runtime-environment-300x275.png" alt="New Server Runtime Environment" width="300" height="275" /><p class="wp-caption-text">New Server Runtime Environment</p></div>
<p>In the next page, <em>browse</em> on your disk and choose the directory where you previously extracted Tomcat. In my case it&#8217;s /opt/tomcat6. Finally click Finish.</p>
<div id="attachment_9" class="wp-caption aligncenter" style="width: 310px"><img class="size-medium wp-image-9" title="New Server Runtime Environment - Server Path" src="http://www.zulutown.com/blog/wp-content/uploads/2009/01/screenshot-new-server-runtime-environment-1-300x275.png" alt="New Server Runtime Environment - Server Path" width="300" height="275" /><p class="wp-caption-text">New Server Runtime Environment - Server Path</p></div>
<p>Well, until now we have just told to our workspace where Tomcat &#8220;installation&#8221; is located on our disk.</p>
<p>But, if we wish to run Java Web Applications within Eclipse, we should setup a Server and eventually assign to it a specific configuration.<br />
Go in the <em>Servers</em> view, right click and choose New, then Server.</p>
<p>Select &#8220;Tomcat v6.0 Server&#8221; as server type (or probably it will be automatically pre-selected), then, in the <em>Server Runtime environment</em> select box you&#8217;ll have to choose &#8220;Apache Tomcat v6.0&#8243; (that&#8217;s probably the only available option.</p>
<div id="attachment_39" class="wp-caption aligncenter" style="width: 310px"><img class="size-medium wp-image-39" title="New Tomcat Server in Eclipse" src="http://www.zulutown.com/blog/wp-content/uploads/2009/01/eclipse-new-tomcat-server-300x290.png" alt="New Tomcat Server in Eclipse" width="300" height="290" /><p class="wp-caption-text">New Tomcat Server in Eclipse</p></div>
<p>Click on Next, Eclipse will prompt you to eventually add (or remove) web projects from this Server, in this case, if your workspace is empty you&#8217;ll have not any project to add. So, click <em>Finish</em>.</p>
<div id="attachment_40" class="wp-caption aligncenter" style="width: 310px"><img class="size-medium wp-image-40" title="Add remove Eclipse projects from Tomcat" src="http://www.zulutown.com/blog/wp-content/uploads/2009/01/eclipse-add-remove-projects-from-tomcat-300x290.png" alt="eclipse-add-remove-projects-from-tomcat" width="300" height="290" /><p class="wp-caption-text">Add remove Eclipse projects from Tomcat</p></div>
<p>In the <em>Servers</em> panel, you will see the Tomcat you just added, and in the <em>Project Explorer</em> view, a new Server configuration will  magical appear.</p>
<p>So you can edit the configuration file <code>server.xml</code> as you prefer, change AJP or HTTP connector ports and so on, start/stop/debug the server and obviously add and remove projects from it.</p>
<div id="attachment_41" class="wp-caption aligncenter" style="width: 310px"><img class="size-medium wp-image-41" title="Editing Tomcat configuration in Eclipse" src="http://www.zulutown.com/blog/wp-content/uploads/2009/01/tomcat-configuration-300x177.png" alt="Editing Tomcat configuration in Eclipse" width="300" height="177" /><p class="wp-caption-text">Editing Tomcat configuration in Eclipse</p></div>
<p>It is also possible to add other server &#8220;instances&#8221;, just right click again in the &#8220;Servers&#8221; view, and follow the procedure described before.</p>
<p>In this way, you will just a single &#8220;Tomcat&#8221; binaries location (that you defined in the first step of this tutorial), but you&#8217;ll have the chance to add many instances of that server, each of them with its specific configuration (imagine the <code>/conf</code> directory of Tomcat) and its specific web application (imagine the <code>/webapps</code> directory).</p>
<div id="attachment_42" class="wp-caption aligncenter" style="width: 310px"><img class="size-medium wp-image-42" title="Multiple Tomcat Instances in Eclipse" src="http://www.zulutown.com/blog/wp-content/uploads/2009/01/eclipse-multiple-tomcat-instances-300x291.png" alt="Multiple Tomcat Instances in Eclipse" width="300" height="291" /><p class="wp-caption-text">Multiple Tomcat Instances in Eclipse</p></div>
<p>For the more expert ones, it is similar to have more instances on the same tomcat binaries defined on different <code>CATALINA_BASE</code> paths.</p>
<p>I hope this tutorial has been useful, please post any question or comment.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.zulutown.com/blog/2009/01/18/setup-tomcat6-on-eclipse/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
	</channel>
</rss>
