<?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>Just wondering.... &#187; help notes</title>
	<atom:link href="http://sworddance.com/blog/category/technical/help-notes/feed/" rel="self" type="application/rss+xml" />
	<link>http://sworddance.com/blog</link>
	<description></description>
	<lastBuildDate>Tue, 17 Jan 2012 05:07:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Installing private ruby gem in rails project using heroku</title>
		<link>http://sworddance.com/blog/2011/06/17/installing-private-ruby-gem-in-rails-project-using-heroku/#utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=installing-private-ruby-gem-in-rails-project-using-heroku</link>
		<comments>http://sworddance.com/blog/2011/06/17/installing-private-ruby-gem-in-rails-project-using-heroku/#comments</comments>
		<pubDate>Fri, 17 Jun 2011 23:36:04 +0000</pubDate>
		<dc:creator>patrick</dc:creator>
				<category><![CDATA[help notes]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[technical]]></category>

		<guid isPermaLink="false">http://sworddance.com/blog/?p=980</guid>
		<description><![CDATA[If you have a private gem, deploying to heroku can be frustrating.. In my case, I do not have even a server so I am not looking (yet) to set up a private rubygem server. I just have another project &#8230; <a href="http://sworddance.com/blog/2011/06/17/installing-private-ruby-gem-in-rails-project-using-heroku/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>If you have a private gem, deploying to heroku can be frustrating.. In my case, I do not have even a server so I am not looking (yet) to set up a private rubygem server. I just have another project on my machine that I would like to reuse as a gem.</p>
<blockquote><p>Could not find gem &#8216;pgw&#8217; ( >= 0, runtime)&#8217; in any of the gem sources listed in your Gemfile</p></blockquote>
<p> I tried <a href="http://olemortenamundsen.wordpress.com/2010/09/13/working-with-private-rubygems-in-rails-3-deploying-to-heroku/">Ole Morten Amundsen&#8217;s method</a>, but it didn&#8217;t ( quite ) work (see below)</p>
<h3>Magic directory method</h3>
<ol>
<li><code>mkdir -p vendor/cache</code></li>
<li><code>bundle update</code></li>
<li><code>git add -A</code></li>
<li><code>git commit -m"whatever"</code></li>
<li><code>git push heroku master</code></li>
</ol>
<p>All the gems public or private are installed into the vendor/cache directory. </p>
<p>Pros:</p>
<ol>
<li>Simple.</li>
<li>It works.</li>
<li>Also allows for a locked down deployment  (? not completely certain on this because heroku does report &#8220;Installing &#8230;&#8221; for all the gems including the private gem)</li>
</ol>
<p>Cons:</p>
<ol>
<li>All the gems used are installed, not just the single gem that is not available on rubyforge.</li>
<li>Magicalness feels like a possible bug. (Note: I am using bundler 1.0.13) so it may not work in future</li>
<li>git bloat &#8211; all the external gems and dependencies are now part of your repo.</li>
<li>Possible issues with machine specific deployments with other gems? ( not certain about this &#8211; but flagging it as a possibility )</li>
</ol>
<h3>Ole Morten Amundsen variant</h3>
<ol>
<li><code>gem unpack pgw --target vendor/gems</code></li>
<li>edit Gemfile to explicitly list the gem version and supply the path <br/><code>gem "pgw", "0.0.3", :path =>"{#File.expand_path(__FILE__)}/../vendor/gems/"</code></li>
<li><code>bundle install --local</code></li>
<li><code>git add -A</code></li>
<li><code>git commit -m"whatever"</code></li>
<li><code>git push heroku master</code></li>
</ol>
<p>The resulting Gemfile.lock will have this:</p>
<pre><code>
PATH
  remote: vendor/gems
  specs:
    pgw (0.0.3)

GEM
...(everything else ) ...</code></pre>
<p>Pros:</p>
<ol>
<li>Feels more like the intended process</li>
<li>Only extra code is the private gem &#8216;pgw&#8217; &#8211; none of the standard ruby gems are added to the project.</li>
</ol>
<p>Cons:</p>
<ol>
<li>More typing</li>
<li>Have to include specific version number in the Gemfile &#8211; so harder to ensure against an accidental release with old version of gem.</li>
<li>&#8220;unpacking&#8221; seems lame. Is there a way to keep the &#8216;pgw&#8217; gem as a .gem file?</li>
</ol>
<h3>Questions</h3>
<ol>
<li>Is there an easy way to move the gems to my master project other than <code>gem unpack</code>?</li>
<li>should the gem be put in <code>vendor/bundle</code> since that is the default <code>BUNDLE_PATH</code>?</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://sworddance.com/blog/2011/06/17/installing-private-ruby-gem-in-rails-project-using-heroku/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to do variable/conditional SQL sorting order of results</title>
		<link>http://sworddance.com/blog/2010/07/25/how-to-do-variableconditional-sql-sorting-order-of-results/#utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-do-variableconditional-sql-sorting-order-of-results</link>
		<comments>http://sworddance.com/blog/2010/07/25/how-to-do-variableconditional-sql-sorting-order-of-results/#comments</comments>
		<pubDate>Sun, 25 Jul 2010 18:48:49 +0000</pubDate>
		<dc:creator>patrick</dc:creator>
				<category><![CDATA[help notes]]></category>
		<category><![CDATA[technical]]></category>

		<guid isPermaLink="false">http://www.sworddance.com/blog/?p=657</guid>
		<description><![CDATA[I was jazzed today. I figured out how to conditional order of SQL results. Specifically being able to vary change the sorting order within the results based on a database field. Specifically, Create two tables Main and Secondary create table &#8230; <a href="http://sworddance.com/blog/2010/07/25/how-to-do-variableconditional-sql-sorting-order-of-results/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I was jazzed today. I figured out how to conditional order of SQL results. Specifically being able to vary change the sorting order within the results based on a database field. </p>
<p>Specifically, </p>
<ol>
<li>Create two tables <em>Main</em> and <em>Secondary</em>
<ul>
<li><code>create table Main ( ID bigint, ordering varchar(3));</code></li>
<li><code>create table Secondary ( Main_ID bigint, Secondary_Value bigint);</code></li>
</ul>
<li>Insert Values:
<ul>
<li><code>insert into Main (ID, ordering) values (1, 'u'),(2,'d'),(3,'n');</code></li>
<li><code>insert into Secondary (Main_ID, Secondary_Value) values ( 1, 11),(1,21),(1,41),(1,31),(1,71),(1,61),(1,51),(2,62),(2,42),(2,82), ( 3,3), (3, 1), (3, 5);</code></li>
</ul>
</li>
<li>Create a query that orders the results by Main.ID, Secondary.Secondary_Value based on Main.ordering value. If the Main.ordering is:
<ul>
<li>&#8216;u&#8217; then the corresponding Secondary_Value is ordered ascending,</li>
<li>&#8216;d&#8217; then the corresponding Secondary_Value is ordered descending,</li>
<li>&#8216;n&#8217; then the corresponding Secondary_Value is unordered</li>
</ul>
</li>
</ol>
<p>The solution is:</p>
<blockquote><p><code>select * from Main join Secondary on ( Main.ID = Secondary.Main_ID ) order by Main.ID, (case MAIN.ordering when 'u' then 1 when 'd' then -1 else 0 end) * Secondary.Secondary_Value;</code></p></blockquote>
<pre>
+------+----------+---------+-----------------+
| ID   | ordering | Main_ID | Secondary_Value |
+------+----------+---------+-----------------+
|    1 | u        |       1 |              11 |
|    1 | u        |       1 |              21 |
|    1 | u        |       1 |              31 |
|    1 | u        |       1 |              41 |
|    1 | u        |       1 |              51 |
|    1 | u        |       1 |              61 |
|    1 | u        |       1 |              71 |
|    2 | d        |       2 |              82 |
|    2 | d        |       2 |              62 |
|    2 | d        |       2 |              42 |
|    3 | n        |       3 |               1 |
|    3 | n        |       3 |               5 |
|    3 | n        |       3 |               3 |
+------+----------+---------+-----------------+
13 rows in set (0.00 sec)
</pre>
<p>Variable ordering within a single result set! woo-hoo!</p>
]]></content:encoded>
			<wfw:commentRss>http://sworddance.com/blog/2010/07/25/how-to-do-variableconditional-sql-sorting-order-of-results/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>&#8230; and I nailed the javadoc</title>
		<link>http://sworddance.com/blog/2010/01/07/and-i-nailed-the-javadoc/#utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=and-i-nailed-the-javadoc</link>
		<comments>http://sworddance.com/blog/2010/01/07/and-i-nailed-the-javadoc/#comments</comments>
		<pubDate>Thu, 07 Jan 2010 18:44:08 +0000</pubDate>
		<dc:creator>patrick</dc:creator>
				<category><![CDATA[help notes]]></category>
		<category><![CDATA[technical]]></category>

		<guid isPermaLink="false">http://www.sworddance.com/blog/?p=563</guid>
		<description><![CDATA[Yesterday was a red letter day. I found multiple bugs in the javac and javadoc. (1.6.0_17) This javadoc issue occurred when there is a class that has no package line ( it is in the default package). Annoyingly enough it &#8230; <a href="http://sworddance.com/blog/2010/01/07/and-i-nailed-the-javadoc/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Yesterday was a red letter day. I found multiple bugs in the javac and javadoc. (1.6.0_17)</p>
<p>This javadoc issue occurred when there is a class that has no package line ( it is in the default package). Annoyingly enough it occurred when I was trying to create a test case for <a href="http://www.sworddance.com/blog/2010/01/07/woot-i-crashed-the-javac/">this javac</a> bug. I was running maven 2.2.1 at the time.<br />
<code>
<pre>
java.lang.NullPointerException
       at com.sun.tools.doclets.formats.html.PackageUseWriter.generatePackageUse(PackageUseWriter.java:180)
       at com.sun.tools.doclets.formats.html.PackageUseWriter.generatePackageList(PackageUseWriter.java:124)
       at com.sun.tools.doclets.formats.html.PackageUseWriter.generatePackageUse(PackageUseWriter.java:110)
       at com.sun.tools.doclets.formats.html.PackageUseWriter.generatePackageUseFile(PackageUseWriter.java:99)
       at com.sun.tools.doclets.formats.html.PackageUseWriter.generate(PackageUseWriter.java:78)
       at com.sun.tools.doclets.formats.html.ClassUseWriter.generate(ClassUseWriter.java:116)
       at com.sun.tools.doclets.formats.html.HtmlDoclet.generateOtherFiles(HtmlDoclet.java:92)
       at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.startGeneration(AbstractDoclet.java:122)
       at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.start(AbstractDoclet.java:64)
       at com.sun.tools.doclets.formats.html.HtmlDoclet.start(HtmlDoclet.java:42)
       at com.sun.tools.doclets.standard.Standard.start(Standard.java:23)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:597)
       at com.sun.tools.javadoc.DocletInvoker.invoke(DocletInvoker.java:269)
       at com.sun.tools.javadoc.DocletInvoker.start(DocletInvoker.java:143)
       at com.sun.tools.javadoc.Start.parseAndExecute(Start.java:340)
       at com.sun.tools.javadoc.Start.begin(Start.java:128)
       at com.sun.tools.javadoc.Main.execute(Main.java:41)
       at com.sun.tools.javadoc.Main.main(Main.java:31)
</pre>
<p></code></p>
<p>Solution was to put the java code into a package.</p>
]]></content:encoded>
			<wfw:commentRss>http://sworddance.com/blog/2010/01/07/and-i-nailed-the-javadoc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Woot! I crashed the javac</title>
		<link>http://sworddance.com/blog/2010/01/07/woot-i-crashed-the-javac/#utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=woot-i-crashed-the-javac</link>
		<comments>http://sworddance.com/blog/2010/01/07/woot-i-crashed-the-javac/#comments</comments>
		<pubDate>Thu, 07 Jan 2010 18:35:10 +0000</pubDate>
		<dc:creator>patrick</dc:creator>
				<category><![CDATA[help notes]]></category>
		<category><![CDATA[technical]]></category>

		<guid isPermaLink="false">http://www.sworddance.com/blog/?p=556</guid>
		<description><![CDATA[My javac crash: An exception has occurred in the compiler (1.6.0_17). Please file a bug at the Java Developer Connection (http://java.sun.com/webapps/bugreport) after checking the Bug Parade for duplicates. Include your program and the following diagnostic in your report. Thank you. &#8230; <a href="http://sworddance.com/blog/2010/01/07/woot-i-crashed-the-javac/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>My javac crash:</p>
<p><code>An exception has occurred in the compiler (1.6.0_17). Please file a bug at the Java Developer Connection (http://java.sun.com/webapps/bugreport)  after checking the Bug Parade for duplicates. Include your program and the following diagnostic in your report.  Thank you.</p>
<pre>
java.lang.AssertionError: isSubtype 15 ( 15 = TypeTags.WILDCARD )
	at com.sun.tools.javac.code.Types$5.visitType(Types.java:347)
	at com.sun.tools.javac.code.Types$5.visitType(Types.java:328)
	at com.sun.tools.javac.code.Types$DefaultTypeVisitor.visitWildcardType(Types.java:3163)
	at com.sun.tools.javac.code.Type$WildcardType.accept(Type.java:416)
	at com.sun.tools.javac.code.Types$DefaultTypeVisitor.visit(Types.java:3161)
	at com.sun.tools.javac.code.Types.isSubtype(Types.java:324)
	at com.sun.tools.javac.code.Types.isSubtype(Types.java:308)
	at com.sun.tools.javac.code.Types.isSubtypeUnchecked(Types.java:288)
	at com.sun.tools.javac.code.Types.isSubtypeUnchecked(Types.java:460)
	at com.sun.tools.javac.comp.Infer.checkWithinBounds(Infer.java:388)
	at com.sun.tools.javac.comp.Infer.instantiateExpr(Infer.java:241)
	at com.sun.tools.javac.comp.Check.instantiatePoly(Check.java:356)
	at com.sun.tools.javac.comp.Check.checkType(Check.java:324)
	at com.sun.tools.javac.comp.Attr.check(Attr.java:160)
	at com.sun.tools.javac.comp.Attr.visitApply(Attr.java:1276)
	at com.sun.tools.javac.tree.JCTree$JCMethodInvocation.accept(JCTree.java:1210)
	at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:360)
	at com.sun.tools.javac.comp.Attr.attribExpr(Attr.java:377)
	at com.sun.tools.javac.comp.Attr.visitAssign(Attr.java:1550)
	at com.sun.tools.javac.tree.JCTree$JCAssign.accept(JCTree.java:1342)
	at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:360)
	at com.sun.tools.javac.comp.Attr.attribExpr(Attr.java:384)
	at com.sun.tools.javac.comp.Attr.visitExec(Attr.java:1017)
	at com.sun.tools.javac.tree.JCTree$JCExpressionStatement.accept(JCTree.java:1074)
	at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:360)
	at com.sun.tools.javac.comp.Attr.attribStat(Attr.java:397)
	at com.sun.tools.javac.comp.Attr.attribStats(Attr.java:413)
	at com.sun.tools.javac.comp.Attr.visitBlock(Attr.java:715)
	at com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:739)
	at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:360)
	at com.sun.tools.javac.comp.Attr.attribStat(Attr.java:397)
	at com.sun.tools.javac.comp.Attr.visitIf(Attr.java:1009)
	at com.sun.tools.javac.tree.JCTree$JCIf.accept(JCTree.java:1050)
	at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:360)
	at com.sun.tools.javac.comp.Attr.attribStat(Attr.java:397)
	at com.sun.tools.javac.comp.Attr.attribStats(Attr.java:413)
	at com.sun.tools.javac.comp.Attr.visitBlock(Attr.java:715)
	at com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:739)
	at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:360)
	at com.sun.tools.javac.comp.Attr.attribStat(Attr.java:397)
	at com.sun.tools.javac.comp.Attr.visitForLoop(Attr.java:740)
	at com.sun.tools.javac.tree.JCTree$JCForLoop.accept(JCTree.java:818)
	at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:360)
	at com.sun.tools.javac.comp.Attr.attribStat(Attr.java:397)
	at com.sun.tools.javac.comp.Attr.attribStats(Attr.java:413)
	at com.sun.tools.javac.comp.Attr.visitBlock(Attr.java:715)
	at com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:739)
	at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:360)
	at com.sun.tools.javac.comp.Attr.attribStat(Attr.java:397)
	at com.sun.tools.javac.comp.Attr.visitIf(Attr.java:1009)
	at com.sun.tools.javac.tree.JCTree$JCIf.accept(JCTree.java:1050)
	at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:360)
	at com.sun.tools.javac.comp.Attr.attribStat(Attr.java:397)
	at com.sun.tools.javac.comp.Attr.attribStats(Attr.java:413)
	at com.sun.tools.javac.comp.Attr.visitBlock(Attr.java:715)
	at com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:739)
	at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:360)
	at com.sun.tools.javac.comp.Attr.attribStat(Attr.java:397)
	at com.sun.tools.javac.comp.Attr.visitIf(Attr.java:1009)
	at com.sun.tools.javac.tree.JCTree$JCIf.accept(JCTree.java:1050)
	at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:360)
	at com.sun.tools.javac.comp.Attr.attribStat(Attr.java:397)
	at com.sun.tools.javac.comp.Attr.attribStats(Attr.java:413)
	at com.sun.tools.javac.comp.Attr.visitBlock(Attr.java:715)
	at com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:739)
	at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:360)
	at com.sun.tools.javac.comp.Attr.attribStat(Attr.java:397)
	at com.sun.tools.javac.comp.Attr.visitMethodDef(Attr.java:634)
	at com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:639)
	at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:360)
	at com.sun.tools.javac.comp.Attr.attribStat(Attr.java:397)
	at com.sun.tools.javac.comp.Attr.attribClassBody(Attr.java:2697)
	at com.sun.tools.javac.comp.Attr.attribClass(Attr.java:2628)
	at com.sun.tools.javac.comp.Attr.attribClass(Attr.java:2564)
	at com.sun.tools.javac.main.JavaCompiler.attribute(JavaCompiler.java:1036)
	at com.sun.tools.javac.main.JavaCompiler.compile2(JavaCompiler.java:765)
	at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:730)
	at com.sun.tools.javac.main.Main.compile(Main.java:353)
	at com.sun.tools.javac.main.Main.compile(Main.java:279)
	at com.sun.tools.javac.main.Main.compile(Main.java:270)
	at com.sun.tools.javac.Main.compile(Main.java:69)
	at com.sun.tools.javac.Main.main(Main.java:54)
