<?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>Codedrop™ Weblog &#187; Java</title>
	<atom:link href="http://www.codedrop.ca/blog/archives/tag/java/feed" rel="self" type="application/rss+xml" />
	<link>http://www.codedrop.ca/blog</link>
	<description>Drop'n some code and other tech tidbits...</description>
	<lastBuildDate>Sun, 01 Jan 2012 07:48:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
		<item>
		<title>Use Java to disable certificate validation in an HTTPS Connection</title>
		<link>http://www.codedrop.ca/blog/archives/240</link>
		<comments>http://www.codedrop.ca/blog/archives/240#comments</comments>
		<pubDate>Thu, 22 Dec 2011 15:26:57 +0000</pubDate>
		<dc:creator>groll</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.codedrop.ca/blog/?p=240</guid>
		<description><![CDATA[By default, accessing an HTTPS URL using the URL class results in an exception if the server&#8217;s certificate chain cannot be validated has not previously been installed in the truststore. If you want to disable the validation of certificates for testing purposes, you need to override the default trust manager with one that trusts all [...]]]></description>
			<content:encoded><![CDATA[<div>
<p>By default, accessing an HTTPS URL using the URL class results in an exception if the server&#8217;s certificate chain cannot be validated has not previously been installed in the truststore.  If you want to disable the validation of certificates for testing purposes, you need to override the default trust manager with one that trusts all certificates.</p>
<div>
<pre>// Create a trust manager that does not validate certificate chains
TrustManager[] trustAllCerts = new TrustManager[]{
    new X509TrustManager() {
        public java.security.cert.X509Certificate[] getAcceptedIssuers() {
            return null;
        }
        public void checkClientTrusted(
            java.security.cert.X509Certificate[] certs, String authType) {
        }
        public void checkServerTrusted(
            java.security.cert.X509Certificate[] certs, String authType) {
        }
    }
};

// Install the all-trusting trust manager
try {
    SSLContext sc = SSLContext.getInstance("SSL");
    sc.init(null, trustAllCerts, new java.security.SecureRandom());
    HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());
} catch (Exception e) {
}

// Now you can access an https URL without having the certificate
// in the truststore
try {
    URL url = new URL("https://hostname/index.html");
} catch (MalformedURLException e) {
}</pre>
</div>
</div>
<div class="tweetthis" style="text-align:left;"><p> <a class="tt" href="http://twitter.com/home/?status=Use+Java+to+disable+certificate+validation+in+an+HTTPS+Connection+http%3A%2F%2Ftinyurl.com%2Fctoqldb" title="Post to Twitter"><img class="nothumb" src="http://www.codedrop.ca/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Use+Java+to+disable+certificate+validation+in+an+HTTPS+Connection+http%3A%2F%2Ftinyurl.com%2Fctoqldb" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.codedrop.ca/blog/archives/240/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MaxPermSize and how it relates to the overall heap</title>
		<link>http://www.codedrop.ca/blog/archives/110</link>
		<comments>http://www.codedrop.ca/blog/archives/110#comments</comments>
		<pubDate>Thu, 16 Jul 2009 19:08:38 +0000</pubDate>
		<dc:creator>groll</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Memory]]></category>

		<guid isPermaLink="false">http://www.codedrop.ca/blog/archives/110</guid>
		<description><![CDATA[Grails application throwing OutOfMemory error and PermGen space was exceeeded errors&#8230; Looks like grails applications require a fairly large permgen space&#8230; Here&#8217;s a useful&#160; article on how to address this. Tweet This Post]]></description>
			<content:encoded><![CDATA[<p>Grails application throwing OutOfMemory error and PermGen space was exceeeded errors&#8230; Looks like grails applications require a fairly large permgen space&#8230; Here&#8217;s a useful&nbsp; <a href="http://www.unixville.com/%7Emoazam/stories/2004/05/17/maxpermsizeAndHowItRelatesToTheOverallHeap.html">article</a> on how to address this. </p>
<p><font face="sans-serif"></font></p>
<p><font face="sans-serif"></font></p>
<p></p>
<div class="tweetthis" style="text-align:left;"><p> <a class="tt" href="http://twitter.com/home/?status=MaxPermSize+and+how+it+relates+to+the+overall+heap+http%3A%2F%2Ftinyurl.com%2F3qtr63u" title="Post to Twitter"><img class="nothumb" src="http://www.codedrop.ca/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=MaxPermSize+and+how+it+relates+to+the+overall+heap+http%3A%2F%2Ftinyurl.com%2F3qtr63u" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.codedrop.ca/blog/archives/110/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tips for dealing with javac OutOfMemoryError</title>
		<link>http://www.codedrop.ca/blog/archives/97</link>
		<comments>http://www.codedrop.ca/blog/archives/97#comments</comments>
		<pubDate>Fri, 12 Jun 2009 16:25:11 +0000</pubDate>
		<dc:creator>groll</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Memory]]></category>

		<guid isPermaLink="false">http://www.codedrop.ca/blog/archives/97</guid>
		<description><![CDATA[When javac is compiling a large number of java source files, it may fail with java.lang.OutOfMemoryError: The system is out of resources.Consult the following stack trace for details.java.lang.OutOfMemoryError: Java heap space It&#8217;s no different than OutOfMemoryError in other java applications. When you run javac in Sun JDK, it&#8217;s invoking com.sun.tools.javac.main.Main located in %JAVA_HOME%\lib\tools.jar. If you [...]]]></description>
			<content:encoded><![CDATA[<p>When javac is compiling a large number of java source files, it may fail with java.lang.OutOfMemoryError:</p>
<p>The system is out of resources.<br />Consult the following stack trace for details.<br />java.lang.OutOfMemoryError: Java heap space</p>
<p>It&#8217;s no different than OutOfMemoryError in other java applications. When you run javac in Sun JDK, it&#8217;s invoking com.sun.tools.javac.main.Main located in %JAVA_HOME%\lib\tools.jar.</p>
<p>If you are compiling with javac task in Apache Ant, set fork attribute to true, to run javac in a separate process with its own heap size settings. If fork is set to false, or not set (default is false), javac will run in the same process as Ant, which has a default maximum heap size of 64m.</p>
<pre>
&lt;javac fork="true"&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; srcdir="${basedir}/src"
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; destdir="${basedir}/build/classes"
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; classpath="${project.classpath}"
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; memoryinitialsize="256m"
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; memorymaximumsize="256m"&amp;gt;
&lt;/javac&gt;
</pre>
<p>Setting fork to true will also limit any memory leaks in javac implementation to its own child process, without affecting the parent Ant process.</p>
<div class="tweetthis" style="text-align:left;"><p> <a class="tt" href="http://twitter.com/home/?status=Tips+for+dealing+with+javac+OutOfMemoryError+http%3A%2F%2Ftinyurl.com%2F3zdq47l" title="Post to Twitter"><img class="nothumb" src="http://www.codedrop.ca/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Tips+for+dealing+with+javac+OutOfMemoryError+http%3A%2F%2Ftinyurl.com%2F3zdq47l" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.codedrop.ca/blog/archives/97/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

