<?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>h3x.no &#187; Java</title>
	<atom:link href="http://h3x.no/category/development/java/feed" rel="self" type="application/rss+xml" />
	<link>http://h3x.no</link>
	<description>Tor Henning Ueland`s thoughts about technology and other stuff</description>
	<lastBuildDate>Sun, 05 Feb 2012 20:24:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>GWT: &#8220;For security purposes, this type will not be serialized.&#8221;</title>
		<link>http://h3x.no/2011/09/01/gwt-for-security-purposes-this-type-will-not-be-serialized</link>
		<comments>http://h3x.no/2011/09/01/gwt-for-security-purposes-this-type-will-not-be-serialized#comments</comments>
		<pubDate>Thu, 01 Sep 2011 17:50:07 +0000</pubDate>
		<dc:creator>Tor Henning Ueland</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[constructor]]></category>
		<category><![CDATA[GWT]]></category>
		<category><![CDATA[serializable]]></category>

		<guid isPermaLink="false">http://h3x.no/?p=1069</guid>
		<description><![CDATA[The full error message you can get is: &#8220;Foo was not included in the set of types which can be serialized by this SerializationPolicy or its Class object could not be loaded. For security purposes, this type will not be &#8230; <a href="http://h3x.no/2011/09/01/gwt-for-security-purposes-this-type-will-not-be-serialized">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>The full error message you can get is: &#8220;Foo was not included in the set of types which can be serialized by this SerializationPolicy or its Class object could not be loaded. For security purposes, this type will not be serialized.&#8221;</p>
<p>This is normally caused by using a non-serializable class, which can happen if your class does not implement serializable or if you have forgotten to add a <strong>empty</strong> constructor.</p>
]]></content:encoded>
			<wfw:commentRss>http://h3x.no/2011/09/01/gwt-for-security-purposes-this-type-will-not-be-serialized/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Java: Converting long to double</title>
		<link>http://h3x.no/2011/08/30/java-converting-long-to-double</link>
		<comments>http://h3x.no/2011/08/30/java-converting-long-to-double#comments</comments>
		<pubDate>Tue, 30 Aug 2011 16:15:17 +0000</pubDate>
		<dc:creator>Tor Henning Ueland</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[cast]]></category>
		<category><![CDATA[double]]></category>

		<guid isPermaLink="false">http://h3x.no/?p=1048</guid>
		<description><![CDATA[While Integers has to be parsed from a String, doubles can simply be casted: String bar = &#34;9.99&#34;; Double foo = &#40;double&#41;bar;]]></description>
			<content:encoded><![CDATA[<p>While Integers has to be parsed from a String, doubles can simply be casted:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #003399;">String</span> bar <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;9.99&quot;</span><span style="color: #339933;">;</span>
<span style="color: #003399;">Double</span> foo <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">double</span><span style="color: #009900;">&#41;</span>bar<span style="color: #339933;">;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://h3x.no/2011/08/30/java-converting-long-to-double/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>EXT GWT: Adding onClick to Labels</title>
		<link>http://h3x.no/2011/08/29/ext-gwt-adding-onclick-to-labels</link>
		<comments>http://h3x.no/2011/08/29/ext-gwt-adding-onclick-to-labels#comments</comments>
		<pubDate>Mon, 29 Aug 2011 17:25:51 +0000</pubDate>
		<dc:creator>Tor Henning Ueland</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[clickhandler]]></category>
		<category><![CDATA[ext]]></category>
		<category><![CDATA[GWT]]></category>
		<category><![CDATA[onclick]]></category>

		<guid isPermaLink="false">http://h3x.no/?p=1036</guid>
		<description><![CDATA[I had a issue where i needed to add a click handler for labels in EXT GWT, the solution i came up with was as follows theLabel.addListener&#40;Events.OnClick, new Listener&#40;&#41; &#123; @Override public void handleEvent&#40;BaseEvent be&#41; &#123; // TODO Auto-generated method &#8230; <a href="http://h3x.no/2011/08/29/ext-gwt-adding-onclick-to-labels">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I had a issue where i needed to add a click handler for labels in EXT GWT, the solution i came up with was as follows</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">theLabel.<span style="color: #006633;">addListener</span><span style="color: #009900;">&#40;</span>Events.<span style="color: #006633;">OnClick</span>, <span style="color: #000000; font-weight: bold;">new</span> Listener<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
@Override
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> handleEvent<span style="color: #009900;">&#40;</span>BaseEvent be<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #666666; font-style: italic;">// TODO Auto-generated method stub</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://h3x.no/2011/08/29/ext-gwt-adding-onclick-to-labels/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Guice: java.lang.IllegalStateException: No SessionHandler or SessionManager</title>
		<link>http://h3x.no/2011/08/28/guice-java-lang-illegalstateexception-no-sessionhandler-or-sessionmanager</link>
		<comments>http://h3x.no/2011/08/28/guice-java-lang-illegalstateexception-no-sessionhandler-or-sessionmanager#comments</comments>
		<pubDate>Sun, 28 Aug 2011 17:21:56 +0000</pubDate>
		<dc:creator>Tor Henning Ueland</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[guice]]></category>
		<category><![CDATA[singleton]]></category>

		<guid isPermaLink="false">http://h3x.no/?p=1034</guid>
		<description><![CDATA[One reason for this error would be that you should inject the session object directly, not via constructor: So instead of: @Singleton public class Foo &#123; &#160; @Inject public Foo&#40;HttpServletSession s&#41; &#123; this.session = s  &#125; &#125; do this: @Singleton &#8230; <a href="http://h3x.no/2011/08/28/guice-java-lang-illegalstateexception-no-sessionhandler-or-sessionmanager">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>One reason for this error would be that you should inject the session object directly, not via constructor:</p>
<p>So instead of:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">@Singleton
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> Foo <span style="color: #009900;">&#123;</span>
&nbsp;
@Inject <span style="color: #000000; font-weight: bold;">public</span> Foo<span style="color: #009900;">&#40;</span>HttpServletSession s<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">session</span> <span style="color: #339933;">=</span> s  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>do this:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">@Singleton
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> Foo<span style="color: #009900;">&#123;</span>
&nbsp;
@Inject Provider<span style="color: #339933;">&lt;</span>HttpServletSession<span style="color: #339933;">&gt;</span> session<span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>And it should work much better <img src='http://h3x.no/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://h3x.no/2011/08/28/guice-java-lang-illegalstateexception-no-sessionhandler-or-sessionmanager/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>class Foo is public, should be declared in a file named Foo.java</title>
		<link>http://h3x.no/2011/07/04/class-foo-is-public-should-be-declared-in-a-file-named-foo-java</link>
		<comments>http://h3x.no/2011/07/04/class-foo-is-public-should-be-declared-in-a-file-named-foo-java#comments</comments>
		<pubDate>Mon, 04 Jul 2011 20:18:00 +0000</pubDate>
		<dc:creator>Tor Henning Ueland</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[inner]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[private]]></category>

		<guid isPermaLink="false">http://h3x.no/?p=1025</guid>
		<description><![CDATA[When working with Java you might encounter this error. The reason for this is that you have tried to declare a public class in a file with a different name. Each java file can only contain one public java class, &#8230; <a href="http://h3x.no/2011/07/04/class-foo-is-public-should-be-declared-in-a-file-named-foo-java">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>When working with Java you might encounter this error. The reason for this is that you have tried to declare a public class in a file with a different name. Each java file can only contain one public java class, which is named the same as the java file itself. If you need another class inside your other class you should looking into<a href="http://download.oracle.com/javase/tutorial/java/javaOO/innerclasses.html"> private inner classes.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://h3x.no/2011/07/04/class-foo-is-public-should-be-declared-in-a-file-named-foo-java/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jpackages error: Missing Dependency: /usr/bin/rebuild-security-providers</title>
		<link>http://h3x.no/2011/02/25/jpackages-error-missing-dependency-usrbinrebuild-security-providers</link>
		<comments>http://h3x.no/2011/02/25/jpackages-error-missing-dependency-usrbinrebuild-security-providers#comments</comments>
		<pubDate>Fri, 25 Feb 2011 10:02:27 +0000</pubDate>
		<dc:creator>Tor Henning Ueland</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Red Hat]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[jpackages]]></category>
		<category><![CDATA[RPM]]></category>

		<guid isPermaLink="false">http://h3x.no/?p=952</guid>
		<description><![CDATA[Jpackages on Red Hat has a nifty bug that causes dependency errors. Luckily, somebody has created a fix as a rpm package wget http://plone.lucidsolutions.co.nz/linux/centos/images/jpackage-utils-compat-el5-0.0.1-1.noarch.rpm rpm -ivh jpackage-utils-compat-el5-0.0.1-1.noarch.rpm And then jpackages works.]]></description>
			<content:encoded><![CDATA[<p>Jpackages on Red Hat has a nifty bug that causes dependency errors.</p>
<p>Luckily, somebody has created a fix as a rpm package <img src='http://h3x.no/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>plone.lucidsolutions.co.nz<span style="color: #000000; font-weight: bold;">/</span>linux<span style="color: #000000; font-weight: bold;">/</span>centos<span style="color: #000000; font-weight: bold;">/</span>images<span style="color: #000000; font-weight: bold;">/</span>jpackage-utils-compat-el5-0.0.1-<span style="color: #000000;">1</span>.noarch.rpm
rpm <span style="color: #660033;">-ivh</span> jpackage-utils-compat-el5-0.0.1-<span style="color: #000000;">1</span>.noarch.rpm</pre></div></div>

<p>And then jpackages works.</p>
]]></content:encoded>
			<wfw:commentRss>http://h3x.no/2011/02/25/jpackages-error-missing-dependency-usrbinrebuild-security-providers/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tips for implementing a custom JAAS login module for Jetty</title>
		<link>http://h3x.no/2011/02/23/tips-for-implementing-a-custom-jaas-login-module-for-jetty</link>
		<comments>http://h3x.no/2011/02/23/tips-for-implementing-a-custom-jaas-login-module-for-jetty#comments</comments>
		<pubDate>Wed, 23 Feb 2011 08:14:52 +0000</pubDate>
		<dc:creator>Tor Henning Ueland</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[jaas]]></category>
		<category><![CDATA[jetty]]></category>

		<guid isPermaLink="false">http://h3x.no/?p=939</guid>
		<description><![CDATA[1) jetty-web.xml You can gather all specific settings for Jetty in the file WEB-INF/jetty-web.xml, remember to also specify paths for the role principals if you use your own classes for that. Example jetty-web.xml file: &#60;!-- Jetty specific config file --&#62; &#8230; <a href="http://h3x.no/2011/02/23/tips-for-implementing-a-custom-jaas-login-module-for-jetty">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<h2>1) jetty-web.xml</h2>
<p>You can gather all specific settings for Jetty in the file WEB-INF/jetty-web.xml, remember to also specify paths for the role principals if you use your own classes for that.</p>
<p>Example jetty-web.xml file:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">&lt;!-- Jetty specific config file --&gt;</span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Configure<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
<span style="color: #808080; font-style: italic;">&lt;!-- Tell jetty where to find login config --&gt;</span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Call</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;setProperty&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Arg<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>java.security.<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;strong<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>auth<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/strong<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>.login.config<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Arg<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Arg<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>WEB-INF/login.config<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Arg<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Call<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
<span style="color: #808080; font-style: italic;">&lt;!-- Bug fix for Jetty to properly handle login config in a per-project setup --&gt;</span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Set</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;serverClasses&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Array</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;java.lang.String&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Item<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>-org.mortbay.jetty.plus.jaas.<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Item<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Item<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>org.mortbay.jetty<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Item<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Item<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>org.slf4j.<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Item<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Array<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Set<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
<span style="color: #808080; font-style: italic;">&lt;!-- Create login realm --&gt;</span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Get</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;securityHandler&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Set</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;userRealm&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;New<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Set</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;name&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>*NAME OF YOUR REALM*<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Set<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Set</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;LoginModuleName&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>*NAME OF YOUR LOGIN CLASS*<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Set<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Set</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;roleClassNames&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Array</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;java.lang.String&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Item<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>*PATH TO YOUR ROLE PRINCIPAL CLASS*<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Item<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Array<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Set<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/New<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Set<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Get<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Configure<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<h2>2) Adding roles to a user in commit</h2>
<p>When you want to give a user roles(like admin, moderator etc), you can add those to the user when he or she is authenticated and commit is called upon:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">boolean</span> commit<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> LoginException <span style="color: #009900;">&#123;</span>
		MyUserPrincipal user <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> MyUserPrincipal<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;username&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">//Add logged in user as first principal</span>
		subject.<span style="color: #006633;">getPrincipals</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span>user<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">//Add roles for the logged in user</span>
		subject.<span style="color: #006633;">getPrincipals</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span> <span style="color: #000000; font-weight: bold;">new</span> MyGroupPrincipal<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;admin&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		subject.<span style="color: #006633;">getPrincipals</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span> <span style="color: #000000; font-weight: bold;">new</span> MyGroupPrincipal<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;moderator&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://h3x.no/2011/02/23/tips-for-implementing-a-custom-jaas-login-module-for-jetty/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Debugging GWT: Did you forget to inherit a required module?</title>
		<link>http://h3x.no/2011/02/22/debugging-gwt-did-you-forget-to-inherit-a-required-module</link>
		<comments>http://h3x.no/2011/02/22/debugging-gwt-did-you-forget-to-inherit-a-required-module#comments</comments>
		<pubDate>Tue, 22 Feb 2011 13:03:20 +0000</pubDate>
		<dc:creator>Tor Henning Ueland</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[GWT]]></category>

		<guid isPermaLink="false">http://h3x.no/?p=927</guid>
		<description><![CDATA[You will receive this error if you are using classes in your GWT project that GWT does not have access to. Make sure that you have added something like this in your gwt.xml file, within your module element: &#60;source path="path.to.classes" &#8230; <a href="http://h3x.no/2011/02/22/debugging-gwt-did-you-forget-to-inherit-a-required-module">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>You will receive this error if you are using classes in your GWT project that GWT does not have access to. Make sure that you have added something like this in your gwt.xml file, within your module element:</p>
<pre>    &lt;source path="path.to.classes" /&gt;</pre>
]]></content:encoded>
			<wfw:commentRss>http://h3x.no/2011/02/22/debugging-gwt-did-you-forget-to-inherit-a-required-module/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Eclipse Workspace In Use Or Cannot Be Created</title>
		<link>http://h3x.no/2010/12/20/eclipse-workspace-in-use-or-cannot-be-created</link>
		<comments>http://h3x.no/2010/12/20/eclipse-workspace-in-use-or-cannot-be-created#comments</comments>
		<pubDate>Mon, 20 Dec 2010 09:20:08 +0000</pubDate>
		<dc:creator>Tor Henning Ueland</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[workspace]]></category>

		<guid isPermaLink="false">http://h3x.no/?p=859</guid>
		<description><![CDATA[You may recieve the error message &#8220;Eclipse Workspace In Use Or Cannot Be Created&#8221; From Eclipse when trying to start up Eclipse, this typically means that Eclipse is already running.  If you have not started Eclipse, try to locate Eclipse &#8230; <a href="http://h3x.no/2010/12/20/eclipse-workspace-in-use-or-cannot-be-created">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>You may recieve the error message &#8220;Eclipse Workspace In Use Or Cannot Be Created&#8221; From Eclipse when trying to start up Eclipse, this typically means that Eclipse is already running.  If you have not started Eclipse, try to locate Eclipse in your operating systems task manager and kill it. You can also consider killing any java processes running if you cant find any Eclipse processes.</p>
]]></content:encoded>
			<wfw:commentRss>http://h3x.no/2010/12/20/eclipse-workspace-in-use-or-cannot-be-created/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HttpClient: Target host must not be null, or set in parameters</title>
		<link>http://h3x.no/2010/11/22/httpclient-target-host-must-not-be-null-or-set-in-parameters</link>
		<comments>http://h3x.no/2010/11/22/httpclient-target-host-must-not-be-null-or-set-in-parameters#comments</comments>
		<pubDate>Mon, 22 Nov 2010 08:10:13 +0000</pubDate>
		<dc:creator>Tor Henning Ueland</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[httpclient]]></category>

		<guid isPermaLink="false">http://h3x.no/?p=807</guid>
		<description><![CDATA[If you have the following code failing: HttpGet httpget = new HttpGet(&#8220;www.host.com&#8221;); Then the error is pretty easy to solve: The problem is that you have not added a protocol to the URL, so change it to: HttpGet httpget = &#8230; <a href="http://h3x.no/2010/11/22/httpclient-target-host-must-not-be-null-or-set-in-parameters">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>If you have the following code failing:</p>
<blockquote><p>HttpGet httpget = new HttpGet(&#8220;www.host.com&#8221;);</p></blockquote>
<p>Then the error is pretty easy to solve:<br />
The problem is that you have not added a protocol to the URL, so change it to:</p>
<blockquote><p>HttpGet httpget = new HttpGet(&#8220;http://www.host.com&#8221;);</p></blockquote>
<p>And then it will work as wanted.</p>
]]></content:encoded>
			<wfw:commentRss>http://h3x.no/2010/11/22/httpclient-target-host-must-not-be-null-or-set-in-parameters/feed</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
	</channel>
</rss>

