<?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>DirkReske.de</title>
	<atom:link href="http://www.dirkreske.de/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dirkreske.de</link>
	<description>Personal homepage of Dirk Reske</description>
	<lastBuildDate>Wed, 30 Jun 2010 17:03:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Simple UUID Generator</title>
		<link>http://www.dirkreske.de/simple-uuid-generator/</link>
		<comments>http://www.dirkreske.de/simple-uuid-generator/#comments</comments>
		<pubDate>Tue, 20 Apr 2010 12:23:12 +0000</pubDate>
		<dc:creator>Dirk Reske</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[uuid]]></category>

		<guid isPermaLink="false">http://www.dirkreske.de/?p=220</guid>
		<description><![CDATA[Just for fun&#8230;I really often need a uuid for manually adding entries to different databases. aa24f902-69cf-47cf-bab0-119279a54491]]></description>
			<content:encoded><![CDATA[<p>Just for fun&#8230;I really often need a uuid for manually adding entries to different databases.</p>
<h1>64224c1b-0096-4801-818a-41612dd61462</h1>
]]></content:encoded>
			<wfw:commentRss>http://www.dirkreske.de/simple-uuid-generator/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Designer friendly JSF using jsfc attribute</title>
		<link>http://www.dirkreske.de/designer-friendly-jsf-using-jsfc-attribute/</link>
		<comments>http://www.dirkreske.de/designer-friendly-jsf-using-jsfc-attribute/#comments</comments>
		<pubDate>Tue, 13 Apr 2010 16:47:35 +0000</pubDate>
		<dc:creator>Dirk Reske</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[facelets]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[javaee]]></category>
		<category><![CDATA[jsf]]></category>

		<guid isPermaLink="false">http://www.dirkreske.de/?p=185</guid>
		<description><![CDATA[Have you ever tried to edit your jsf code using a visual designer like dreamweaver? Or do you get your<a href="http://www.dirkreske.de/designer-friendly-jsf-using-jsfc-attribute/" class="searchmore">Read the Rest...</a><div class="clr"></div>]]></description>
			<content:encoded><![CDATA[<p>Have you ever tried to edit your jsf code using a visual designer like dreamweaver? Or do you get your html layout from a professional designer and have to &#8220;translate&#8221; it to jsf?</p>
<p>In the first case, most times it will be look very strange, because the designer doesn&#8217;t understand the jsf tags and so it don&#8217;t know how to display it.</p>
<p>If you want to create a fast jsf prototype of your html layout you can use the <em>jsfc</em> attribute provided by the facelets compiler. By adding this attribute to standard html tags, you can tell the compiler, in which jsf component it has to &#8220;translate&#8221; the html component.</p>
<p>See the following simple html example:</p>
<pre>
<div class="codecolorer-container html4strict default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/table.html"><span style="color: #000000; font-weight: bold;">table</span></a>&gt;</span><br />
&nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/tr.html"><span style="color: #000000; font-weight: bold;">tr</span></a>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/td.html"><span style="color: #000000; font-weight: bold;">td</span></a>&gt;&lt;<a href="http://december.com/html/4/element/strong.html"><span style="color: #000000; font-weight: bold;">strong</span></a>&gt;</span>Name<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/strong.html"><span style="color: #000000; font-weight: bold;">strong</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/td.html"><span style="color: #000000; font-weight: bold;">td</span></a>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/td.html"><span style="color: #000000; font-weight: bold;">td</span></a>&gt;&lt;<a href="http://december.com/html/4/element/strong.html"><span style="color: #000000; font-weight: bold;">strong</span></a>&gt;</span>eMail<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/strong.html"><span style="color: #000000; font-weight: bold;">strong</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/td.html"><span style="color: #000000; font-weight: bold;">td</span></a>&gt;</span><br />
&nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/tr.html"><span style="color: #000000; font-weight: bold;">tr</span></a>&gt;</span><br />
&nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/tr.html"><span style="color: #000000; font-weight: bold;">tr</span></a>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/td.html"><span style="color: #000000; font-weight: bold;">td</span></a>&gt;</span>John Doe<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/td.html"><span style="color: #000000; font-weight: bold;">td</span></a>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/td.html"><span style="color: #000000; font-weight: bold;">td</span></a>&gt;</span>jon@doe.de<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/td.html"><span style="color: #000000; font-weight: bold;">td</span></a>&gt;</span><br />
&nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/tr.html"><span style="color: #000000; font-weight: bold;">tr</span></a>&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/table.html"><span style="color: #000000; font-weight: bold;">table</span></a>&gt;</span></div></div>
</pre>
<p>You can convert this by replacing all with a <em>h:dataTable</em> tag, or you can use the jsfc attribute in several ways.<br />
One way could be:</p>
<pre>
<div class="codecolorer-container html4strict default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/table.html"><span style="color: #000000; font-weight: bold;">table</span></a>&gt;</span><br />
&nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/tr.html"><span style="color: #000000; font-weight: bold;">tr</span></a>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/td.html"><span style="color: #000000; font-weight: bold;">td</span></a>&gt;&lt;<a href="http://december.com/html/4/element/b.html"><span style="color: #000000; font-weight: bold;">b</span></a>&gt;</span>Name<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/b.html"><span style="color: #000000; font-weight: bold;">b</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/td.html"><span style="color: #000000; font-weight: bold;">td</span></a>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/td.html"><span style="color: #000000; font-weight: bold;">td</span></a>&gt;&lt;<a href="http://december.com/html/4/element/b.html"><span style="color: #000000; font-weight: bold;">b</span></a>&gt;</span>eMail<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/b.html"><span style="color: #000000; font-weight: bold;">b</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/td.html"><span style="color: #000000; font-weight: bold;">td</span></a>&gt;</span><br />
&nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/tr.html"><span style="color: #000000; font-weight: bold;">tr</span></a>&gt;</span><br />
&nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/tr.html"><span style="color: #000000; font-weight: bold;">tr</span></a> jsfc<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;ui:repeat&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#{userListBean.users}&quot;</span> var<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;user&quot;</span>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/td.html"><span style="color: #000000; font-weight: bold;">td</span></a>&gt;</span>#{user.name}<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/td.html"><span style="color: #000000; font-weight: bold;">td</span></a>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/td.html"><span style="color: #000000; font-weight: bold;">td</span></a>&gt;</span>#{user.email}<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/td.html"><span style="color: #000000; font-weight: bold;">td</span></a>&gt;</span><br />
&nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/tr.html"><span style="color: #000000; font-weight: bold;">tr</span></a>&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/table.html"><span style="color: #000000; font-weight: bold;">table</span></a>&gt;</span></div></div>
</pre>
<p>You see, there is no jsf tag in this code. Sou you can edit this html using your favorite designer, it will simply ignore the unknown attributes.</p>
<p>Another way would be, telling the facelets compiler to render the table as a <em>h:dataTable</em>, but because of the header row, you&#8217;ll have to use the f:facet tag.</p>
<pre>
<div class="codecolorer-container html4strict default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/table.html"><span style="color: #000000; font-weight: bold;">table</span></a> jsfc<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;h:dataTable&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#{userListBean.users}&quot;</span> var<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;user&quot;</span>&gt;</span><br />
&nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/tr.html"><span style="color: #000000; font-weight: bold;">tr</span></a>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/td.html"><span style="color: #000000; font-weight: bold;">td</span></a> jsfc<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;h:column&quot;</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;f:facet <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;header&quot;</span>&gt;</span>Username<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span>f:facet&gt;</span><br />
&nbsp; &nbsp; &nbsp; #{user.name}<br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/td.html"><span style="color: #000000; font-weight: bold;">td</span></a>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/td.html"><span style="color: #000000; font-weight: bold;">td</span></a> jsfc<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;h:column&quot;</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;f:facet <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;header&quot;</span>&gt;</span>eMail<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span>f:facet&gt;</span><br />
&nbsp; &nbsp; &nbsp; #{user.email}<br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/td.html"><span style="color: #000000; font-weight: bold;">td</span></a>&gt;</span><br />
&nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/tr.html"><span style="color: #000000; font-weight: bold;">tr</span></a>&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/table.html"><span style="color: #000000; font-weight: bold;">table</span></a>&gt;</span></div></div>
</pre>
<p>So this way you still have to use jsf tags and so the visual designer can&#8217;t interpret it correctly.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dirkreske.de/designer-friendly-jsf-using-jsfc-attribute/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PathFinder goes open source</title>
		<link>http://www.dirkreske.de/pathfinder-goes-open-source/</link>
		<comments>http://www.dirkreske.de/pathfinder-goes-open-source/#comments</comments>
		<pubDate>Wed, 18 Nov 2009 16:36:32 +0000</pubDate>
		<dc:creator>Dirk Reske</dc:creator>
				<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://www.dirkreske.de/?p=128</guid>
		<description><![CDATA[Today, we&#8217;ve published the pathfinder application to SourceForge. Here is the project page]]></description>
			<content:encoded><![CDATA[<p>Today, we&#8217;ve published the <a href="http://www.dirkreske.de/pathfinder/">pathfinder </a>application to SourceForge.</p>
<p><a href="https://sourceforge.net/projects/jpathfinder/" target="_blank">Here </a>is the project page</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dirkreske.de/pathfinder-goes-open-source/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Load balancing glassfish using apache</title>
		<link>http://www.dirkreske.de/load-balancing-glassfish-using-apache/</link>
		<comments>http://www.dirkreske.de/load-balancing-glassfish-using-apache/#comments</comments>
		<pubDate>Sat, 31 Oct 2009 23:19:48 +0000</pubDate>
		<dc:creator>Dirk Reske</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[glassfish]]></category>
		<category><![CDATA[high availability]]></category>
		<category><![CDATA[javaee]]></category>
		<category><![CDATA[load balancing]]></category>

		<guid isPermaLink="false">http://www.dirkreske.de/?p=116</guid>
		<description><![CDATA[Overview After my articles about setting up a glassfish cluster and enable session replication, its now time to put a<a href="http://www.dirkreske.de/load-balancing-glassfish-using-apache/" class="searchmore">Read the Rest...</a><div class="clr"></div>]]></description>
			<content:encoded><![CDATA[<h3>Overview</h3>
<p>After my articles about <a href="http://www.dirkreske.de/glassfish-cluster-configuration/">setting up a glassfish cluster</a> and <a href="http://www.dirkreske.de/enable-glassfish-session-replication/">enable session replication</a>, its now time to put a load balancer in front of it.</p>
<p>A couple of times I&#8217;ve tried to get the Sun load balancing plugin working, but without success. This was because of  some operating system issues or other problems.<br />
So after looking around the web, I&#8217;ve found some good solutions using apache and the mod_jk connector from the apache tomcat project.</p>
<h3>Requirements</h3>
<ul>
<li>Recent glassfish installation (I use v2.1.1).</li>
<li><a href="http://tomcat.apache.org/connectors-doc/webserver_howto/apache.html" target="_blank">mod_jk</a> tomcat connector.</li>
<li><a href="http://tomcat.apache.org/" target="_blank">Apache tomcat</a> server to get some files from (Use version 5.5.23, others won&#8217;t work).</li>
<li><a href="http://commons.apache.org/logging/" target="_blank">Apache commons logging</a></li>
<li><a href="http://commons.apache.org/modeler/" target="_blank">Apache commons modeler</a></li>
</ul>
<h3>Installation</h3>
<ol>
<li>Configuring the glassfish cluster
<ol>
<li>Copy the <em>$CATALINA_HOME/server/lib/tomcat-ajp.jar</em> to your <em>$GLASSFISH_HOME/lib </em>directory on each glassfish installation in your cluster.</li>
<li>Also copy the<em> commons-logging.jar</em> and<em> commons-modeler.jar</em> to your <em>$GLASSFISH_HOME/lib </em>directory on each glassfish installation in your cluster.</li>
<li>Now you have to define <em>jvmRoute </em>and<em> com.sun.enterprise.web.connector.enableJK</em> system properties for the cluster (this can be done from the domain administration server)
<pre>asadmin create-jvm-options --target cluster1 "-DjvmRoute=\${AJP_INSTANCE_NAME}"
asadmin create-jvm-options --target cluster1 "-Dcom.sun.enterprise.web.connector.enableJK=\${AJP_PORT}"</pre>
</li>
<li>Now you have to define the values for these properties for each instance running in the cluster (this can also be done from the domain administration server)
<pre>asadmin create-system-properties --target instance1 AJP_INSTANCE_NAME=instance1
asadmin create-system-properties --target instance1 AJP_PORT=8020</pre>
</li>
</ol>
</li>
<li>Configuring the apache web server
<ol>
<li>Copy the mod_jk.so to a apache accessible directory.</li>
<li>Copy the following lines to your apache main config file.
<pre>LoadModule jk_module <strong>&lt;path to your mod_jk.so&gt;</strong>
JkWorkersFile <strong>&lt;path to your worker.properties (created later)&gt;</strong>
JkLogFile <strong>&lt;path to your mod_jk.log&gt;</strong>
JkLogLevel debug
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
JkOptions +ForwardURICompat -ForwardDirectories
JkRequestLogFormat "%w %V %T"</pre>
</li>
<li>Copy the following lines to your virtual host configuration (or into the main config, if you don&#8217;t use virtual hosts).
<pre>JkMount /* loadbalancer</pre>
</li>
<li>This will redirect all requests to your load balancer. (You can also use patterns like <em>/*.jsp</em> for only redirecting jsp file request to the load balancer or just any other sensefull pattern).</li>
</ol>
</li>
<li>Writing your worker.properties configuration file.
<pre>worker.list=loadbalancer

# Set properties for instance1
worker.instance1.type=ajp13
worker.instance1.host=<strong>&lt;host of instance1&gt;</strong>
worker.instance1.port=<strong>&lt;AJP port of instance1&gt;</strong>
worker.instance1.lbfactor=50
worker.instance1.connection_pool_size=10
worker.instance1.connection_pool_timeout=600
worker.instance1.socket_keepalive=1
worker.instance1.socket_timeout=300

# Set properties for instance2
worker.instance2.type=ajp13
worker.instance2.host=<strong>&lt;host of instance2&gt;</strong>
worker.instance2.port=<strong>&lt;AJP port of instance2&gt;</strong>
worker.instance2.lbfactor=50
worker.instance2.connection_pool_size=10
worker.instance2.connection_pool_timeout=600
worker.instance2.socket_keepalive=1
worker.instance2.socket_timeout=300

worker.loadbalancer.type=lb
worker.loadbalancer.balance_workers=instance1,instance2</pre>
</li>
<li>Restart all cluster instances and the web server. Your load balancing should be working now.<br />
Each time a new session is creted by the glassfish, it appends its instance name to the JSESSIONID, so the load balancer can determine on which instance to route the request.<br />
If one instance crashes, the load balancer will notice this and redirects all requests to another instance. If you have enabled session replication, your old session will be resumed there.</li>
</ol>
<h3>Further reading</h3>
<ul>
<li><a href="http://www.dirkreske.de/enable-glassfish-session-replication/">enable session replication</a></li>
<li><a href="http://www.dirkreske.de/glassfish-cluster-configuration/">setting up a glassfish cluster</a></li>
<li><a href="http://tomcat.apache.org/connectors-doc/reference/workers.html" target="_blank">mod_jk connector documentation</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.dirkreske.de/load-balancing-glassfish-using-apache/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Enable glassfish session replication</title>
		<link>http://www.dirkreske.de/enable-glassfish-session-replication/</link>
		<comments>http://www.dirkreske.de/enable-glassfish-session-replication/#comments</comments>
		<pubDate>Sat, 31 Oct 2009 00:31:47 +0000</pubDate>
		<dc:creator>Dirk Reske</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[cluster]]></category>
		<category><![CDATA[glassfish]]></category>
		<category><![CDATA[high availability]]></category>
		<category><![CDATA[javaee]]></category>

		<guid isPermaLink="false">http://www.dirkreske.de/?p=86</guid>
		<description><![CDATA[Overview One of the high availability methods provided by glassfish, is session replication. With session replication enabled, the server distributes<a href="http://www.dirkreske.de/enable-glassfish-session-replication/" class="searchmore">Read the Rest...</a><div class="clr"></div>]]></description>
			<content:encoded><![CDATA[<h3>Overview</h3>
<p>One of the high availability methods provided by glassfish, is session replication.<br />
With session replication enabled, the server distributes session data across the cluster. If one cluster instances crashes, the session is still available on the other instances.</p>
<h3>Requirements</h3>
<ul>
<li>A recent glassfish installation (versions prior to 2.1.1 had some bugs).</li>
<li>A configured cluster (Look <a href="../glassfish-cluster-configuration/">here </a>who to install a glassfish cluster).</li>
<li>All cluster instances located in the same subnet. (later glassfish version should support different subnets)</li>
</ul>
<h3>Configure session replication</h3>
<ol>
<li>Add a <em>&lt;distributable /&gt;</em> tag to your web.xml
<pre>&lt;web-app&gt;
  &lt;distributable /&gt;
  ...
&lt;/web-app&gt;</pre>
</li>
<li>Add following lines to your sun-web.xml
<pre>&lt;session-config&gt;
  &lt;session-manager persistence-type="replicated"&gt;
    &lt;manager-properties&gt;
      &lt;property name="persitencerequency" value="web-method" /&gt;
    &lt;/manager-properties&gt;
    &lt;store-properties&gt;
      &lt;property name="persistenceScope" value="session" /&gt;
    &lt;/store-properties&gt;
  &lt;/session-manager&gt;
&lt;/session-config&gt;</pre>
<ul>
<li><em>persistenceType=&#8221;replicated&#8221; </em>says, that the session should be replicated along the cluster.</li>
<li><em>persistenceFrequency=&#8221;web-method&#8221;</em> says that the session state should be stored after processing a request, but before sending the response. (other values: <em>time-based</em>)</li>
<li><em>persistenceScope=&#8221;session&#8221;</em> says that the whole session state should be stored. (other values: <em>modified-session</em>, <em>modified-attribute</em>)</li>
</ul>
</li>
<li>Deploy application
<ul>
<li>using the web-interface: check the <em>Availability </em>checkbox.</li>
<li>using the cli: add <em>&#8211;availabilityenabled=true</em> parameter.</li>
</ul>
</li>
</ol>
<h3>Notes</h3>
<ul>
<li>Be sure that all classes that are going to be stored in a session implements the <em>Serializable </em>interface.<br />
If not, the server can&#8217;t serialize it and replication won&#8217;t work.</li>
<li>As already mentioned, the instances have to be on the same subnet, otherwise session replication will not work.</li>
</ul>
<h3>Further reading</h3>
<p><a href="http://docs.sun.com/app/docs/doc/820-4336/gdshu?a=view" target="_blank">The replicated Persistence Type</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dirkreske.de/enable-glassfish-session-replication/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Glassfish cluster configuration</title>
		<link>http://www.dirkreske.de/glassfish-cluster-configuration/</link>
		<comments>http://www.dirkreske.de/glassfish-cluster-configuration/#comments</comments>
		<pubDate>Sun, 25 Oct 2009 23:00:13 +0000</pubDate>
		<dc:creator>Dirk Reske</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[cluster]]></category>
		<category><![CDATA[glassfish]]></category>
		<category><![CDATA[high availability]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[javaee]]></category>

		<guid isPermaLink="false">http://www.dirkreske.de/?p=41</guid>
		<description><![CDATA[Overview After I looked around the web, I&#8217;ve found a few good howto&#8217;s about glassfish cluster configuration, but either they<a href="http://www.dirkreske.de/glassfish-cluster-configuration/" class="searchmore">Read the Rest...</a><div class="clr"></div>]]></description>
			<content:encoded><![CDATA[<h3>Overview</h3>
<p>After I looked around the web, I&#8217;ve found a few good howto&#8217;s about glassfish cluster configuration, but either they use only single machine clusters or they have some other disadvantages in my eyes. So I&#8217;ve decided to write my own article about this.</p>
<p>This article will describes how to set up a two machine cluster which consists of the domain administration server (DAS) and a &#8220;normal&#8221; node. Thereby the DAS also works as such a normal node.</p>
<p>This article uses Glassfish v2.1.</p>
<h3>Before the installation</h3>
<p>You have to ensure, that your network is configured properly, especially the dns system. If there are problems, there will be curious problems while setting all up. I&#8217;ve done this using the hosts file.</p>
<pre>10.0.0.1   das-host
10.0.0.2   node2-host
10.0.0.x   nodex-host</pre>
<p>The next thing is the firewall. The nodes communicating using a couple of ports. For setup and testing I&#8217;ve configured my firewalls to accept everything from all the other nodes, so there are no problems for the nodes to communicate with each other.</p>
<h3>Setting up the DAS</h3>
<p>Because the DAS server needs cluster support, we have to configure this first.<br />
There are two ways to do this.</p>
<ul>
<li>install the glassfish server using:
<pre>ant -f setup-cluster.xml</pre>
</li>
<li>activate cluster support using the admin console
<ol>
<li>go the the admin console (e.g. http://localhost:4848)</li>
<li>select from the common task: Enable Cluster Support</li>
</ol>
</li>
</ul>
<p>Now start up the server using:</p>
<pre>asadmin start-domain domain1</pre>
<p>In the next steps, I will create the cluster, then a node-agent and one instance running on the DAS server using the cli.</p>
<p>In most cases you have to specifiy your admin username and password. This can be done using the <em>&#8211;user</em> and <em>&#8211;passwordfile</em> parameters, but for simpler reading I will omit this. The server will ask you in this case.</p>
<ol>
<li>Create the cluster:
<pre>asadmin create-cluster cluster1</pre>
<p>This creates a cluster on the local server (the DAS) with the name <em>cluster1</em>.</li>
<li>Create the node agent:
<pre>asadmin create-node-agent das-agent</pre>
<p>This will create the node agent for the current node.</li>
<li>Create the instance for the current node:
<pre>asadmin create-instance --nodeagent das-agent --cluster cluster1 instance1</pre>
<p>This will create the instance <em>instance1</em> associated with the node agent <em>das-agent</em> and the cluster <em>cluster1</em>.</li>
<li>Now start up the node agent and the associated instance:
<pre>asadmin start-node-agent --syncinstances=true --startinstances=true das-agent</pre>
<ul>
<li><em>&#8211;syncinstances=true</em> says that the node agent should synchronize its instances with the central repository of the DAS</li>
<li><em>&#8211;startinstances=true</em> says the the node agent should start all its instances (instance1 in our case)</li>
</ul>
</li>
</ol>
<p>Now the domain administration server is up and running.<br />
The first node is also running.</p>
<h3>Setting up the second node</h3>
<p>Now come to setup the second node.<br />
Because the second node should only work a &#8220;computing&#8221; node, we do not need to install the whole application server, just a node agent.<br />
I omit user and password parameters here too. You have to enter the DAS login informations when asked for.</p>
<ol>
<li>Install the node agent:
<pre>ant -f setup-cluster.xml create-node-agent -Ddas.host=das-host -Dnodeagent.name=node2-agent</pre>
<ul>
<li><em>-Ddas.host=das-host</em> sets the hostname of the domain administration server</li>
<li><em>-Dnodeagent.name=node2-agent</em> sets the name of the local node agent</li>
</ul>
</li>
<li>Create the new instance:
<pre>asadmin create-instance --host das-host --nodeagent node2-agent --cluster cluster1 instance2</pre>
<p>This will create the new instance associated with the node agent<em> node2-agent</em> and the cluster <em>cluster1</em>. The <em>&#8211;host</em> parameter specifies the hostname of the domain administration server.</li>
<li>Start the instance:
<pre>asadmin start-node-agent --syncinstances=true --startinstances=true node2-agent</pre>
<p>Now the local node agent starts, synchronizes with the das server and starts all local instances (only <em>instance2 </em>in our case)</li>
</ol>
<p>Now your cluster is running with two nodes. To add more nodes, just repeat the three above steps as much as you want.</p>
<h3>Deploying applications to the cluster</h3>
<p>For deploying applications to the cluster, just type on the das server</p>
<pre>asadmin deploy --user admin --target cluster1 MyApplication.ear</pre>
<p>This will deploy the application to the whole cluster.</p>
<h3>For further reading</h3>
<ul>
<li><a href="http://www.dirkreske.de/enable-glassfish-session-replication/">Enable glassfish session replication</a></li>
<li><a href="http://docs.sun.com/app/docs/doc/819-3675/create-cluster-1?l=de&amp;a=view" target="_blank">create-cluster command</a></li>
<li><a href="http://docs.sun.com/app/docs/doc/819-3675/create-node-agent-1?l=de&amp;a=view" target="_blank">create-node-agent command</a></li>
<li><a href="http://docs.sun.com/app/docs/doc/819-3675/create-instance-1?l=de&amp;a=view" target="_blank">create-instance command</a></li>
<li><a href="http://docs.sun.com/app/docs/doc/819-3675/start-node-agent-1?l=de&amp;a=view" target="_blank">start-node-agent command</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.dirkreske.de/glassfish-cluster-configuration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>nxApex Workflow Editor</title>
		<link>http://www.dirkreske.de/nxapex-workflow-editor/</link>
		<comments>http://www.dirkreske.de/nxapex-workflow-editor/#comments</comments>
		<pubDate>Sun, 25 Oct 2009 19:04:10 +0000</pubDate>
		<dc:creator>Dirk Reske</dc:creator>
				<category><![CDATA[Project References]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[javaee]]></category>
		<category><![CDATA[jboss]]></category>

		<guid isPermaLink="false">http://www.dirkreske.de/?p=31</guid>
		<description><![CDATA[The Workflow Editor is a part of the net-linx application nxApex. The users of this application are phone directory publishers.<a href="http://www.dirkreske.de/nxapex-workflow-editor/" class="searchmore">Read the Rest...</a><div class="clr"></div>]]></description>
			<content:encoded><![CDATA[<p>The Workflow Editor is a part of the net-linx application nxApex. The users of this application are phone directory publishers. Service order is a process to import customer information like address, phone number, placement information, etc and to create and update the existing information in the customer database by creating, deleting or updating this information.</p>
<p>This is a rather complex process and it is different from publisher to publisher. In the past the service order module has been customized for each publisher.</p>
<p>The new workflow editor is used to edit flexible workflows that can be adopted easily by configuration personnel. On the development of this module external student apprentices took part together with experienced internal Java developers.</p>
<h3>Workflow Overview</h3>
<p>The Workflow Editor is meant for system administrator use only. The information provided in this module is technical and not meant for end user&#8217;s view.</p>
<p>The workflow for service order and other DAQ processes is specified in workflow configuration file.<br />
The workflow configuration file contains all workflows. A workflow is always bound to a record type. You can define more than one workflow for a record type. The workflow which should be used must be marked as default.</p>
<p>A workflow can contain the following items: transformation items, validation items, search items and processing items, process flow items, and actions.</p>
<p>All changes made to the record data during the processing of the workflow are discarded after the workflow is finished if not otherwise specified. (See transformation item). Changes made to the administrative data (status, status messages) are saved to the database.</p>
<p>A workflow defines the sequence in which the rules should be processed and the actions depending on the output value of one rule. Rules are for example matching rules.</p>
<p>A workflow consists of a list of workflow items. These workflow items define the rules which should be used and the actions which should be taken on a specific rule output.<br />
If no action is defined for a specific output value is defined, a default action will be used.<br />
The default action for the output values &#8216;NotUsed&#8217; and &#8216;Ok&#8217; is &#8216;Goto Next Item&#8217;. The default action for &#8216;Error&#8217; is &#8216;Reject Immediate&#8217;.<br />
Every action is defined by an action code and a number of parameters.</p>
<p><img class="alignnone size-full wp-image-32" title="workflow-editor" src="http://www.dirkreske.de/wp-content/uploads/2009/10/workflow-editor.jpg" alt="workflow-editor" width="505" height="315" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dirkreske.de/nxapex-workflow-editor/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Crystal Web</title>
		<link>http://www.dirkreske.de/crystal-web/</link>
		<comments>http://www.dirkreske.de/crystal-web/#comments</comments>
		<pubDate>Sun, 25 Oct 2009 16:46:21 +0000</pubDate>
		<dc:creator>Dirk Reske</dc:creator>
				<category><![CDATA[Project References]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[crystal reports]]></category>

		<guid isPermaLink="false">http://www.dirkreske.de/23/</guid>
		<description><![CDATA[CrystalWeb is a web reporting application written for a company from Stralsund. The application is used for hosting Crystal Reports<a href="http://www.dirkreske.de/crystal-web/" class="searchmore">Read the Rest...</a><div class="clr"></div>]]></description>
			<content:encoded><![CDATA[<p>CrystalWeb is a web reporting application written for a company from Stralsund.</p>
<p><a href="http://www.dirkreske.de/wp-content/uploads/2009/10/crystalweb.jpg"><img class="alignnone size-full wp-image-61" title="crystalweb" src="http://www.dirkreske.de/wp-content/uploads/2009/10/crystalweb.jpg" alt="" width="437" height="355" /></a></p>
<p>The application is used for hosting Crystal Reports reports in the intranet of the company. The administrator is able to put new reports to the system, which is directly connected to the internal <a href="http://www.halvotec.de/" target="_blank">RIOS</a> database for always up tp date data.<br />
This database is also used for the user managment configured by the report administrator. So only authorized users are able to see their appropriate reports.</p>
<p>The application is completely written in C# and ASP.Net 2.0 and is hosted on a Windows 2003 Server.<br />
The Rios database is a MS-SQL server and the report data used by the web application is stored in xml files, which are going to be replaced by a sql server, too (for better performance).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dirkreske.de/crystal-web/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>UniCar</title>
		<link>http://www.dirkreske.de/unicar/</link>
		<comments>http://www.dirkreske.de/unicar/#comments</comments>
		<pubDate>Sun, 25 Oct 2009 16:44:55 +0000</pubDate>
		<dc:creator>Dirk Reske</dc:creator>
				<category><![CDATA[Project References]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.dirkreske.de/?p=20</guid>
		<description><![CDATA[UniCar is a web application for managing car pools. With UniCar it is possible to manage all aspects of a<a href="http://www.dirkreske.de/unicar/" class="searchmore">Read the Rest...</a><div class="clr"></div>]]></description>
			<content:encoded><![CDATA[<p>UniCar is a web application for managing car pools.</p>
<p>With UniCar it is possible to manage all aspects of a car pool. Users who need a car from the pool can quickly get the informations about the available cars. Detailed informations about every car are stored, if a user looks for a car for special purposes.</p>
<p>Because the drivers have to fill out a little report after using a car (only about one minute), there are also a lot of analysis possibilities.<br />
A few of this are:</p>
<ul>
<li>Who had a specific car at a specific time?</li>
<li>When was the car refuiled the last time?</li>
<li>and many more</li>
</ul>
<p>The pool administrators are also notified for coming service events for the cars (technicals service, security services).<br />
If there are cars that are buyed using leasing contracts, the administrators are also notified about arriving a cars maximum driving distance.<br />
The system also tries to balance the driving distances of the cars. So if a user just wants some car, the system compares the driving distances (under different terms, e.g. purchase contract) and decides which one to reserve. So there is not one car used all the time and another that is standing in the garage for months.</p>
<p>The application is a plugin for the <a href="http://www.phprojekt.com/" target="_blank">PHProject</a> web application.<br />
Its completely written in PHP and uses MySQL for data.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dirkreske.de/unicar/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PathFinder</title>
		<link>http://www.dirkreske.de/pathfinder/</link>
		<comments>http://www.dirkreske.de/pathfinder/#comments</comments>
		<pubDate>Sun, 25 Oct 2009 16:31:04 +0000</pubDate>
		<dc:creator>Dirk Reske</dc:creator>
				<category><![CDATA[Project References]]></category>
		<category><![CDATA[algorithm]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[shortest path]]></category>
		<category><![CDATA[swing]]></category>

		<guid isPermaLink="false">http://www.dirkreske.de/?p=15</guid>
		<description><![CDATA[PathFinder is an application for visualizing path finding algorithms written in by Armin and me. The source code of pathfinder<a href="http://www.dirkreske.de/pathfinder/" class="searchmore">Read the Rest...</a><div class="clr"></div>]]></description>
			<content:encoded><![CDATA[<p>PathFinder is an application for visualizing path finding algorithms written in by <a href="http://armin.widegreen.de/" target="_blank">Armin </a>and me.</p>
<p>The source code of pathfinder was published at sourceforge.net (<a href="https://sourceforge.net/projects/jpathfinder/" target="_blank">project page</a>).</p>
<p><a href="http://www.dirkreske.de/wp-content/uploads/2009/10/pathfinder.jpg"><img class="alignnone size-full wp-image-60" title="pathfinder" src="http://www.dirkreske.de/wp-content/uploads/2009/10/pathfinder.jpg" alt="" width="522" height="312" /></a></p>
<p>The application can visualize the whole calculation of the implemented path finding algorithms.<br />
These algorithms are:</p>
<ul>
<li>A*</li>
<li>Depth first</li>
<li>Breadth first</li>
<li>Hill climbing</li>
<li>Beam search</li>
<li>British museum</li>
<li>Branch and bound</li>
<li>Dijkstra</li>
<li>Depth limited</li>
<li>Great deluge</li>
</ul>
<p>Because of a very generic and abstract application design it is very simple to add new algorithms to the repository.</p>
<p>The core data model of PathFinder is a more or less simple graph (nodes connected by edges), that can be overlayed by an image for better visualization (e.g. a map like in the upper picture).<br />
The algorithms try to find a path from a start node to a destination nodes. Depending on the choosen algorithm this path should be the shortest path or just one path. Using the build in graph editor (picture below), the user is able to simply create own graphs.</p>
<p><a href="http://www.dirkreske.de/wp-content/uploads/2009/10/grapheditor.jpg"><img class="alignnone size-full wp-image-59" title="grapheditor" src="http://www.dirkreske.de/wp-content/uploads/2009/10/grapheditor.jpg" alt="" width="499" height="274" /></a></p>
<p>The most of these algorithms can be heavily parameterized to control the way the algorithm works.<br />
While working, the algorithm notifies the application about each calculation step. So, after the algorithm completes, the user is able to re-run the calculation in every speed or just step by step.<br />
This is great for understandig how a algorithm works or to look for weaknesses in a new algorithm.</p>
<p>After a calculation completes, also some statistics are stored in a history.<br />
Some of these values are:</p>
<ul>
<li>Time for calculation</li>
<li>Steps in the graph model</li>
<li>Length of the path (and the air distance between start and destination for comparison)</li>
<li>Count of backtracking nodes (this are nodes visited by the algorithm for calculation but not used in the path)</li>
<li>The parameters given to the algorithm</li>
</ul>
<p>Using the history, it is possible to compare differend algorithms or different parameters with each other.<br />
Therefore the pure statistic values can be compared, or the paths can be viewed together on the same graph. So it is very easy to see the differences of algorithms or the impacts of parameters.</p>
<p>The application is written completely in Java (1.6 standard edition) and was part of a projekt at our university.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dirkreske.de/pathfinder/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