</pre>
<p></code></p>
<p>I was not successful at reducing this crash to a simple test case.</p>
<p>However, the line that triggered the crash was:</p>
<p><code></p>
<blockquote><p>ProxyMapperImplementor&lt;?,?> childProxy = this;</p></blockquote>
<p></code></p>
<p>Some points:</p>
<ul>
<li><a href="http://www.sworddance.com/blog/2010/01/06/generic-annoyances-in-java/">Once again</a> (<a href="http://www.sworddance.com/blog/2007/08/13/explain-this/">and again</a>) the eclipse compiler is more robust than the sun javac</li>
<li>ProxyMapperImplementor is defined as:<br />
<code><br />
<blockquote>interface ProxyMapperImplementor&lt;I, O extends I></p></blockquote>
<p></code></li>
<li>Removing the wildcards so the line looks like solved the problem:<code><br />
<blockquote><p>ProxyMapperImplementor childProxy = this;</p></blockquote>
<p></code></p>
<p>Update (email from sun):</p>
<blockquote><p>This issue is related to Bug ID: 6738538. You can review this bug at:</p>
<p>http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6738538</p>
<p>This problem has been fixed in Java SE 7.0. Consider downloading a free copy at http://download.java.net/jdk7/binaries/ and checking if the problem persists. If the problem persists do let us know and we shall investigate this furthur.</p>
<p>We greatly appreciate your efforts in identifying areas in the Java Standard Edition where we can improve upon and I would request you to continue doing so.</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://sworddance.com/blog/2010/01/07/woot-i-crashed-the-javac/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Generic annoyances in java</title>
		<link>http://sworddance.com/blog/2010/01/06/generic-annoyances-in-java/#utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=generic-annoyances-in-java</link>
		<comments>http://sworddance.com/blog/2010/01/06/generic-annoyances-in-java/#comments</comments>
		<pubDate>Thu, 07 Jan 2010 01:14:31 +0000</pubDate>
		<dc:creator>patrick</dc:creator>
				<category><![CDATA[help notes]]></category>
		<category><![CDATA[technical]]></category>

		<guid isPermaLink="false">http://www.sworddance.com/blog/?p=548</guid>
		<description><![CDATA[For some reason, the type variable &#60;O> cannot flow through from an external caller through a callee to another called method. This compiles just fine in eclipse, but once again sun&#8217;s javac is temperamental. The three solutions seem to be: &#8230; <a href="http://sworddance.com/blog/2010/01/06/generic-annoyances-in-java/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>For some reason, the type variable &lt;O> cannot flow through from an external caller through a callee to another called method.</p>
<p>This compiles just fine in eclipse, but <a href="http://www.sworddance.com/blog/2007/08/13/explain-this/">once again sun&#8217;s javac is temperamental.</a> </p>
<p>The three solutions seem to be:</p>
<ol>
<li>pass an object of type &lt;O> to the subcallee method (m0(), p0() )</li>
<li>use wildcard instead of &lt;O> &#8211; which is o.k. if O is not needed in the body of the method</li>
<li>assign to a variable with no generic information (universal backup solution to java generic wierdness)</li>
</ol>
<p>I filed a bug with Sun.</p>
<p>(Technical details: javac 1.6.0_17 )</p>
<p><code></p>
<pre>public class Foo {
    public <I, O extends I, R extends FooInterface<I, O>> I m(I i) {
/*line3*/        R r = (R) p(i);
        return i;
    }
    public <I, O extends I, R extends FooInterface<I, O>> R p(I i) {
        return null;
    }

    public <I, O extends I, K extends FooInterface<I, O>> I m0(O o) {
        K r= (K) p0(o);
        return o;
    }
    public <I, O extends I, K extends FooInterface<I, O>> K p0(O o) {
        return null;
    }

    public <I, K extends FooInterface<I, ? extends I>> I m1(I i) {
        K r= (K) p1(i);
        return i;
    }
    public <I, K extends FooInterface<I, ? extends I>> K p1(I i) {
        return null;
    }

    public <I, K extends FooInterface<I, ? extends I>> I m2(I i) {
/*line 27*/        K r= (K) p2(i);
        return i;
    }
    public <I, O extends I, K extends FooInterface<I, O>> K p2(I i) {
        return null;
    }
    interface FooInterface<I, O extends I> {

    }
}
</pre>
<p></code></p>
<p><code>Foo.java:3: incompatible types; inferred type argument(s) I,java.lang.Object do not conform to bounds of type variable(s) O,R<br />
found   : <O,R>R<br />
required: java.lang.Object<br />
/*line3*/        R r = (R) p(i);<br />
                            ^<br />
Foo.java:27: incompatible types; inferred type argument(s) I,java.lang.Object do not conform to bounds of type variable(s) O,K<br />
found   : <O,K>K<br />
required: java.lang.Object<br />
        K r= (K) p2(i);<br />
                   ^</code></p>
]]></content:encoded>
			<wfw:commentRss>http://sworddance.com/blog/2010/01/06/generic-annoyances-in-java/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>MacOSX and hostname</title>
		<link>http://sworddance.com/blog/2009/01/15/macosx-and-hostname/#utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=macosx-and-hostname</link>
		<comments>http://sworddance.com/blog/2009/01/15/macosx-and-hostname/#comments</comments>
		<pubDate>Thu, 15 Jan 2009 19:37:47 +0000</pubDate>
		<dc:creator>patrick</dc:creator>
				<category><![CDATA[help notes]]></category>
		<category><![CDATA[technical]]></category>

		<guid isPermaLink="false">http://www.sworddance.com/blog/?p=295</guid>
		<description><![CDATA[h/t Larry Gordon (copied because I want to make sure I always have it available): When I log into the network at my job my Mac’s hostname always turns to: larryx.na.corp.ipgnetwork.com I have my local hostname set to: larryx.local So &#8230; <a href="http://sworddance.com/blog/2009/01/15/macosx-and-hostname/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.psyrendust.com/2008/05/23/change-the-hostname-in-mac-os-x-osx/">h/t Larry Gordon</a> (copied because I want to make sure I always have it available):</p>
<blockquote><p>
When I log into the network at my job my Mac’s hostname always turns to:</p>
<p><code>larryx.na.corp.ipgnetwork.com</code></p>
<p>I have my local hostname set to:</p>
<p><code>larryx.local</code></p>
<p>So What I would like to do is set my Mac’s hostname to my local hostname. You can do this all from Terminal in a single line.</p>
<p>Run this command in Terminal:</p>
<p><code>sudo scutil --set HostName larryx.local</code>
</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://sworddance.com/blog/2009/01/15/macosx-and-hostname/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Website performance tips</title>
		<link>http://sworddance.com/blog/2008/05/09/website-performance-tips/#utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=website-performance-tips</link>
		<comments>http://sworddance.com/blog/2008/05/09/website-performance-tips/#comments</comments>
		<pubDate>Sat, 10 May 2008 07:29:21 +0000</pubDate>
		<dc:creator>patrick</dc:creator>
				<category><![CDATA[help notes]]></category>

		<guid isPermaLink="false">http://www.sworddance.com/blog/?p=142</guid>
		<description><![CDATA[Yahoo website performance tips]]></description>
			<content:encoded><![CDATA[<p><a href="http://developer.yahoo.com/performance/rules.html">Yahoo website performance tips</a></p>
]]></content:encoded>
			<wfw:commentRss>http://sworddance.com/blog/2008/05/09/website-performance-tips/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>where, oh where is the list of all those magic -XX java parameters?</title>
		<link>http://sworddance.com/blog/2008/01/10/where-oh-where-is-the-list-of-all-those-magic-xx-java-parameters/#utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=where-oh-where-is-the-list-of-all-those-magic-xx-java-parameters</link>
		<comments>http://sworddance.com/blog/2008/01/10/where-oh-where-is-the-list-of-all-those-magic-xx-java-parameters/#comments</comments>
		<pubDate>Fri, 11 Jan 2008 01:18:27 +0000</pubDate>
		<dc:creator>patrick</dc:creator>
				<category><![CDATA[help notes]]></category>

		<guid isPermaLink="false">http://www.sworddance.com/blog/2008/01/10/where-oh-where-is-the-list-of-all-those-magic-xx-java-parameters/</guid>
		<description><![CDATA[The master list is here. But just in case it goes away here is the list (pruned for java 6): Option and Default Value Description -XX:-AllowUserSignalHandlers Do not complain if the application installs signal handlers. (Relevant to Solaris and Linux &#8230; <a href="http://sworddance.com/blog/2008/01/10/where-oh-where-is-the-list-of-all-those-magic-xx-java-parameters/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>The master list is <a href="http://java.sun.com/javase/technologies/hotspot/vmoptions.jsp">here</a>.</p>
<p>But just in case it goes away here is the list (pruned for java 6):</p>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<th valign="top" width="45%" align="left">Option and Default Value</th>
<th valign="top" width="55%" align="left">Description</th>
</tr>
<tr valign="top">
<td>-XX:-AllowUserSignalHandlers</td>
<td>Do not complain if the application installs signal handlers. (Relevant to Solaris and Linux only.)</td>
</tr>
<tr valign="top">
<td>-XX:-DisableExplicitGC</td>
<td>Disable calls to System.gc(), JVM still performs garbage collection when necessary.</td>
</tr>
<tr valign="top">
<td>-XX:+FailOverToOldVerifier</td>
<td>Fail over to old verifier when the new type checker fails. (Introduced in 6.)</td>
</tr>
<tr valign="top">
<td>-XX:+HandlePromotionFailure</td>
<td>The youngest generation collection does not require a guarantee of full promotion of all live objects. (Introduced in 1.4.2 update 11) [5.0 and earlier: false.]</td>
</tr>
<tr valign="top">
<td>-XX:+MaxFDLimit</td>
<td>Bump the number of file descriptors to max. (Relevant to Solaris only.)</td>
</tr>
<tr valign="top">
<td>-XX:PreBlockSpin=10</td>
<td>Spin count variable for use with -XX:+UseSpinning. Controls the maximum spin iterations allowed before entering operating system thread synchronization code. (Introduced in 1.4.2.)</td>
</tr>
<tr valign="top">
<td>-XX:-RelaxAccessControlCheck</td>
<td>Relax the access control checks in the verifier. (Introduced in 6.)</td>
</tr>
<tr valign="top">
<td>-XX:+ScavengeBeforeFullGC</td>
<td>Do young generation GC prior to a full GC. (Introduced in 1.4.1.)</td>
</tr>
<tr valign="top">
<td>-XX:+UseAltSigs</td>
<td>Use alternate signals instead of SIGUSR1 and SIGUSR2 for VM internal signals. (Introduced in 1.3.1 update 9, 1.4.1. Relevant to Solaris only.)</td>
</tr>
<tr valign="top">
<td>-XX:+UseBoundThreads</td>
<td>Bind user level threads to kernel threads. (Relevant to Solaris only.)</td>
</tr>
<tr valign="top">
<td>-XX:-UseConcMarkSweepGC</td>
<td>Use concurrent mark-sweep collection for the old generation. (Introduced in 1.4.1)</td>
</tr>
<tr valign="top">
<td>-XX:+UseGCOverheadLimit</td>
<td>Use a policy that limits the proportion of the VM&#8217;s time that is spent in GC before an OutOfMemory error is thrown. (Introduced in 6.)</td>
</tr>
<tr valign="top">
<td>-XX:+UseLWPSynchronization</td>
<td>Use LWP-based instead of thread based synchronization. (Introduced in 1.4.0. Relevant to Solaris only.)</td>
</tr>
<tr valign="top">
<td>-XX:-UseParallelGC</td>
<td>Use parallel garbage collection for scavenges. (Introduced in 1.4.1)</td>
</tr>
<tr valign="top">
<td>-XX:-UseParallelOldGC</td>
<td>Use parallel garbage collection for the full collections. Enabling this option automatically sets -XX:+UseParallelGC. (Introduced in 5.0 update 6.)</td>
</tr>
<tr valign="top">
<td>-XX:-UseSerialGC</td>
<td>Use serial garbage collection. (Introduced in 5.0.)</td>
</tr>
<tr valign="top">
<td>-XX:+UseTLAB</td>
<td>Use thread-local object allocation (Introduced in 1.4.0, known as UseTLE prior to that.) [1.4.2 and earlier, x86 or with -client: false]</td>
</tr>
<tr valign="top">
<td>-XX:+UseSplitVerifier</td>
<td>Use the new<br />
type checker with StackMapTable attributes. (Introduced in 5.0.)[5.0: false]</td>
</tr>
<tr valign="top">
<td>-XX:+UseThreadPriorities</td>
<td>Use native thread priorities.</td>
</tr>
<tr valign="top">
<td>-XX:+UseVMInterruptibleIO</td>
<td>Thread interrupt before or with EINTR for I/O operations results in OS_INTRPT. (Introduced in 6. Relevant to Solaris only.)</td>
</tr>
</table>
<hr class="light">
<h4><a name="PerformanceTuning"></a>Performance Options</h4>
<p></p>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<th valign="top" width="45%" align="left">Option and Default Value</th>
<th valign="top" width="55%" align="left">Description</th>
</tr>
<tr valign="top">
<td>-XX:+AggressiveOpts</td>
<td>Turn on point performance compiler optimizations that are expected to be default in upcoming releases. (Introduced in 5.0 update 6.)</td>
</tr>
<tr valign="top">
<td>-XX:CompileThreshold=10000</td>
<td>Number of method invocations/branches before compiling [-client: 1,500]</td>
</tr>
<tr valign="top">
<td>-XX:LargePageSizeInBytes=4m</td>
<td>Sets the large page size used for the Java heap. (Introduced in 1.4.0 update 1.) [amd64: 2m.]</td>
</tr>
<tr valign="top">
<td>-XX:MaxHeapFreeRatio=70</td>
<td>Maximum percentage of heap free after GC to avoid shrinking.</td>
</tr>
<tr valign="top">
<td>-XX:MaxNewSize=size</td>
<td>Maximum size of new generation (in bytes). Since 1.4, MaxNewSize is computed as a function of NewRatio. [1.3.1 Sparc: 32m; 1.3.1 x86:2.5m.]</td>
</tr>
<tr valign="top">
<td>-XX:MaxPermSize=64m</td>
<td>Size of the Permanent Generation.&nbsp; [5.0 and newer: 64 bit VMs are scaled 30% larger; 1.4 amd64: 96m; 1.3.1 -client: 32m.]</td>
</tr>
<tr valign="top">
<td>-XX:MinHeapFreeRatio=40</td>
<td>Minimum percentage of heap free after GC to avoid expansion.</td>
</tr>
<tr valign="top">
<td>-XX:NewRatio=2</td>
<td>Ratio of new/old generation sizes. [Sparc -client: 8; x86 -server: 8; x86-client: 12.]-client: 4 (1.3) 8 (1.3.1+), x86: 12]</td>
</tr>
<tr valign="top">
<td>-XX:NewSize=2.125m</td>
<td>Default size of new generation (in bytes) [5.0 and newer: 64 bit VMs are scaled 30% larger; x86: 1m; x86, 5.0 and older: 640k]</td>
</tr>
<tr valign="top">
<td>-XX:ReservedCodeCacheSize=32m</td>
<td>Reserved code cache size (in bytes) &#8211; maximum code cache size. [Solaris 64-bit, amd64, and -server x86: 48m; in 1.5.0_06 and earlier, Solaris 64-bit and and64: 1024m.]</td>
</tr>
<tr valign="top">
<td>-XX:SurvivorRatio=8</td>
<td>Ratio of eden/survivor space size [Solaris amd64: 6; Sparc in 1.3.1: 25; other Solaris platforms in 5.0 and earlier: 32]</td>
</tr>
<tr valign="top">
<td>-XX:TargetSurvivorRatio=50</td>
<td>Desired percentage of survivor space used after scavenge.</td>
</tr>
<tr valign="top">
<td>-XX:ThreadStackSize=512</td>
<td>Thread Stack Size (in Kbytes). (0 means use default stack size) [Sparc: 512; Solaris x86: 320 (was 256 prior in 5.0 and earlier); Sparc 64 bit: 1024; Linux amd64: 1024 (was 0 in 5.0 and earlier); all others 0.]</td>
</tr>
<tr valign="top">
<td>-XX:+UseBiasedLocking</td>
<td>Enable biased locking. For more details, see this <a href="http://java.sun.com/performance/reference/whitepapers/tuning.html#section4.2.5">tuning example</a>. (Introduced in 5.0 update 6.) [5.0: false]
</td>
</tr>
<tr valign="top">
<td>-XX:+UseFastAccessorMethods</td>
<td>Use optimized versions of Get&lt;Primitive&gt;Field.</td>
</tr>
<tr valign="top">
<td>-XX:-UseISM</td>
<td>Use Intimate Shared Memory. [Not accepted for non-Solaris platforms.] For details, see <a href="http://java.sun.com/docs/hotspot/ism.html">Intimate Shared Memory</a>.</td>
</tr>
<tr valign="top">
<td>-XX:+UseLargePages</td>
<td>Use large page memory. (Introduced in 5.0 update 5.) For details, see <a href="http://java.sun.com/javase/technologies/hotspot/largememory.jsp">Java Support for Large Memory Pages</a>.</td>
</tr>
<tr valign="top">
<td>-XX:+UseMPSS</td>
<td>Use Multiple Page Size Support w/4mb pages for the heap. Do not use with ISM as this replaces the need for ISM. (Introduced in 1.4.0 update 1, Relevant to Solaris 9 and newer.) [1.4.1 and earlier: false]</td>
</tr>
</table>
<hr class="light">
<h4><a name="DebuggingOptions">Debugging Options</a></h4>
<p><span class="sp10"></p>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr valign="top">
<th valign="top" width="45%" align="left">Option and Default Value
</th>
<th valign="top" width="55%" align="left">Description</th>
</tr>
<tr valign="top">
<td>-XX:-CITime</td>
<td>Prints time spent in JIT Compiler. (Introduced in 1.4.0.)</td>
</tr>
<tr valign="top">
<td>-XX:ErrorFile=./hs_err_pid&lt;pid&gt;.log</td>
<td>If an error occurs, save the error data to this file. (Introduced in 6.)</td>
</tr>
<tr valign="top">
<td>-XX:-ExtendedDTraceProbes</td>
<td>Enable performance-impacting <a href="http://java.sun.com/javase/6/docs/technotes/guides/vm/dtrace.html">dtrace</a> probes. (Introduced in 6.<br />
Relevant to Solaris only.)</td>
</tr>
<tr valign="top">
<td>-XX:HeapDumpPath=./java_pid&lt;pid&gt;.hprof</td>
<td>Path to directory or filename for heap dump. <i>Manageable</i>.<br />
(Introduced in 1.4.2 update 12, 5.0 update 7.)</td>
</tr>
<tr valign="top">
<td>-XX:-HeapDumpOnOutOfMemoryError</td>
<td>Dump heap to file when java.lang.OutOfMemoryError is thrown. <i>Manageable</i>.<br />
(Introduced in 1.4.2 update 12, 5.0 update 7.)</td>
</tr>
<tr valign="top">
<td>-XX:OnError=&#8221;&lt;cmd args&gt;;&lt;cmd args&gt;&#8221;</td>
<td>Run user-defined commands on fatal error.</td>
</tr>
<tr valign="top">
<td>-XX:OnOutOfMemoryError=&#8221;&lt;cmd args&gt;;<br />&lt;cmd args&gt;&#8221;</td>
<td>Run user-defined commands when an OutOfMemoryError is first thrown.</td>
</tr>
<tr valign="top">
<td>-XX:-PrintClassHistogram</td>
<td>Print a histogram of class instances on Ctrl-Break. <i>Manageable</i>. (Introduced in 1.4.2.) The <a href="http://java.sun.com/javase/6/docs/technotes/tools/share/jmap.html">jmap -histo</a> command provides equivalent functionality.</td>
</tr>
<tr valign="top">
<td>-XX:-PrintConcurrentLocks</td>
<td>Print java.util.concurrent locks in Ctrl-Break thread dump. <i>Manageable</i>.<br />
(Introduced in 6.) The <a href="http://java.sun.com/javase/6/docs/technotes/tools/share/jstack.html">jstack -l</a> command provides equivalent functionality.</td>
</tr>
<tr valign="top">
<td>-XX:-PrintCommandLineFlags</td>
<td>Print flags that appeared on the command line. (Introduced in 5.0.)</td>
</tr>
<tr valign="top">
<td>-XX:-PrintCompilation</td>
<td>Print message when a method is compiled.</td>
</tr>
<tr valign="top">
<td>-XX:-PrintGC</td>
<td>Print messages at garbage collection. <i>Manageable</i>.</td>
</tr>
<tr valign="top">
<td>-XX:-PrintGCDetails</td>
<td>Print more details at garbage collection. <i>Manageable</i>.</td>
</tr>
<tr valign="top">
<td>-XX:-PrintGCTimeStamps</td>
<td>Print timestamps at garbage collection. <i>Manageable</i></td>
</tr>
<tr valign="top">
<td>-XX:-PrintTenuringDistribution</td>
<td>Print tenuring age information.</td>
</tr>
<tr valign="top">
<td>-XX:-TraceClassLoading</td>
<td>Trace loading of classes.</td>
</tr>
<tr valign="top">
<td>-XX:-TraceClassLoadingPreorder</td>
<td>Trace all classes loaded in order referenced (not loaded).</td>
</tr>
<tr valign="top">
<td>-XX:-TraceClassResolution</td>
<td>Trace constant pool resolutions. (Introduced in 1.4.2.)</td>
</tr>
<tr valign="top">
<td>-XX:-TraceClassUnloading</td>
<td>Trace unloading of classes.</td>
</tr>
<tr valign="top">
<td>-XX:-TraceLoaderConstraints</td>
<td>Trace recording of loader constraints. (Introduced in 6.)</td>
</tr>
</table>
<p>Advanced Hackery:</p>
<p><a href="http://wikis.sun.com/display/HotSpotInternals/Home">Reading the JVM&#8217;s mind</a>. First unlock the diagnostics with :<br />
<code>-XX:+UnlockDiagnosticVMOptions</code></p>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr valign="top">
<td>-XX:LogFile=diagnostic_log_file</td>
<td>default: hotspot.log</td>
</tr>
<tr valign="top">
<td><a href="http://wikis.sun.com/display/HotSpotInternals/LogCompilation">-XX:+LogCompilation</a></td>
<td>produces a <a href="http://wikis.sun.com/display/HotSpotInternals/LogCompilation+overview">low-level XML file</a> about compiler and runtime decisions. <a href="http://wikis.sun.com/display/HotSpotInternals/LogCompilation+tool">(related tool)</a></td>
</tr>
</table>
]]></content:encoded>
			<wfw:commentRss>http://sworddance.com/blog/2008/01/10/where-oh-where-is-the-list-of-all-those-magic-xx-java-parameters/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>explain this</title>
		<link>http://sworddance.com/blog/2007/08/13/explain-this/#utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=explain-this</link>
		<comments>http://sworddance.com/blog/2007/08/13/explain-this/#comments</comments>
		<pubDate>Mon, 13 Aug 2007 16:48:31 +0000</pubDate>
		<dc:creator>patrick</dc:creator>
				<category><![CDATA[help notes]]></category>
		<category><![CDATA[technical]]></category>

		<guid isPermaLink="false">http://www.sworddance.com/blog/2007/08/13/explain-this/</guid>
		<description><![CDATA[type parameters of T cannot be determined; no unique maximal instance exists for type variable T with upper bounds T,java.lang.Object In java 1.6u2 running in maven 2.0.7, we started getting this message but in eclipse 3.3.0 we were not. (and &#8230; <a href="http://sworddance.com/blog/2007/08/13/explain-this/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<blockquote><p> type parameters of <T>T cannot be determined; no unique maximal instance exists for type variable T with upper bounds T,java.lang.Object</p></blockquote>
<p>In java 1.6u2 running in <a href="http://maven.apache.org">maven</a> 2.0.7, we started getting this message but in eclipse 3.3.0 we were not. (and in idea we also were failing)</p>
<p>First, what the hell does this message means? Second, why can eclipse handle the issue and not the regular jdk?</p>
<p>Anyhow the problem was caused by this (our example was a little more complex than this):<br />
<code><br />
<blockquote>
public &lt;T&gt; T getFoo() {<br />
    T result;<br />
    result = getBar();<br />
    return result;<br />
}</p>
<p>public &lt;T&gt; T getBar() {<br />
    return (T) map.get("bar");<br />
}
</p></blockquote>
<p></code></p>
<p>The workaround is casting the line:<br />
<code><br />
<blockquote>
    result = getBar();
</p></blockquote>
<p></code><br />
to:<br />
<code><br />
<blockquote>
    result = (T)getBar();
</p></blockquote>
<p></code></p>
]]></content:encoded>
			<wfw:commentRss>http://sworddance.com/blog/2007/08/13/explain-this/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>apache v. tomcat mysteries&#8230;</title>
		<link>http://sworddance.com/blog/2007/05/29/apache-v-tomcat-mysteries/#utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=apache-v-tomcat-mysteries</link>
		<comments>http://sworddance.com/blog/2007/05/29/apache-v-tomcat-mysteries/#comments</comments>
		<pubDate>Tue, 29 May 2007 22:48:07 +0000</pubDate>
		<dc:creator>patrick</dc:creator>
				<category><![CDATA[help notes]]></category>
		<category><![CDATA[technical]]></category>

		<guid isPermaLink="false">http://www.sworddance.com/blog/2007/05/29/apache-v-tomcat-mysteries/</guid>
		<description><![CDATA[So I struggled for hours trying to get apache to connect via the ajp13 worker to tomcat 5.5 We are using a Debian box on the production server. Could not make it happen&#8230;. until I set the worker to be &#8230; <a href="http://sworddance.com/blog/2007/05/29/apache-v-tomcat-mysteries/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>So I struggled for hours trying to get apache to connect via the ajp13 worker to tomcat 5.5 We are using a Debian box on the production server. Could not make it happen&#8230;. until I set the worker to be &#8216;ajp13&#8242;.</p>
<p>Don&#8217;t understand what wierdness is going on but&#8230; I do know this. if my /etc/libapache-mod-jk/workers.properties file looks like this (comments removed):</p>
<blockquote><p>
workers.tomcat_home=/usr/share/tomcat5.5<br />
workers.java_home=/usr/local/java<br />
worker.list=ajp13<br />
worker.ajp13.port=8009<br />
worker.ajp13.host=localhost<br />
worker.ajp13.type=ajp13<br />
worker.ajp13.lbfactor=1<br />
worker.loadbalancer.type=lb<br />
worker.loadbalancer.balanced_workers=ajp13
</p></blockquote>
<p>Apache 2 talks very nicely with Tomcat 5.5.20</p>
<p>If it looks like this:</p>
<blockquote><p>
workers.tomcat_home=/usr/share/tomcat5.5<br />
workers.java_home=/usr/local/java<br />
worker.list=amplafi_ajp13<br />
worker.amplafi_ajp13.port=8009<br />
worker.amplafi_ajp13.host=localhost<br />
worker.amplafi_ajp13.type=ajp13<br />
worker.amplafi_ajp13.lbfactor=1<br />
worker.loadbalancer.type=lb<br />
worker.loadbalancer.balanced_workers=amplafi_ajp13
</p></blockquote>
<p>Everything is broken!</p>
<p>Does anyone have a clue here on why?</p>
]]></content:encoded>
			<wfw:commentRss>http://sworddance.com/blog/2007/05/29/apache-v-tomcat-mysteries/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

