<?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>henko.net &#187; Solution</title>
	<atom:link href="http://henko.net/category/imperfection/solution/feed/" rel="self" type="application/rss+xml" />
	<link>http://henko.net</link>
	<description>Home of a human being and software developer</description>
	<lastBuildDate>Wed, 16 Jun 2010 20:32:13 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Den laglydige taxichauffören</title>
		<link>http://henko.net/imperfection/den-laglydige-taxichaufforen/</link>
		<comments>http://henko.net/imperfection/den-laglydige-taxichaufforen/#comments</comments>
		<pubDate>Sun, 22 Feb 2009 12:05:29 +0000</pubDate>
		<dc:creator>Henrik Jernevad</dc:creator>
				<category><![CDATA[Imperfection]]></category>
		<category><![CDATA[Solution]]></category>

		<guid isPermaLink="false">http://henko.net/?p=522</guid>
		<description><![CDATA[&#8212; en berättelse som inte har något med rättegången kring the Pirate Bay att göra

Låt oss föreställa oss en helt vanlig taxichaufför.

Taxichauffören har taxilicens och en taxibil som är registrerad enligt konstens alla regler. Det enda som utmärker vår taxichaufför är att han har en lite egen twist &#8212; han tar alla körningar och ställer [...]]]></description>
			<content:encoded><![CDATA[<h3>&mdash; en berättelse som inte har något med rättegången kring the Pirate Bay att göra</h3>

<p><strong>Låt oss föreställa oss en helt vanlig taxichaufför.</strong></p>

<p><img src="http://henko.net/wp-content/uploads/2009/02/pirate-taxi-150x150.png" alt="Taxi with crossbones" title="Taxi with crossbones" align="right" width="150" height="150" class="size-thumbnail wp-image-544" />Taxichauffören har taxilicens och en taxibil som är registrerad enligt konstens alla regler. <strong>Det enda som utmärker vår taxichaufför är att han har en lite egen twist &mdash; han tar alla körningar och ställer inga frågor.</strong></p>

<p>En dag får vår taxichaufför ett uppdrag: Kör till en given adress, vänta med motorn igång och kör därefter till en annan adress. Taxichauffören accepterar. Väl vid den första adressen ser han att det är en bank. Han ser också klart och tydligt hur hans passagerare är inne i banken, hotar personalen och tvingar dem att ge honom pengar. Men vår taxichaufför ställer ju inga frågor så han väntar tills passageraren är klar på banken och kör sedan passageraren till den andra adressen. Körningen är klar och taxichauffören åker hem. <strong>Han inser att han just kört en bankrånare till och från ett rån men är okay med det &mdash; <em>han själv</em> gör ju inget olagligt. Han kör ju bara taxi.</strong></p>

<p>Efter denna incident återkommer både denna passagerare och andra personer som använder taxichauffören för att köra dem till och från rån, inbrott, stölder och andra brott. Taxichauffören fortsätter köra utan att ställa några frågor. Han får inte någon del av bytet utan tar endast ordinarie taxa. <strong>Han är medveten om att hans passagerare begår brott, men sover ändå gott om natten &mdash; <em>han själv</em> gör ju inget olagligt. Han kör ju bara taxi.</strong></p>

<p>Vad tycker du om taxichauffören? Gör han något olagligt? Beter han sig omoraliskt? Kommentera och ge din åsikt!</p>

<hr/>

<p><strong>PS.</strong> Angående något <em>helt</em> annat, Pirate Bay-rättegången pågår. Vad handlar den om egentligen? <strong>Pirate Bay-killarna gör ju inget olagligt. De driver ju bara en webbsajt.</strong> (Eller?)</p>

<p><a href="http://spotify.com"><img src="http://www.spotify.com/wp-content/themes/spotify/images/logo.png" align="right" width="54" alt="Spotify logo" style="border: 0" /></a>
<strong>PPS.</strong> Skivbolagen behöver tänka om! Stöd <a href="http://spotify.com" title="Spotify">Spotify</a> och andra lagliga alternativ och tala om för skivbolagen vad ni vill ha!</p>

<p><strong>PPPS.</strong> Detta inlägg är ej avsett för barn, då de <a href="http://www.tryggabarn.nu/barn/Page13083.html" title="ej förstår ironi">ej förstår ironi</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://henko.net/imperfection/den-laglydige-taxichaufforen/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Solution: &#8220;Specified RequestProcessor not compatible with TilesRequestProcessor&#8221;</title>
		<link>http://henko.net/imperfection/specified-requestprocessor-not-compatible-with-tilesrequestprocessor/</link>
		<comments>http://henko.net/imperfection/specified-requestprocessor-not-compatible-with-tilesrequestprocessor/#comments</comments>
		<pubDate>Fri, 09 May 2008 11:54:21 +0000</pubDate>
		<dc:creator>Henrik Jernevad</dc:creator>
				<category><![CDATA[Imperfection]]></category>
		<category><![CDATA[Solution]]></category>

		<guid isPermaLink="false">http://henko.net/?p=124</guid>
		<description><![CDATA[When using Struts 1.3 with Tiles and SSLEXT plug-ins, the application server throws an exception while trying to process a request telling you that the specified request processor isn't compatible with Tiles. Here's the solution.]]></description>
			<content:encoded><![CDATA[<h3>Problem</h3>

<p>When using Struts 1.3 with Tiles and SSLEXT plug-ins, the application server throws the following exception while trying to process a request.</p>

<pre><code>SEVERE: Allocate exception for servlet action
javax.servlet.UnavailableException: TilesPlugin : Specified RequestProcessor
        not compatible with TilesRequestProcessor
    at org.apache.struts.action.ActionServlet.init(ActionServlet.java:399)
    at javax.servlet.GenericServlet.init(GenericServlet.java:212)
    ...
</code></pre>

<h3>Cause</h3>

<p>You are using a <code>RequestProcessor</code> which does not extend <code>TilesRequestProcessor</code>, most likely <code>org.apache.struts.action.SecureRequestProcessor</code> provided by SSLEXT.</p>

<h3>Solution</h3>

<p>As stated on SSLEXT&#8217;s web page, in order to use Tiles and SSLEXT together, you need to use specific Tiles-enabled custom request processor and plug-in classes. These classes are provided by SSLEXT and their full names classes are:</p>

<ul>
<li><code>org.apache.struts.action.SecureTilesRequestProcessor</code></li>
<li><code>org.apache.struts.tiles.SecureTilesPlugin</code></li>
</ul>

<p>Note that the SSLEXT web page incorrectly states the last class&#8217; name as <code>SecureTilesPlugIn</code> (with a capital i).</p>

<h3>See also</h3>

<ul>
<li><a href="http://sslext.sourceforge.net/" title="http://sslext.sourceforge.net/">http://sslext.sourceforge.net/</a></li>
<li><a href="http://www.jroller.com/JamesGoodwill/entry/using_tiles_and_a_custom" title="http://www.jroller.com/JamesGoodwill/entry/using_tiles_and_a_custom">http://www.jroller.com/JamesGoodwill/entry/using_tiles_and_a_custom</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://henko.net/imperfection/specified-requestprocessor-not-compatible-with-tilesrequestprocessor/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Solution: &#8220;Could not load a dependent class&#8221; when using Ant through Eclipse</title>
		<link>http://henko.net/imperfection/could-not-load-a-dependent-class-ant-eclipse/</link>
		<comments>http://henko.net/imperfection/could-not-load-a-dependent-class-ant-eclipse/#comments</comments>
		<pubDate>Mon, 21 Jan 2008 12:48:15 +0000</pubDate>
		<dc:creator>Henrik Jernevad</dc:creator>
				<category><![CDATA[Imperfection]]></category>
		<category><![CDATA[Solution]]></category>

		<guid isPermaLink="false">http://henko.net/imperfection/could-not-load-a-dependent-class-ant-eclipse/</guid>
		<description><![CDATA[When running an optional Ant task through the Eclipse Ant interface, you get an error saying a dependent class could not be loaded. However, you have found all required dependencies for the tasks you are trying to use and put them in one of the folders as specified. This might be the solution.]]></description>
			<content:encoded><![CDATA[<h3>Problem</h3>

<p>When running an optional Ant task (e.g. <code>scp</code> or <code>sshexec</code>) through the Eclipse Ant interface, you get an error similar to the one below.</p>

<pre><code>BUILD FAILED
C:\Path\To\build.xml:45: Problem: failed to create task or type scp
Cause: Could not load a dependent class com/jcraft/jsch/UserInfo
       It is not enough to have Ant's optional JARs
       you need the JAR files that the optional tasks depend upon.
       Ant's optional task dependencies are listed in the manual.
Action: Determine what extra JAR files are needed, and place them in one of:
        -C:\Path\To\Ant\Home\lib
        -C:\Path\To\User\Home\.ant\lib
        -a directory added on the command line with the -lib argument

Do not panic, this is a common problem.
The commonest cause is a missing JAR.

This is not a bug; it is a configuration problem
</code></pre>

<p>However, you have found all required dependencies for the tasks you are trying to use and put them in one of the folders as specified.</p>

<h3>Cause</h3>

<p>Although you have added the right dependencies, Eclipse might not yet know of the file(s). If this is the case, you can see this by running Ant diagnostics (<code>ant -diagnostics</code> on the command line or the <code>&lt;diagnostics&gt;</code> ant task). You will see that the dependency is listed in the appropriate &#8220;lib jar listing&#8221; but is missing in the <code>java.class.path</code> system property.</p>

<h3>Solution</h3>

<p>Go to <code>Window &gt; Preferences &gt; Ant &gt; Runtime &gt; Classpath</code>, select &#8220;Ant Home Entries (default)&#8221; and click &#8220;Add External JARs&#8230;&#8221;. Select the required dependency or dependencies and accept. Now, the selected JAR files will be loaded to the class path and the optional ant task depending on them will work.</p>
]]></content:encoded>
			<wfw:commentRss>http://henko.net/imperfection/could-not-load-a-dependent-class-ant-eclipse/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Sorted collections in Hibernate</title>
		<link>http://henko.net/imperfection/sorted-collections-in-hibernate/</link>
		<comments>http://henko.net/imperfection/sorted-collections-in-hibernate/#comments</comments>
		<pubDate>Wed, 03 Oct 2007 11:29:10 +0000</pubDate>
		<dc:creator>Henrik Jernevad</dc:creator>
				<category><![CDATA[Imperfection]]></category>
		<category><![CDATA[Solution]]></category>

		<guid isPermaLink="false">http://henko.net/imperfection/sorted-collections-in-hibernate/</guid>
		<description><![CDATA[We want a collection field belonging to an entity object to be sorted. There are two possible solutions.]]></description>
			<content:encoded><![CDATA[<h3>Problem</h3>

<p>We want a collection field belonging to an entity object to be sorted.</p>

<h3>Solution</h3>

<p>There are two possible solutions:</p>

<ul>
<li>If you want the collection to be sorted when loaded, but not necessarily keep that sorting order all the time, use the <code>OrderBy</code> annotation where you set the actual <code>ORDER BY</code> SQL clause. In that case, the collection can be of any type (e.g. <code>Collection</code>).</li>
<li><p>If you want the collection to be sorted at all times, make it of type <code>SortedSet</code> or <code>SortedMap</code> and set the <code>Sort</code> annotation.</p>

<ul>
<li>If the objects in the collection implements <code>Comparable</code> set type to <code>SortType.NATURAL</code>.</li>
<li>Otherwise set it to <code>SortType.COMPARATOR</code> and specify your own <code>Comparator</code> class in the <code>comparator</code> attribute.</li>
</ul></li>
</ul>

<h3>Remarks</h3>

<ul>
<li>There exists an annotation with name <code>OrderBy</code> in both the <code>javax.persistence</code> package as well as the <code>org.hibernate.annotations</code> package. The former should be used.</li>
</ul>

<h3>See also</h3>

<ul>
<li><a href="http://www.hibernate.org/hib_docs/annotations/reference/en/html_single/#entity-hibspec-collection-enhance" title="Collection related annotations">Collection related annotations</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://henko.net/imperfection/sorted-collections-in-hibernate/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.308 seconds -->
