<?xml version="1.0" encoding="UTF-8"?>

<rss version="2.0"
 xmlns:blogChannel="http://backend.userland.com/blogChannelModule"
>

<channel>
<title>Parallels knowledgebase (KB)</title>
<link>http://kb.parallels.com/</link>
<description>Parallels knowledgebase (KB)</description>
<language>en</language>
<copyright>Copyright 2008 Parallels</copyright>
<pubDate>Wed, 10 Sep 2008 00:00:00 +0600</pubDate>
<lastBuildDate>Wed, 10 Sep 2008 00:00:00 +0600</lastBuildDate>
<webMaster>rt-team@parallels.com</webMaster>

<item>
<title><![CDATA[Tomcat application gets java.security exception due to some permission error.]]></title>
<link>http://kb.parallels.com/en/919</link>
<description><![CDATA[<div id="article">
	




	<div id="kb" class="kb">
		<div class="article-container">
			<h2 class="title">Tomcat application gets java.security exception due to some permission error.</h2>
			<div class="ab-frame"><div class="bl"><div class="br"><div class="tl"><div class="tr"><!-- frame -->
				<div class="articleProperty">
					<div>Article ID: 919&nbsp;</div>
					<div>Last Review: Oct,6 2008</div>
					<tr>
						<td>Author: </td>
						<td></td>
					</tr>
					<br/>
					<tr>
						<td>Last updated by: </td>
						<td>system</td>
					</tr>
				</div><!-- articleProperty -->
			</div></div></div></div></div><!-- frame -->

			<div class="article-internal-flag"></div>

			<div id="article-content">
				<div class="article-part">
					<h2>Resolution</h2>
					
Such problem usually occurs if an application tries to access some resources but it has no rights to access them due to Tomcat security settings which can be managed <span style="font-family: arial,helvetica,sans-serif;">through </span><span style="font-weight: bold; font-family: arial,helvetica,sans-serif;">$CATALINA_HOME/catalina.policy</span><span style="font-family: arial,helvetica,sans-serif;">. The errors can be realated to </span>MySQL dstsbsde connection or some file accessing. Let see typical permission errors.<br /><br /><span style="font-family: arial,helvetica,sans-serif;">1. An application cannot connect to MySQL database.  The error received: &quot;Unable to connect to any hosts due to exception: java.security.AccessControlException: access denied (java.net.SocketPermission localhost resolve)&quot;<br /><br />To allow </span><span style="font-family: arial,helvetica,sans-serif;">DOMAIN.TLD/APPLICATION/ WebApp  TCP/IP connections add the section into <span style="font-weight: bold;">catalina.policy</span>:</span><br style="font-family: arial,helvetica,sans-serif;" /><span style="font-family: arial,helvetica,sans-serif;">&nbsp;</span><br style="font-family: arial,helvetica,sans-serif;" /><span style="font-family: arial,helvetica,sans-serif;">grant codeBase  &quot;file:/var/cache/tomcat4/work/PSA/DOMAIN.TLD/APPLICATION/-&quot; {</span><br style="font-family: arial,helvetica,sans-serif;" /><span style="font-family: arial,helvetica,sans-serif;"> permission java.net.SocketPermission &quot;IP_ADDRESS&quot;, &quot;resolve, connect&quot;;</span><br style="font-family: arial,helvetica,sans-serif;" /><span style="font-family: arial,helvetica,sans-serif;">};</span><br style="font-family: arial,helvetica,sans-serif;" /><br /><br /><br /><br style="font-family: arial,helvetica,sans-serif;" /><span style="font-family: arial,helvetica,sans-serif;">Restart Tomcat service after </span><span style="font-family: arial,helvetica,sans-serif;"><span style="font-weight: bold;">catalina.policy </span>modification</span><span style="font-family: arial,helvetica,sans-serif;">.</span><br style="font-family: arial,helvetica,sans-serif;" /><br style="font-family: arial,helvetica,sans-serif;" /><span style="font-family: arial,helvetica,sans-serif;">See for more information: </span><a href="http://kb.parallels.comhttp://jakarta.apache.org/tomcat/tomcat-4.1-doc/security-manager-howto.html" style="font-family: arial,helvetica,sans-serif;">http://jakarta.apache.org/tomcat/tomcat-4.1-doc/security-manager-howto.html</a><br /><br /><br /><span style="font-family: arial,helvetica,sans-serif;">Note: for Debian the lines must be added into /etc/tomcat4/policy.d/04webapps.policy.<br />Note: Tomcat 5 has similar settings, see <a style="color: rgb(204, 153, 153);" href="http://kb.parallels.comhttp://tomcat.apache.org/tomcat-5.0-doc/security-manager-howto.html">http://tomcat.apache.org/tomcat-5.0-doc/security-manager-howto.html</a></span><span style="font-family: arial,helvetica,sans-serif; font-weight: bold;"><br /></span>
				</div>
			</div>
		</div><!-- article-container -->


			<br/><br/>

			<div id="SubscriptionLink24Article" class="subscriptionLink2">
<a href="http://kb.parallels.com/subscriptions/index.html?Type=Article&ArticleID=919&ArticleLanguage=en&Product=&Category="><img src="http://kb.parallels.com/images/mail.png" width="15" height="15" alt="Subscription for changes to this article"></a>
<a href="http://kb.parallels.com/subscriptions/index.html?Type=Article&ArticleID=919&ArticleLanguage=en&Product=&Category=">Subscription for changes to this article</a>

<script type="text/javascript">

$(document).ready(function() {
	$('#SubscriptionLink24Article a').each(function(){
		$(this).click(function(event) {
			event.preventDefault();
			MainPageContentHide();
			$('#subscription').html('');
			$.get('/Stuff/Subscription', {
													'Type' : 'Article',
													'ArticleID' : '919',
													'ArticleLanguage' : 'en',
													'Product' : '',
													'Category' : ''
												}, function(data) {
																	$('#subscription').html(data);
																	$('#subscription').show();
																	SUBbuildsubmenus_product();
																});
		});
	});
});

</script>

</div>





	</div><!-- kb -->

</div><!-- article -->


]]></description>
<guid isPermaLink="false">570 LastUpdated: 2008-10-06 09:10:51</guid>
<pubDate>2008-10-06 09:10:51</pubDate>
</item>
</channel>
</rss>



