<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7256888056988953356</id><updated>2024-08-29T19:08:03.654-07:00</updated><category term="java"/><category term="javazone"/><title type='text'>k0de</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://kjetilod.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7256888056988953356/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://kjetilod.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/7256888056988953356/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Kjetil</name><uri>http://www.blogger.com/profile/08256707219769938203</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://lh5.google.co.uk/kjetil.odegaard/RxOsNDblsbI/AAAAAAAAADw/l4iQqDP8bE8/s400/kjetilod.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>29</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7256888056988953356.post-1309677900210922188</id><published>2011-01-22T09:28:00.000-08:00</published><updated>2011-01-22T09:28:27.027-08:00</updated><title type='text'></title><content type='html'>&lt;blockquote&gt;Emacs vs Vi reminds me of the Iran-Iraq war. A war that went on for ages, in a place that nobody cared about, between two groups that nobody cared about, that stagnated and stunted their development, while the rest of the world left them behind.&lt;br /&gt;
&lt;/blockquote&gt;&lt;br /&gt;
&quot;Stormbringer&quot; nails it.&lt;br /&gt;
&lt;br /&gt;
http://news.ycombinator.com/item?id=2125283</content><link rel='replies' type='application/atom+xml' href='http://kjetilod.blogspot.com/feeds/1309677900210922188/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7256888056988953356/1309677900210922188' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7256888056988953356/posts/default/1309677900210922188'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7256888056988953356/posts/default/1309677900210922188'/><link rel='alternate' type='text/html' href='http://kjetilod.blogspot.com/2011/01/emacs-vs-vi-reminds-me-of-iran-iraq-war.html' title=''/><author><name>Kjetil</name><uri>http://www.blogger.com/profile/08256707219769938203</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://lh5.google.co.uk/kjetil.odegaard/RxOsNDblsbI/AAAAAAAAADw/l4iQqDP8bE8/s400/kjetilod.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7256888056988953356.post-4940699369352338652</id><published>2010-09-30T10:56:00.000-07:00</published><updated>2010-09-30T10:58:10.111-07:00</updated><title type='text'>OpenJDK and Project Lambda on MacOS X 10.6</title><content type='html'>Want to try out the upcoming JDK 7 on your Mac? And closures from Project Lambda, due in JDK 8? There are currently no official binary build available for MacOS X, but it turns out that it&#39;s actually gotten pretty easy to build these projects yourself. With just 10 minutes of work and a little waiting you could have a working build! Here&#39;s my account of how to do it.&lt;br /&gt;
&lt;br /&gt;
First, install Mercurial and the forest extension. If you have Macports, this is as easy as&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;$ sudo port install mercurial&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;$ sudo port install hg-forest&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Now check out the OpenJDK bsd-port tree:&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;$ hg fclone http://hg.openjdk.java.net/bsd-port/bsd-port&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
You have to download soylatte16-amd64-1.0.3.tar.bz2 from&lt;br /&gt;
&lt;br /&gt;
http://landonf.bikemonkey.org/static/soylatte/#get&lt;br /&gt;
&lt;br /&gt;
and unpack it. This is needed for bootstrapping the build.&lt;br /&gt;
&lt;br /&gt;
Use this build script:&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;export SOYLATTE_HOME=$HOME/src/soylatte16-amd64-1.0.3&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;export JAVA_HOME=$SOYLATTE_HOME&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;cd bsd-port&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;time env -i PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin \&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;make \&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;CC=gcc-4.0 CXX=g++-4.0 \&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;ALT_BOOTDIR=$SOYLATTE_HOME \&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;JAVA_TOOLS_DIR=$SOYLATTE_HOME/bin \&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;ALLOW_DOWNLOADS=true \&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;ALT_FREETYPE_HEADERS_PATH=/usr/X11R6/include \&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;ALT_FREETYPE_LIB_PATH=/usr/X11R6/lib \&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;ANT_HOME=/usr/share/ant \&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;NO_DOCS=true \&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;HOTSPOT_BUILD_JOBS=1&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
This is based on Sam Pullara&#39;s &lt;a href=&quot;http://www.javarants.com/2009/11/01/building-openjdk-1-7-0-for-mac-os-x-10-6-snow-leopard/&quot;&gt;Building OpenJDK 1.7.0&lt;/a&gt; post. I&amp;nbsp;just had to add ALLOW_DOWNLOADS=true to avoid this error:&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;ERROR: Cannot find source for project jaxp.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
When you run the script (if all goes well) you should get a lot of output that ends with&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;Control bsd i586 1.7.0-internal all build finished: 10-09-30 15:37&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
On my MacBook Pro (Core i7, 4 GB RAM, SSD) this took a little over 20 minutes.&lt;br /&gt;
&lt;br /&gt;
Now move your newly built JDK somewhere more sensible:&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;$ mv bsd-port/build/bsd-i586/j2sdk-image ~/jdk7&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Test the install:&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;$ jdk7/bin/java -version&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;openjdk version &quot;1.7.0-internal&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;OpenJDK Runtime Environment (build 1.7.0-internal-kjetilod_2010_09_30_15_15-b00)&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;OpenJDK Server VM (build 19.0-b05, mixed mode)&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-large;&quot;&gt;Project Lambda&lt;/span&gt;&lt;br /&gt;
For bonus points, here&#39;s how you build Project Lambda (based on a post by Rémi Forax to the lambda-dev mailing list):&lt;br /&gt;
&lt;br /&gt;
Checkout the source:&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: collapse; font-size: 13px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;$ hg clone&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: collapse; font-size: 13px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: collapse; font-size: 13px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;http://hg.openjdk.java.net/&lt;wbr&gt;&lt;/wbr&gt;lambda/lambda/langtools&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Build it with Ant (I just used 1.7.1 which comes with MacOS X):&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;$ cd lambda/langtools/&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;$ ant -Dboot.java.home=$HOME/jdk7 -f make/build.xml&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;From Rémi&#39;s post:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;blockquote&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;To run the compiler:&amp;nbsp;&lt;/span&gt;&lt;/blockquote&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: collapse;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: collapse;&quot;&gt;&lt;blockquote&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;path beta=&quot;&quot; jdk1.7.0=&quot;&quot; to=&quot;&quot;&gt;/bin/java -cp classes.jar&lt;/path&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: collapse;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: collapse;&quot;&gt;&lt;blockquote&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;com.sun.tools.javac.Main yoursource.java&lt;your source.java=&quot;&quot;&gt;&lt;/your&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: collapse;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: collapse;&quot;&gt;&lt;blockquote&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/blockquote&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: collapse;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: collapse;&quot;&gt;&lt;blockquote&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;and to run your code:&lt;/span&gt;&lt;/blockquote&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: collapse;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: collapse;&quot;&gt;&lt;blockquote&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;path beta=&quot;&quot; jdk1.7.0=&quot;&quot; to=&quot;&quot;&gt;/bin/java -cp classes.jar:. YourClass&lt;your class=&quot;&quot;&gt;&lt;/your&gt;&lt;/path&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: arial, sans-serif; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: collapse; font-size: 13px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kjetilod.blogspot.com/feeds/4940699369352338652/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7256888056988953356/4940699369352338652' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7256888056988953356/posts/default/4940699369352338652'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7256888056988953356/posts/default/4940699369352338652'/><link rel='alternate' type='text/html' href='http://kjetilod.blogspot.com/2010/09/openjdk-and-project-lambda-on-macos-x.html' title='OpenJDK and Project Lambda on MacOS X 10.6'/><author><name>Kjetil</name><uri>http://www.blogger.com/profile/08256707219769938203</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://lh5.google.co.uk/kjetil.odegaard/RxOsNDblsbI/AAAAAAAAADw/l4iQqDP8bE8/s400/kjetilod.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7256888056988953356.post-958437961135509399</id><published>2009-08-12T04:00:00.001-07:00</published><updated>2009-08-12T04:00:36.437-07:00</updated><title type='text'>WAS tip: Application build level</title><content type='html'>If you want WebSphere to display &quot;Application build level&quot; for your application, your EAR Manifest has to contain &quot;Implementation-version&quot;.&lt;br&gt;&lt;br&gt;For Maven to add this automatically, add this to your EAR pom:&lt;br&gt;&lt;br&gt;&lt;span style=&quot;font-family: Courier New;&quot;&gt;&amp;lt;project&amp;gt;&lt;/span&gt;&lt;br style=&quot;font-family: Courier New;&quot;&gt;&lt;span style=&quot;font-family: Courier New;&quot;&gt; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;br&gt;&lt;br style=&quot;font-family: Courier New;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Courier New;&quot;&gt; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;build&amp;gt;&lt;/span&gt;&lt;br style=&quot;font-family: Courier New;&quot;&gt;&lt;span style=&quot;font-family: Courier New;&quot;&gt; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;plugins&amp;gt;&lt;/span&gt;&lt;br style=&quot;font-family: Courier New;&quot;&gt;&lt;span style=&quot;font-family: Courier New;&quot;&gt; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;plugin&amp;gt;&lt;/span&gt;&lt;br style=&quot;font-family: Courier New;&quot;&gt;&lt;span style=&quot;font-family: Courier New;&quot;&gt; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;artifactId&amp;gt;maven-ear-plugin&amp;lt;/artifactId&amp;gt;&lt;/span&gt;&lt;br style=&quot;font-family: Courier New;&quot;&gt;&lt;span style=&quot;font-family: Courier New;&quot;&gt; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;configuration&amp;gt;&lt;/span&gt;&lt;br style=&quot;font-family: Courier New;&quot;&gt;&lt;span style=&quot;font-family: Courier New;&quot;&gt; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;addDefaultImplementationEntries&amp;gt;true&amp;lt;/addDefaultImplementationEntries&amp;gt;&lt;/span&gt;&lt;br style=&quot;font-family: Courier New;&quot;&gt;&lt;span style=&quot;font-family: Courier New;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;lt;/configuration&amp;gt;&lt;/span&gt;&lt;br style=&quot;font-family: Courier New;&quot;&gt;&lt;span style=&quot;font-family: Courier New;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;/plugin&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;/plugins&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/build&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;br style=&quot;font-family: Courier New;&quot;&gt;&lt;span style=&quot;font-family: Courier New;&quot;&gt;&amp;lt;/project&amp;gt;&lt;/span&gt;&lt;br&gt;</content><link rel='replies' type='application/atom+xml' href='http://kjetilod.blogspot.com/feeds/958437961135509399/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7256888056988953356/958437961135509399' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7256888056988953356/posts/default/958437961135509399'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7256888056988953356/posts/default/958437961135509399'/><link rel='alternate' type='text/html' href='http://kjetilod.blogspot.com/2009/08/was-tip-application-build-level.html' title='WAS tip: Application build level'/><author><name>Kjetil</name><uri>http://www.blogger.com/profile/08256707219769938203</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://lh5.google.co.uk/kjetil.odegaard/RxOsNDblsbI/AAAAAAAAADw/l4iQqDP8bE8/s400/kjetilod.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7256888056988953356.post-229980578175363460</id><published>2009-03-24T14:34:00.001-07:00</published><updated>2009-03-24T14:34:25.753-07:00</updated><title type='text'>IdeaPad FTW!</title><content type='html'>&lt;br /&gt;&lt;br /&gt; &lt;br /&gt; &lt;br /&gt; &lt;br /&gt;Just got a new toy to satisfy my geek needs: a Lenovo IdeaPad S10e. So far, I&#39;m pretty happy with it. Here are some thoughts after a couple of days&#39; use.&lt;br&gt;&lt;br&gt;&lt;b&gt;It&#39;s a decent browsing machine&lt;/b&gt;. A 1024x576 screen resolution is just barely adequate for normal web browsing these days. Heavy flash use sometimes make scrolling a bit choppy. But the fantastic portability more than makes up for these shortcomings. (No, an iPhone doesn&#39;t really compete.)&lt;br&gt;&lt;br&gt;&lt;b&gt;The keyboard is not fit for serious development work.&lt;/b&gt; I&#39;m typing this on the somewhat smaller-than-usual keyboard and I&#39;m doing ok. However, there is only one Ctrl key, the tab key is tiiiiiiny, and the layout is kind of cramped together which makes it hard to touch type anything else than normal letters. The CPU and RAM might not be particularly impressive compared to your workstation, but for me they&#39;re not the main bottlenecks.&lt;br&gt;&lt;br&gt;&lt;b&gt;I like it.&lt;/b&gt; I&#39;ve never had a laptop this portable. My normal work laptop is a 17&quot; workstation model, which is great for the performance and screen size, but not so much for taking notes in meetings.&lt;br&gt;&lt;br&gt;Now, to try out Ubuntu Netbook Remix in my copious free time...&lt;br&gt;</content><link rel='replies' type='application/atom+xml' href='http://kjetilod.blogspot.com/feeds/229980578175363460/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7256888056988953356/229980578175363460' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7256888056988953356/posts/default/229980578175363460'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7256888056988953356/posts/default/229980578175363460'/><link rel='alternate' type='text/html' href='http://kjetilod.blogspot.com/2009/03/ideapad-ftw.html' title='IdeaPad FTW!'/><author><name>Kjetil</name><uri>http://www.blogger.com/profile/08256707219769938203</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://lh5.google.co.uk/kjetil.odegaard/RxOsNDblsbI/AAAAAAAAADw/l4iQqDP8bE8/s400/kjetilod.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7256888056988953356.post-8907736312355884810</id><published>2009-03-12T12:01:00.000-07:00</published><updated>2009-03-12T12:08:59.476-07:00</updated><title type='text'>Mac Keyboard layout driving you crazy?</title><content type='html'>I&#39;m officially giving up adapting to the incompatible Mac keyboard layout. &lt;a href=&quot;http://ycode.blogspot.com/2008/01/howto-pc-style-keyboard-mapping-on-mac.html&quot;&gt;This page&lt;/a&gt; explains what you need to do to fix it.&lt;br /&gt;&lt;br /&gt;I&#39;m also switching IntelliJ over to the standard PC-style layout, which is trivial to do. Life&#39;s too short to make adjustments to this crap.</content><link rel='replies' type='application/atom+xml' href='http://kjetilod.blogspot.com/feeds/8907736312355884810/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7256888056988953356/8907736312355884810' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7256888056988953356/posts/default/8907736312355884810'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7256888056988953356/posts/default/8907736312355884810'/><link rel='alternate' type='text/html' href='http://kjetilod.blogspot.com/2009/03/mac-keyboard-layout-driving-you-crazy.html' title='Mac Keyboard layout driving you crazy?'/><author><name>Kjetil</name><uri>http://www.blogger.com/profile/08256707219769938203</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://lh5.google.co.uk/kjetil.odegaard/RxOsNDblsbI/AAAAAAAAADw/l4iQqDP8bE8/s400/kjetilod.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7256888056988953356.post-5497827998293637016</id><published>2009-01-14T08:49:00.000-08:00</published><updated>2009-01-14T08:50:50.619-08:00</updated><title type='text'></title><content type='html'>Leaving it here so I&#39;ll find it later: If RAD complains that an EAR project won&#39;t build because&lt;br /&gt;&quot;The deployment descriptor of the module &#39;xxx.war&#39; cannot be loaded.&quot; for WAR or EJB modules, you have to add them to the org.eclipse.wst.common.component file in the .settings directory in the project directory, like this&lt;br /&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;blockquote&gt;&lt;span style=&quot;font-family: courier new;&quot;&gt;&lt;dependent-module path=&quot;/&quot; handle=&quot;&quot;&gt;/&lt;project&gt;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: courier new;&quot;&gt;&lt;dependent-object&gt;WebModule_&lt;number&gt;&lt;/dependent-object&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: courier new;&quot;&gt;&lt;dependency-type&gt;uses&lt;/dependency-type&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: courier new;&quot;&gt;&lt;/dependent-module&gt;&lt;/span&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;/div&gt;Found this here: http://www-128.ibm.com/developerworks/forums/thread.jspa?messageID=14048396&amp;amp;#14048396</content><link rel='replies' type='application/atom+xml' href='http://kjetilod.blogspot.com/feeds/5497827998293637016/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7256888056988953356/5497827998293637016' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7256888056988953356/posts/default/5497827998293637016'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7256888056988953356/posts/default/5497827998293637016'/><link rel='alternate' type='text/html' href='http://kjetilod.blogspot.com/2009/01/leaving-it-here-so-ill-find-it-later-if.html' title=''/><author><name>Kjetil</name><uri>http://www.blogger.com/profile/08256707219769938203</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://lh5.google.co.uk/kjetil.odegaard/RxOsNDblsbI/AAAAAAAAADw/l4iQqDP8bE8/s400/kjetilod.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7256888056988953356.post-105226444715738892</id><published>2008-09-23T11:01:00.000-07:00</published><updated>2008-09-23T11:52:35.835-07:00</updated><title type='text'>String constructor considered useless turns out to be useful after all (film at 11)</title><content type='html'>When you were still a Java neophyte, chances are you wrote some code that looked like this:&lt;div&gt;&lt;blockquote&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;courier new&#39;;&quot;&gt;String s = new String(&quot;test&quot;);&lt;/span&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;div&gt;Brings back some embarrassing memories, doesn&#39;t it? You soon learned that instantiating Strings via the constructor was hardly ever done, and the String constructors seemed to be, well, utterly useless. When do you really ever need to do &quot;new String(oldString)&quot;? Come on, IntelliJ IDEA even flags all occurrences of this as &quot;redundant&quot;!&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;It turns out that this constructor can actually be useful in at least one circumstance. If you&#39;ve ever peeked at the String source code, you&#39;ll have seen that it doesn&#39;t just have fields for the char array value and the count of characters, but also for the offset to the beginning of the String. This is so that Strings can share the char array value with other Strings, usually results from calling one of the substring() methods. Java was famously chastised for this in &lt;a href=&quot;http://www.jwz.org/doc/java.html&quot;&gt;jwz&#39;  Java rant&lt;/a&gt; from years back:&lt;/div&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-style: italic;&quot;&gt;The only reason for this overhead is so that String.substring() can return strings which share the same value array. Doing this at the cost of adding 8 bytes to each and every String object is not a net savings...&lt;/span&gt;&lt;/blockquote&gt;Byte savings aside, if you have some code like this:&lt;div&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;courier new&#39;;&quot;&gt;// imagine a multi-megabyte string here&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;courier new&#39;;&quot;&gt;String s = &quot;0123456789012345678901234567890123456789&quot;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;courier new&#39;;&quot;&gt;String s2 = s.substring(0, 1);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;courier new&#39;;&quot;&gt;s = null;&lt;/span&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;You&#39;ll now have a String s2 which, although it seems to be a one-character string, holds a reference to the gigantic char array created in the String s. This means the array won&#39;t be garbage collected, even though we&#39;ve explicitly nulled out the String s!&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The fix for this is to use our previously mentioned &quot;useless&quot; String constructor like this:&lt;/div&gt;&lt;div&gt;&lt;blockquote&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;courier new&#39;;&quot;&gt;String s2 = new String(s.substring(0, 1));&lt;/span&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;div&gt;It&#39;s not well-known that this constructor actually copies that old contents to a new array if the old array is larger than the count of characters in the string. This means the old String contents will be garbage collected as intended. Happy happy joy joy.&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Sometimes, seemingly useless constructs reveal hidden gems of usefulness. Be sure to check out the source for String to find how this works!&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kjetilod.blogspot.com/feeds/105226444715738892/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7256888056988953356/105226444715738892' title='9 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7256888056988953356/posts/default/105226444715738892'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7256888056988953356/posts/default/105226444715738892'/><link rel='alternate' type='text/html' href='http://kjetilod.blogspot.com/2008/09/string-constructor-considered-useless.html' title='String constructor considered useless turns out to be useful after all (film at 11)'/><author><name>Kjetil</name><uri>http://www.blogger.com/profile/08256707219769938203</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://lh5.google.co.uk/kjetil.odegaard/RxOsNDblsbI/AAAAAAAAADw/l4iQqDP8bE8/s400/kjetilod.gif'/></author><thr:total>9</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7256888056988953356.post-5918572134053380343</id><published>2008-08-22T01:43:00.001-07:00</published><updated>2008-08-22T01:47:24.222-07:00</updated><title type='text'>Multiline grep</title><content type='html'>I recently needed to do some multiline grepping through some log files. The problem is, the default grep and egrep on Linux systems don&#39;t seem to support regex patterns that extend over several lines.&lt;br /&gt;&lt;br /&gt;Luckily, at least RHEL come with pcregrep installed, which does Perl-compatible regex matching. And by adding a -M switch you get multiline matching!&lt;br /&gt;&lt;br /&gt;So you can just go&lt;br /&gt;&lt;blockquote style=&quot;font-family: courier new;&quot;&gt;pcregrep -M &#39;a\nb&#39; files...&lt;/blockquote&gt;&lt;blockquote&gt;&lt;/blockquote&gt;Easy peasy!</content><link rel='replies' type='application/atom+xml' href='http://kjetilod.blogspot.com/feeds/5918572134053380343/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7256888056988953356/5918572134053380343' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7256888056988953356/posts/default/5918572134053380343'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7256888056988953356/posts/default/5918572134053380343'/><link rel='alternate' type='text/html' href='http://kjetilod.blogspot.com/2008/08/multiline-grep.html' title='Multiline grep'/><author><name>Kjetil</name><uri>http://www.blogger.com/profile/08256707219769938203</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://lh5.google.co.uk/kjetil.odegaard/RxOsNDblsbI/AAAAAAAAADw/l4iQqDP8bE8/s400/kjetilod.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7256888056988953356.post-6339136060384338483</id><published>2008-05-15T02:05:00.000-07:00</published><updated>2008-05-15T02:08:07.586-07:00</updated><title type='text'>EBCDIC trick</title><content type='html'>You can use good old /bin/dd to convert EBCDIC files to their ASCII equivalent.&lt;br /&gt;&lt;br /&gt;Just do&lt;br /&gt;&lt;blockquote style=&quot;font-family: courier new;&quot;&gt;dd if=infile.txt of=outfile.txt conv=ascii&lt;/blockquote&gt;Which does the conversion automatically.</content><link rel='replies' type='application/atom+xml' href='http://kjetilod.blogspot.com/feeds/6339136060384338483/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7256888056988953356/6339136060384338483' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7256888056988953356/posts/default/6339136060384338483'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7256888056988953356/posts/default/6339136060384338483'/><link rel='alternate' type='text/html' href='http://kjetilod.blogspot.com/2008/05/ebcdic-trick.html' title='EBCDIC trick'/><author><name>Kjetil</name><uri>http://www.blogger.com/profile/08256707219769938203</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://lh5.google.co.uk/kjetil.odegaard/RxOsNDblsbI/AAAAAAAAADw/l4iQqDP8bE8/s400/kjetilod.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7256888056988953356.post-609106274886064698</id><published>2008-04-07T07:37:00.000-07:00</published><updated>2008-04-07T07:40:00.518-07:00</updated><title type='text'>Maven 2 help plugin</title><content type='html'>(I always forget this bit, so I&#39;m putting it here for posterity.)&lt;br /&gt;&lt;br /&gt;The help plugin for Maven 2 can print the possible goals and other info for a plugin:&lt;br /&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;&lt;/span&gt;&lt;blockquote&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;mvn help:describe -Dplugin=eclipse -Dmedium=true&lt;/span&gt;&lt;/blockquote&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;-Dfull=true&lt;/span&gt; gives some more detailed output.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;For more info see the &lt;a href=&quot;http://maven.apache.org/plugins/maven-help-plugin/index.html&quot;&gt;help plugin pages&lt;/a&gt;.</content><link rel='replies' type='application/atom+xml' href='http://kjetilod.blogspot.com/feeds/609106274886064698/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7256888056988953356/609106274886064698' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7256888056988953356/posts/default/609106274886064698'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7256888056988953356/posts/default/609106274886064698'/><link rel='alternate' type='text/html' href='http://kjetilod.blogspot.com/2008/04/i-always-forget-this-bit-so-im-putting.html' title='Maven 2 help plugin'/><author><name>Kjetil</name><uri>http://www.blogger.com/profile/08256707219769938203</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://lh5.google.co.uk/kjetil.odegaard/RxOsNDblsbI/AAAAAAAAADw/l4iQqDP8bE8/s400/kjetilod.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7256888056988953356.post-2014778675769330878</id><published>2007-10-18T13:49:00.000-07:00</published><updated>2007-10-18T14:01:45.192-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="java"/><title type='text'></title><content type='html'>&lt;h1&gt;   On clean code and refactoring&lt;br /&gt;&lt;/h1&gt; Bob Martin (also known as &quot;Uncle Bob&quot;) visited us at BEKK today and gave us a short pep talk on &quot;clean code&quot;. Using his argument parser written in Ruby as an example, he showed some refactoring tricks and some nice Ruby idioms (passing blocks as arguments, etc.). His main point was that you should never check in bad code and leave the fixing for later, cause &quot;later&quot; never comes. If you make a mess, you should clean it up, and clean it up now.&lt;br /&gt;&lt;br /&gt;I&#39;ve thought along these lines before, and one of the issues I&#39;ve wondered about is: Should you refactor just after you write the code or should you leave it until the next time you need to change it? This is really just another way of asking &quot;How do you know where your refactoring should end up?&quot;&lt;br /&gt;&lt;br /&gt;On one hand, I agree that you should clean up after yourself if you&#39;ve duplicated something or in some other way made the code worse than it was. But on the other hand, you don&#39;t know &lt;i&gt;now&lt;/i&gt; what the best structure is since you don&#39;t know what changes you want to make next time. You&#39;ll have to guess in what form you&#39;ll need the code to be the next time you change it. This might lead you to a &quot;local optimum&quot; of code quality, but when you revisit the code you might need to take in a totally different direction, forcing you to abandon the local optimum for a solution that is better in the big picture.&lt;br /&gt;&lt;br /&gt;If you leave the code in its current (messy) state and wait until the next time you have to change it, it could be a lot easier to see in which direction you should go. With concrete requirements for how you want to change the code, you can probably see that &quot;hey, this would be a lot easier to change if the code was structured this way...&quot;. You would then have to make the necessary refactorings, before making any changes.&lt;br /&gt;&lt;br /&gt;Of course, there&#39;s always the chance that you&#39;ll be in a hurry the next time, and so you won&#39;t really have time for refactoring. Your changes will make the design worse, and all of a sudden you have a big ball of mud. Also, working this way feels a bit like always working uphill. For every change you want to make, you have to refactor something first. It&#39;s a bit like having to clean up the kitchen, when you really just want to make dinner.&lt;br /&gt;&lt;br /&gt;Either way, I guess I prefer cleaning up after I&#39;ve written some (messy) code to leaving it for later. You can probably make educated guesses in most cases as to where you should take the design. But, just as you should be ready to throw away some messy code, I think you should be prepared to back out some refactorings if they conflict with the way you feel the code should be going.&lt;br /&gt;&lt;br /&gt;Anyway, just some food for thought.</content><link rel='replies' type='application/atom+xml' href='http://kjetilod.blogspot.com/feeds/2014778675769330878/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7256888056988953356/2014778675769330878' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7256888056988953356/posts/default/2014778675769330878'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7256888056988953356/posts/default/2014778675769330878'/><link rel='alternate' type='text/html' href='http://kjetilod.blogspot.com/2007/10/on-clean-code-and-refactoring-bob.html' title=''/><author><name>Kjetil</name><uri>http://www.blogger.com/profile/08256707219769938203</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://lh5.google.co.uk/kjetil.odegaard/RxOsNDblsbI/AAAAAAAAADw/l4iQqDP8bE8/s400/kjetilod.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7256888056988953356.post-1898715519074972629</id><published>2007-10-04T13:41:00.000-07:00</published><updated>2007-10-04T13:44:08.732-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="java"/><title type='text'></title><content type='html'>  &lt;h1&gt;Spring dynamic proxy problem&lt;/h1&gt;I encountered a strange problem at work today: The following test code failed:&lt;br&gt;&lt;br&gt;&lt;div style=&quot;margin-left: 40px;&quot;&gt;&lt;span style=&quot;font-family: Courier New;&quot;&gt;ServiceImpl service = applicationContext.getBean(&quot;serviceImpl&quot;);&lt;/span&gt;&lt;br&gt;&lt;/div&gt;&lt;br&gt;The application context looks like this:&lt;br&gt;&lt;br&gt;&lt;div style=&quot;text-align: justify; margin-left: 40px;&quot;&gt;&lt;span style=&quot;font-family: Courier New;&quot;&gt;&amp;lt;beans&amp;gt;&lt;/span&gt;&lt;br style=&quot;font-family: Courier New;&quot;&gt;&lt;span style=&quot;font-family: Courier New;&quot;&gt;&amp;lt;bean id=&quot;serviceImpl&quot; class=&quot;ServiceImpl&quot;/&amp;gt;&lt;/span&gt;&lt;br style=&quot;font-family: Courier New;&quot;&gt;&lt;span style=&quot;font-family: Courier New;&quot;&gt;&amp;lt;/beans&amp;gt;&lt;/span&gt;&lt;br&gt;&lt;/div&gt;&lt;br&gt;&lt;span style=&quot;font-family: Courier New;&quot;&gt;ServiceImpl&lt;/span&gt; implements the &lt;span style=&quot;font-family: Courier New;&quot;&gt;Service&lt;/span&gt; interface.&lt;br&gt;&lt;br&gt;Note that the reference type in the test code is &lt;span style=&quot;font-family: Courier New;&quot;&gt;ServiceImpl&lt;/span&gt;. I sometimes do this when I need to test drive methods that are not in the implemented interface.&lt;br&gt;&lt;br&gt;The error was a ClassCastException, which made no sense. Looking at the error, it said that it was unable to cast Proxy-yadayada to &lt;span style=&quot;font-family: Courier New;&quot;&gt;ServiceImpl&lt;/span&gt;.&lt;br&gt;&lt;br&gt;It turns out that someone added some AOP stuff to the service classes. Spring then proxies the service implementation in one of two ways: if the class doesn&#39;t implement an interface it uses cglib to create a proxy.&lt;br&gt;&lt;br&gt;But if the class does implement an interface Spring will interject a dynamic proxy which implements that interface between the original interface and implementation, and the above code will fail.&lt;br&gt;&lt;br&gt;So what&#39;s the solution? The only immediate solution I see is to instantiate the service implementation yourself if you need to test drive methods that are not in the interface. Hardly ideal, but easy enough.&lt;br&gt;&lt;br&gt;  </content><link rel='replies' type='application/atom+xml' href='http://kjetilod.blogspot.com/feeds/1898715519074972629/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7256888056988953356/1898715519074972629' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7256888056988953356/posts/default/1898715519074972629'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7256888056988953356/posts/default/1898715519074972629'/><link rel='alternate' type='text/html' href='http://kjetilod.blogspot.com/2007/10/spring-dynamic-proxy-problem-i.html' title=''/><author><name>Kjetil</name><uri>http://www.blogger.com/profile/08256707219769938203</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://lh5.google.co.uk/kjetil.odegaard/RxOsNDblsbI/AAAAAAAAADw/l4iQqDP8bE8/s400/kjetilod.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7256888056988953356.post-3974732817818712248</id><published>2007-09-18T12:52:00.000-07:00</published><updated>2007-10-03T08:51:05.397-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="java"/><title type='text'></title><content type='html'>    &lt;h1&gt;Is the DAO pattern still valuable in the time of ORM?&lt;/h1&gt;The &lt;a title=&quot;DAO discussion&quot; href=&quot;http://www.infoq.com/news/2007/09/jpa-dao&quot; id=&quot;n8q0&quot;&gt;DAO discussion&lt;/a&gt; is surfacing again (&lt;a title=&quot;previous take&quot; href=&quot;http://www.theserverside.com/news/thread.tss?thread_id=40581&quot; id=&quot;f84n&quot;&gt;previously&lt;/a&gt;), and there&#39;s one point I think is lacking from the current discussion: Testing.&lt;br&gt;&lt;br&gt;It&#39;s a lot easier to mock or stub out PersonDao.getPersonByFirstName() method than EntityManager.createNamedQuery() blah blah blah. &lt;a title=&quot;Don&#39;t mock infrastructure&quot; href=&quot;http://www.redhillconsulting.com.au/blogs/simon/archives/000113.html&quot; id=&quot;fbxj&quot;&gt;Don&#39;t mock infrastructure&lt;/a&gt;. Avoiding the database access is crucial to making your tests run as fast as possible.&lt;br&gt;&lt;br&gt;The DAO tests themselves should access the database, of course, as well as the end-to-end functional tests. But running every test in the system against the database is simply uneconomical.&lt;br&gt;&lt;br&gt;&lt;br&gt;</content><link rel='replies' type='application/atom+xml' href='http://kjetilod.blogspot.com/feeds/3974732817818712248/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7256888056988953356/3974732817818712248' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7256888056988953356/posts/default/3974732817818712248'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7256888056988953356/posts/default/3974732817818712248'/><link rel='alternate' type='text/html' href='http://kjetilod.blogspot.com/2007/09/is-dao-pattern-still-valuable-in-time.html' title=''/><author><name>Kjetil</name><uri>http://www.blogger.com/profile/08256707219769938203</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://lh5.google.co.uk/kjetil.odegaard/RxOsNDblsbI/AAAAAAAAADw/l4iQqDP8bE8/s400/kjetilod.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7256888056988953356.post-8351080618479639541</id><published>2007-09-14T13:35:00.000-07:00</published><updated>2007-10-03T08:51:05.397-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="java"/><title type='text'></title><content type='html'>    &lt;h1&gt;JavaZone 2007: The end&lt;/h1&gt; &lt;p&gt;That&#39;s it, the conference is over. We can all go home, get some rest and wait for next year (which will probably be &lt;b&gt;even&lt;/b&gt; bigger).&lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt;Totto, the javaBin&#39;s president, noted in his foreword to the JavaZone program that his inspiration came when he attended JavaOne back in 1996. It&#39;s really quite amazing how far we&#39;ve come since then. One can only wonder where we&#39;ll be in a couple of years more.&lt;br&gt;&lt;/p&gt;&lt;br&gt;If you arrived here from a another summary of my JavaZone posts, that summary was adopted from the previous blog posts. The blog posts are a bit unpolished (I wrote them live), but may contain a bit more information than the summary, so if you&#39;re can look there for details.&lt;br&gt;&lt;br&gt;After a short holiday, I promise regular programming will resume...&lt;br&gt;</content><link rel='replies' type='application/atom+xml' href='http://kjetilod.blogspot.com/feeds/8351080618479639541/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7256888056988953356/8351080618479639541' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7256888056988953356/posts/default/8351080618479639541'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7256888056988953356/posts/default/8351080618479639541'/><link rel='alternate' type='text/html' href='http://kjetilod.blogspot.com/2007/09/javazone-2007-end-thats-it-conference.html' title=''/><author><name>Kjetil</name><uri>http://www.blogger.com/profile/08256707219769938203</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://lh5.google.co.uk/kjetil.odegaard/RxOsNDblsbI/AAAAAAAAADw/l4iQqDP8bE8/s400/kjetilod.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7256888056988953356.post-2522707902846036248</id><published>2007-09-13T09:01:00.000-07:00</published><updated>2007-10-03T08:55:33.322-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="java"/><title type='text'></title><content type='html'>&lt;h1&gt;JavaZone 2007: How to build enterprise applications with Java SE&lt;/h1&gt; &lt;blockquote dir=&quot;ltr&quot; style=&quot;margin-right: 0px;&quot;&gt; &lt;p&gt;&lt;i&gt;&quot;The original title of this talk was &#39;How to make sysadmins love you&#39;&quot;&lt;/i&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;Trygve Laugstøl from Arktekk, a noted open source contributor and a self-described UNIX lover, talked about considering Java SE instead of EE for building applications.&lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt;The motivating thought was to make it easy to admin the solutions we make. By embedding services and making the app runnable from a script, it&#39;s a lot easier for operations to admin; they don&#39;t have to manage an app server.&lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt;This is not a criticism of Java EE, but to make the case for Java SE as an alternative. Java EE 5 is 23 different specs, you have to be a rocket scientist to know it all. Takes a long time to deploy to app server. Dev and production environments are different.&lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt;Much faster development cycle. No app server. Test only the bits you need.&lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt;Have a main class which starts the entire application, with getters/setters for command arguments (port, location of conf file, etc.). You can now start your entire application from a unit test. Use commons-cli for command-line argument parsing.&lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt;Trygve thinks using VMWare for local developing is a waste, but thinks you should still try to develop the app on the same platform it will be deployed on.&lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt;A lot of the new and useful technologies in JEE are now in JSE (JPA, JMX, Stax). XFire, Axis, ActiveMQ, Jetty, JNDI work great in JSE. You should embed the features you need. Think UNIX: small, specialized components. You can still include a servlet engine, but this time you control it, it doesn&#39;t control you.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;    &lt;span style=&quot;font-style: italic;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;Today: Java is the Cobol of the 90&#39;s&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;font-style: italic;&quot;&gt;    I&#39;m hoping for: Java is the UNIX for the 90&#39;s&lt;/p&gt;&lt;/blockquote&gt;&lt;p style=&quot;font-style: italic;&quot;&gt;&lt;/p&gt;  &lt;p&gt;Use conventions for file system layout (like in UNIX). Package the app like a standard UNIX app (tarball).&lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt;Trygve also recommends to use the appassembler plugin to assemble the app and generating startup scripts (fixes classpath, etc.). Use a separate maven profile for assembly to reduce build time.&lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt;Make separate loggers for significant events which operations can use for debugging (connection pool empty, etc.) and pipe them to syslog (UNIX) or the Event log (Windows).&lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt;Solaris has Service management facility (SMF) which can integrate nicely with this approach. On Linux, you can create an /etc/init.d script.&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;Update: Apparently I misquoted Trygve his Java-as-UNIX analogy. Fixed now :-)&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt; &lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://kjetilod.blogspot.com/feeds/2522707902846036248/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7256888056988953356/2522707902846036248' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7256888056988953356/posts/default/2522707902846036248'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7256888056988953356/posts/default/2522707902846036248'/><link rel='alternate' type='text/html' href='http://kjetilod.blogspot.com/2007/09/javazone-2007-how-to-build-enterprise.html' title=''/><author><name>Kjetil</name><uri>http://www.blogger.com/profile/08256707219769938203</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://lh5.google.co.uk/kjetil.odegaard/RxOsNDblsbI/AAAAAAAAADw/l4iQqDP8bE8/s400/kjetilod.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7256888056988953356.post-6329773355512088601</id><published>2007-09-13T05:57:00.000-07:00</published><updated>2007-10-03T08:51:05.398-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="java"/><title type='text'></title><content type='html'>&lt;H1&gt;JavaZone 2007: Experiences on using Spring WebFlow with JSF&lt;/H1&gt; &lt;P&gt;Holger Zobel from Accenture, who is leading the architecture group for the Norwegian Pension project, gave us a taste of the experiences from that project with integrating WebFlow and JSF.&lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;Spring WebFlow is a very general framework, which can be used with a number of presentation frameworks (including Swing). Flows define a user dialogue.&lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;The project has 40-50 developers and uses an IBM software stack and Myfaces JSF.&lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;SWF 1.0 had buggy JSF support. Difficult to debug errors in flow XML.&lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;SWF is more powerful than JSF flow, but power can be misused. Should be used only for flows. Free navigation is still difficult.&lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;SpringIDE helps development a lot. Be sure to have good exception handling in your code.&lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;Is it worth using SWF? In the beginning, it created more trouble than it was worth. Will probably use it for the next project, since he now knows how to use it. Can be used for small parts of an app, or introduced incrementally. SWF is not invasive.&lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;The problems they faced were mostly from the JSF integration.&lt;/P&gt;</content><link rel='replies' type='application/atom+xml' href='http://kjetilod.blogspot.com/feeds/6329773355512088601/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7256888056988953356/6329773355512088601' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7256888056988953356/posts/default/6329773355512088601'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7256888056988953356/posts/default/6329773355512088601'/><link rel='alternate' type='text/html' href='http://kjetilod.blogspot.com/2007/09/javazone-2007-experiences-on-using.html' title=''/><author><name>Kjetil</name><uri>http://www.blogger.com/profile/08256707219769938203</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://lh5.google.co.uk/kjetil.odegaard/RxOsNDblsbI/AAAAAAAAADw/l4iQqDP8bE8/s400/kjetilod.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7256888056988953356.post-8476755441108584154</id><published>2007-09-13T05:01:00.000-07:00</published><updated>2007-10-03T08:51:05.398-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="java"/><title type='text'></title><content type='html'>&lt;H1&gt;JavaZone 2007: Getting the most out of GC&lt;/H1&gt; &lt;BLOCKQUOTE dir=ltr style=&quot;MARGIN-RIGHT: 0px&quot;&gt; &lt;P&gt;&lt;I&gt;&quot;GC is automatic memory management; if it was really automatic, we should all really be at the pub instead of sitting here, innit?&quot;&lt;/I&gt;&lt;/P&gt;(My crap rendition of Holly&#39;s actually funny joke)&lt;/BLOCKQUOTE&gt; &lt;P&gt;Holly Cummins from IBM at Hursley, UK (where they do CICS, MQ and some JVM things, I guess) gave some general info on GC and demoed EVTK (for which she is lead). I think this is the first time I&#39;ve seen an IBM-er with blue hair :-)&lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;Holly noted that GC can actually be faster for an app than manually using malloc/free. She quoted some numbers where C apps can spend up to 20% of their time in free. GC can also exploit cache locality better by rearranging objects, compaction, etc. Unfortunately, GC can also stuff the cache full of crap when it traverses the heap.&lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;Mean pause time is not a good indicator of performance. Small heaps mean smaller pauses, but can also mean worse performance. Smaller pauses doesn&#39;t necessarily mean better response time; if the app has a heavy workload the response time will be dominated by waiting for the CPU. &quot;Real time is not real fast.&quot;&lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;What can verbose GC tell you? New IBM diagnostic tools for the IBM JVM: available as plugins to the IBM Support Assistant. Extensible Verbose Toolkit: verbose GC analysis. Actually handles verbose output from Sun JVM also! Creates reports, graphs, etc. Install the Support Assistant and find EVTK as a plugin.&lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;Holly did a nice demo of EVTK showing how too small a heap can make an app spend too much of it&#39;s time running GC, throttling app throughput. And a second demo showing how to look for a memory leak. EVTK can show how many weak references are cleared, etc.&lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;Nice overview of the different GC policies, etc. at the end, I&#39;m too busy following it to make notes :-)&lt;/P&gt; &lt;P&gt; &lt;/P&gt;</content><link rel='replies' type='application/atom+xml' href='http://kjetilod.blogspot.com/feeds/8476755441108584154/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7256888056988953356/8476755441108584154' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7256888056988953356/posts/default/8476755441108584154'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7256888056988953356/posts/default/8476755441108584154'/><link rel='alternate' type='text/html' href='http://kjetilod.blogspot.com/2007/09/javazone-2007-getting-most-out-of-gc-gc.html' title=''/><author><name>Kjetil</name><uri>http://www.blogger.com/profile/08256707219769938203</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://lh5.google.co.uk/kjetil.odegaard/RxOsNDblsbI/AAAAAAAAADw/l4iQqDP8bE8/s400/kjetilod.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7256888056988953356.post-1818511168932593335</id><published>2007-09-13T03:40:00.000-07:00</published><updated>2007-09-13T03:42:03.243-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="java"/><title type='text'></title><content type='html'>&lt;H1&gt;JavaZone 2007: Deploying Maven in the Enterprise&lt;/H1&gt; &lt;P&gt;Kristoffer Moum from Arktekk gave us an entertaining overview of how to introduce Maven in a company.&lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;A benefit of Maven is a standardized project structure, which means employees don&#39;t have to learn different set-ups.&lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;Start with a company-wide Maven POM with repository references, deployment settings and dependency management.&lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;Set up internal repositories: snapshot, release and third-party repos with Apache WebDAV; set up a Maven proxy which becomes a &lt;i&gt;single entry point&lt;/i&gt; to both the internal and the external repos.&lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;Kristoffer uses the Maven Proxy from Codehaus: simple to configure, flexible. Other implementations offer GUI configuration, etc.&lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;All artifacts built by the CI server should be directly deployed to the internal repository (snapshots).&lt;/P&gt; &lt;H3&gt;Project experiences&lt;/H3&gt; &lt;P&gt;Transitive dependencies: poor third-party POMs add excessive dependencies. One solution is to graph the dependencies and manually exclude dependencies. For instance the maven dependency plugin with the &#39;tree&#39; goal.&lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;Implicit plugin versioning: version is not specified, so the latest and greatest is downloaded and used. This often turns out to be unstable, which may result in some strange behaviour. Solution: try to control plugin versions manually.&lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;Redeploying released artifacts: causes the new release only to be deployed for those who delete it manually. This can create a really strange situation where half of the developers can&#39;t build the project. Should be illegal.&lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;Transitive dependencies can give some problems when you get dependencies to different versions of the same artifact. Solution: add direct dependency.&lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;It&#39;s not a good idea to introduce all of Maven at once, it&#39;s better to introduce it incrementally.&lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;Can be tricky to find the right module granularity. Be pragmatic when dividing projects in modules; too few or too many are not good.&lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;Everything should be doable through the IDE. Going through Maven every time will be slow.&lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;Too many profiles can make the build hard to understand. Don&#39;t try to solve every problem with profiles.&lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;&lt;i&gt;Some good tips here. Maven seems to be used more and more in companies.&lt;/i&gt;&lt;/P&gt;</content><link rel='replies' type='application/atom+xml' href='http://kjetilod.blogspot.com/feeds/1818511168932593335/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7256888056988953356/1818511168932593335' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7256888056988953356/posts/default/1818511168932593335'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7256888056988953356/posts/default/1818511168932593335'/><link rel='alternate' type='text/html' href='http://kjetilod.blogspot.com/2007/09/javazone-2007-deploying-maven-in.html' title=''/><author><name>Kjetil</name><uri>http://www.blogger.com/profile/08256707219769938203</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://lh5.google.co.uk/kjetil.odegaard/RxOsNDblsbI/AAAAAAAAADw/l4iQqDP8bE8/s400/kjetilod.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7256888056988953356.post-9202408437946108631</id><published>2007-09-13T02:10:00.000-07:00</published><updated>2007-09-13T03:42:03.243-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="java"/><title type='text'></title><content type='html'>&lt;H1&gt;JavaZone 2007: Apache Tuscany&lt;/H1&gt; &lt;P&gt;After a good (heh) night&#39;s sleep (double heh), another day of sessions awaits. Guys, two mornings in a row of Norwegian Rammstein covers is just brutal :-)&lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;Simon Laws from IBM UK had a session on &lt;A id=wvyd title=&quot;Apache Tuscany&quot; href=&quot;http://incubator.apache.org/tuscany/&quot;&gt;Apache Tuscany&lt;/A&gt;, a SCA implementation.&lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;SCA is a model for distrubuted components implemented in any of a range of technologies (Java, BPEL, Ruby, etc.). Components can be integrated using web services, RMI, etc.&lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;An app is assembled with a XML descriptor. It looks really easy to change component distribution. SCA can easily integrate with existing systems and services.&lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;Tuscany also contains a SDO implementation for data binding.&lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;The Tuscany distribution contains a bunch of demos which is probably the best way to start if you want to learn more than this miserable write-up (sorry, Simon, I&#39;m really not doing your session justice).&lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;&lt;i&gt;SCA and SDO have been mostly acronyms to me till now. This session gave a nice, high-level view and rationale, as well as some nice Tuscany demos.&lt;/i&gt;&lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;&lt;i&gt;&lt;A id=pm5i title=&quot;Tuscany blog&quot; href=&quot;http://apache-tuscany.blogspot.com/&quot;&gt;Tuscany blog&lt;/A&gt; &lt;/i&gt;&lt;/P&gt;</content><link rel='replies' type='application/atom+xml' href='http://kjetilod.blogspot.com/feeds/9202408437946108631/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7256888056988953356/9202408437946108631' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7256888056988953356/posts/default/9202408437946108631'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7256888056988953356/posts/default/9202408437946108631'/><link rel='alternate' type='text/html' href='http://kjetilod.blogspot.com/2007/09/javazone-2007-apache-tuscany-after-good.html' title=''/><author><name>Kjetil</name><uri>http://www.blogger.com/profile/08256707219769938203</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://lh5.google.co.uk/kjetil.odegaard/RxOsNDblsbI/AAAAAAAAADw/l4iQqDP8bE8/s400/kjetilod.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7256888056988953356.post-3210437614119568515</id><published>2007-09-12T10:12:00.000-07:00</published><updated>2007-09-12T10:14:13.234-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="java"/><title type='text'></title><content type='html'>&lt;H1&gt;JavaZone 2007: End of day one&lt;/H1&gt; &lt;P&gt;Day one nears the end, at least with respect to sessions.&lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;&quot;Blogging live&quot; about sessions is quite different from normal blogging in that there&#39;s more of a deadline: You have to finish one entry before the next sessions begins, or you&#39;ll be backlogged. This means some of the entries are more like notes than any deep thoughts. My mind is split on this issue, but I&#39;ll try to continue my experiment tomorrow since I think the average quality of today&#39;s entries is OK.&lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;Also, it might not always be perfectly clear what is said by the speaker and what is added by me. I&#39;ll make it simple for you and suggest you attribute any nonsense to me, and the rest to the speakers.&lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;The ClubZone starts soon, with four different bars open for the attendees. Here&#39;s to hoping it will be easy to get up tomorrow!&lt;/P&gt;</content><link rel='replies' type='application/atom+xml' href='http://kjetilod.blogspot.com/feeds/3210437614119568515/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7256888056988953356/3210437614119568515' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7256888056988953356/posts/default/3210437614119568515'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7256888056988953356/posts/default/3210437614119568515'/><link rel='alternate' type='text/html' href='http://kjetilod.blogspot.com/2007/09/javazone-2007-end-of-day-one-day-one.html' title=''/><author><name>Kjetil</name><uri>http://www.blogger.com/profile/08256707219769938203</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://lh5.google.co.uk/kjetil.odegaard/RxOsNDblsbI/AAAAAAAAADw/l4iQqDP8bE8/s400/kjetilod.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7256888056988953356.post-2777851119693131775</id><published>2007-09-12T10:03:00.000-07:00</published><updated>2007-09-12T10:14:13.234-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="java"/><title type='text'></title><content type='html'>&lt;H1&gt;JavaZone 2007: Style and Taste in Writing FIT Documents&lt;/H1&gt; &lt;P&gt;This session had Steve Freeman (of jMock fame) and Mike Hill tackle common problems with FIT. One of the most interesting sessions today, I think.&lt;/P&gt; &lt;H3&gt;Example-driven development&lt;/H3&gt; &lt;P&gt;Examples force people to be concrete. The next step is to automate testing your system based on these examples. FIT is one way to do this.&lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;The point of FIT is communicating with the customer. Other tools can be used, such as JUnit with a DSL which is easier for an analyst to understand. &lt;/P&gt; &lt;H3&gt;Communication trumps testing&lt;/H3&gt; &lt;P&gt;Copy-paste of a procedural FIT table can make it hard to understand what the difference is. Can be converted to declarative table where each row or column is its own example. It&#39;s harder to refactor FIT tests since there&#39;s no IDE support, this means you must be more disciplined.&lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;Having a mega-table with lots of input and output columns (&quot;Tangled tables&quot;) can be practical for professional testers, but doesn&#39;t communicate clearly. It can be broken up into different, smaller tables. Abstractions that developers come up with can feed back into the business language. Can also be easier to change smaller tables. As in XP, why is something a comment, instead of runnable code?&lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;Web tests in FIT: should hide implementation details such as field names, &quot;url&quot; lingo, etc. Use a domain language which makes sense for your business instead.&lt;/P&gt; &lt;H3&gt;FIT in practice&lt;/H3&gt; &lt;P&gt;When you work on a project, you become expert on that project. Experts have their own common language. Build a language within your team to encourage a common understanding.&lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;Make test failure easy to understand. The tests shouldn&#39;t just satisfy the business side, but the developer side as well.&lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;Apply all good code practices to the tests also: refactoring, etc.&lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;Collaboration problems can affect test quality negatively; if you&#39;re trying to avoid collaboration and skip refactoring because of it, you&#39;ve got a problem.&lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;Agile teams which adopt FIT documents as documentation can end up in a waterfall-like passing of FIT documents with no real dialog.&lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;If the analysts are not very keen on FIT, try to publish the test result and the documents so it&#39;s easy to access.&lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;Word documents vs. Fitnesse: Depends on the organization and the analyst users.&lt;/P&gt;</content><link rel='replies' type='application/atom+xml' href='http://kjetilod.blogspot.com/feeds/2777851119693131775/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7256888056988953356/2777851119693131775' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7256888056988953356/posts/default/2777851119693131775'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7256888056988953356/posts/default/2777851119693131775'/><link rel='alternate' type='text/html' href='http://kjetilod.blogspot.com/2007/09/javazone-2007-style-and-taste-in.html' title=''/><author><name>Kjetil</name><uri>http://www.blogger.com/profile/08256707219769938203</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://lh5.google.co.uk/kjetil.odegaard/RxOsNDblsbI/AAAAAAAAADw/l4iQqDP8bE8/s400/kjetilod.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7256888056988953356.post-5839887789374479648</id><published>2007-09-12T08:50:00.000-07:00</published><updated>2007-09-12T10:14:13.234-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="java"/><title type='text'></title><content type='html'>&lt;H1&gt;JavaZone 2007: Using Spring-OSGi in Swing applications&lt;/H1&gt; &lt;P&gt;Nils Hofseth Andersen (Capgemini Norway)&lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;The bundle is the main &quot;unit of modularity&quot; in OSGi. A bundle can register services, to be used by other bundles. A bundle is a jar with a special manifest inside. Bundles can have their own lifecycles. Isolation and visibility is achieved through classloaders. OSGi should be very interesting for the people who want to get rid of their app server, as well as thick client (or other standard Java) developers.&lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;&lt;A id=n49o title=Spring-OSGi href=&quot;http://www.springframework.org/osgi&quot;&gt;Spring-OSGi&lt;/A&gt; is a project started by Interface21 to help integration between OSGi and Spring. You get some special OSGi-tags for your Spring config.&lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;Why Swing? If you already have some Swing parts, you don&#39;t really want to combine it with SWT in an app (different look &#39;n&#39; feel, etc.)&lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;Case from Statoil&#39;s Java Enterprise Framework. Uses only Swing. Phases of introducing OSGi:&lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;Phase 1: Introduced modules at the code level. Each module has it&#39;s own Spring config. Merging these contexts caused several problems (naming collisions, startup time, etc.).&lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;Phase 2: ModuleFactories introduced. Each module is a child appcontext of the app. App still has to know all modules.&lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;Phase 3: ModuleContribution introduced as the interface between the app and the module. Each module packaged as an OSGi bundle.&lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;Planning to open source the JEF framework when it&#39;s possible.&lt;/P&gt; &lt;P&gt; &lt;/P&gt;</content><link rel='replies' type='application/atom+xml' href='http://kjetilod.blogspot.com/feeds/5839887789374479648/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7256888056988953356/5839887789374479648' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7256888056988953356/posts/default/5839887789374479648'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7256888056988953356/posts/default/5839887789374479648'/><link rel='alternate' type='text/html' href='http://kjetilod.blogspot.com/2007/09/javazone-2007-using-spring-osgi-in.html' title=''/><author><name>Kjetil</name><uri>http://www.blogger.com/profile/08256707219769938203</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://lh5.google.co.uk/kjetil.odegaard/RxOsNDblsbI/AAAAAAAAADw/l4iQqDP8bE8/s400/kjetilod.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7256888056988953356.post-7852905105754942684</id><published>2007-09-12T06:14:00.000-07:00</published><updated>2007-09-12T06:25:03.045-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="javazone"/><title type='text'></title><content type='html'>&lt;H1&gt;JavaZone 2007: Simplicity - Lessons learned from enterprise application development&lt;/H1&gt; &lt;P&gt;BEKK&#39;s own Trond Arve Wasskog has a session on doing things the simple way. He has been an architect together with Johannes Brodwall on BBS&#39; NICS project. NICS is a system for moving sums of money between banks.&lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;Simplicity is not easy to define, but there are some ground rules: Fewer are better than many, etc.&lt;/P&gt; &lt;H3&gt;Infrastructure&lt;/H3&gt; &lt;P&gt;The project used two-phase commit to synchronize a database and a message queue. They needed load balancing and redundancy. The special setup only worked in special server environments, not on the developer machines.&lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;They solved this by dropping JMS and using the database for messages. This required some glue code for sending and receiving messages, but meant they could drop 2PC. It also meant it was now testable on developer machines. As Johannes noted in his talk, they eventually decided to drop WebSphere itself.&lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;Trond Arve thinks the app server itself is a dated concept, and would prefer to mix-and-match features. He now uses Jetty, Hibernate and Spring in his projects.&lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;Process engines are evil! They never work: You need a lot of new knowledge to develop, deploy, support them. In their engine they would need VB-like scripting on misc steps in the process flow. By removing it, they saved a whole lot of complexity.&lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;Deployment: why is it so hard? As Johannes noted, their new application model makes deployment a breeze.&lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;Operations: work early on with IT operations staff.&lt;/P&gt; &lt;H3&gt;Design&lt;/H3&gt; &lt;P&gt;They designed their own scheduling system using DDD, which turned out only 1 of 5 projects could use successfully. In the end, they opted for a much simpler solution: An existing scheduler which uses JMX on the application. Easier to test since you no longer have to rely on an EJB timer.&lt;/P&gt; &lt;H3&gt;Documentation&lt;/H3&gt; &lt;P&gt;Process vs. product. Documentation in itself has no value, the communication is the value.&lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;Architecture documents tend to only be shared between architects. Trond Arve used an approach where he intentionally didn&#39;t update his architecture documents, but when people asked if they were updated he&#39;d rather take a personal discussion: &quot;What are you trying to achieve?&quot; &lt;/P&gt; &lt;H3&gt;Functional testing&lt;/H3&gt; &lt;P&gt;User stories should generate functional tests, not unit tests. The spec should mirror the tests. Tools to use: FIT, RSpec, etc. Should be human readable (unlike JUnit :) ).&lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;Instead of a Windows-based automatic test application, they used Fitnesse, which more people knew. It was easier to automate.&lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;Closer integration between testers and developers. No artificial separation.&lt;/P&gt; &lt;H3&gt;Technical tests&lt;/H3&gt; &lt;P&gt;JUnit test from Hell: A 700-line test case, impossible to understand. When the process engine was removed, the test shrank to a fraction.&lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;No code means no maintenance cost and no bugs.&lt;/P&gt; &lt;H3&gt;Development environment&lt;/H3&gt; &lt;P&gt;Use a pre-packaged Eclipse version with a number of plugins, etc.&lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;Use VMWare to duplicate complicated environments.&lt;/P&gt; &lt;H3&gt;Configuration management&lt;/H3&gt; &lt;P&gt;Johannes described the simple application model they now use. It makes it really easy both to deploy and to roll back.&lt;/P&gt;</content><link rel='replies' type='application/atom+xml' href='http://kjetilod.blogspot.com/feeds/7852905105754942684/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7256888056988953356/7852905105754942684' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7256888056988953356/posts/default/7852905105754942684'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7256888056988953356/posts/default/7852905105754942684'/><link rel='alternate' type='text/html' href='http://kjetilod.blogspot.com/2007/09/javazone-2007-simplicity-lessons.html' title=''/><author><name>Kjetil</name><uri>http://www.blogger.com/profile/08256707219769938203</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://lh5.google.co.uk/kjetil.odegaard/RxOsNDblsbI/AAAAAAAAADw/l4iQqDP8bE8/s400/kjetilod.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7256888056988953356.post-2232603719241869781</id><published>2007-09-12T04:50:00.000-07:00</published><updated>2007-09-12T06:25:03.046-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="javazone"/><title type='text'></title><content type='html'>&lt;H1&gt;JavaZone 2007: Real-time web&lt;/H1&gt; &lt;P&gt;Jonas Jacobi, a Swede with background from Oracle, has a new company called Kaazing which focuses on real-time solutions for the web.&lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;&lt;A id=bccc title=Comet href=&quot;http://en.wikipedia.org/wiki/Comet_%28programming%29&quot;&gt;Comet&lt;/A&gt; is &lt;I&gt;a software concept that enables web servers to send data to the client program (normally a web browser) without having any need for the client to request it&lt;/I&gt; (quoting Wikipedia).&lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;Polling vs streaming: Polling means more control for the client, but also a lot of load on the server. Streaming (long-timed requests)&lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;Traditional AJAX apps means polling. The server has no way to notify the client if the client doesn&#39;t poll. &lt;/P&gt; &lt;P&gt;Jonas compared polling to a child asking &quot;Are we there yet?&quot; a gazillion times :)&lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;Firewalls mean client-server breaks. AJAX and Comet works.&lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;Comet means instant response. That&#39;s why traders normally use desktop solutions.&lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;Most browsers (including IE and Firefox) will only open two connections to a server, which is a challenge for Comet. This means we need common request handling.&lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;Both Jetty and Glassfish support the Bayeux protocol. Tomcat 6 will support Comet.&lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;They are trying to get support for Comet in the servlet 3.0 spec. Comet is not currently a standard.&lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;Jonas, with Enterprise Comet, considered translating Java source to JavaScript for the client, like in Google Web Toolkit, but there were upgrade issues, etc. They started Project Chai, a VM which dynamically translates Java class files to JavaScript on the fly, which means there are no static JavaScript files. The generated JS is then sent to the client.&lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;Jonas showed a nice online poker demo in Firefox with Comet on the server.&lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;The main benefit of Comet is the ability to scale (unlike traditional approaches to &lt;I&gt;push&lt;/I&gt;).&lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;They are considering open source (discussing with Terracotta and their experiences), but they have to please their investors. They don&#39;t necessarily want to make money on the Project Chai engine, but whatever they could build on top.&lt;/P&gt;</content><link rel='replies' type='application/atom+xml' href='http://kjetilod.blogspot.com/feeds/2232603719241869781/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7256888056988953356/2232603719241869781' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7256888056988953356/posts/default/2232603719241869781'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7256888056988953356/posts/default/2232603719241869781'/><link rel='alternate' type='text/html' href='http://kjetilod.blogspot.com/2007/09/javazone-2007-real-time-web-jonas.html' title=''/><author><name>Kjetil</name><uri>http://www.blogger.com/profile/08256707219769938203</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://lh5.google.co.uk/kjetil.odegaard/RxOsNDblsbI/AAAAAAAAADw/l4iQqDP8bE8/s400/kjetilod.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7256888056988953356.post-6793932384791109123</id><published>2007-09-12T03:52:00.000-07:00</published><updated>2007-09-12T06:25:03.046-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="javazone"/><title type='text'></title><content type='html'>&lt;H1&gt;JavaZone 2007: The Sun JVM inside and out&lt;/H1&gt; &lt;P&gt;Simon Ritter (Sun) took us through the myriad of options that can be used to change the behaviour of the JVM. From 140-something XX options in Java 1.4 to 532 for the newest Dolphin.&lt;/P&gt; &lt;H3&gt;GC &lt;/H3&gt; &lt;P&gt;useTLAB: thread local &lt;/P&gt; &lt;P&gt;TLABSize: size of thread local allocation blocks&lt;/P&gt; &lt;P&gt;UseParNewGC: parallel copy collector&lt;/P&gt; &lt;P&gt;Parallel compacting collector&lt;/P&gt; &lt;P&gt;Incremental CMS&lt;/P&gt; &lt;P&gt;UseParallelGC: parallel scavenge&lt;/P&gt; &lt;H3&gt;Ergonomics&lt;/H3&gt; &lt;P&gt;According to Simon, the heuristic the JVM uses include checking for 2 or more GBs of memory, 2 or more processors and whether or not the machine is running Windows :)&lt;/P&gt; &lt;H3&gt;Thread priority policy&lt;/H3&gt; &lt;P&gt;Increasing threading options for Java can, as Simon says, be &quot;very, very good or very, very bad&quot;. Depending on the other workload on the machine.&lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;My vote for best named option: DontYieldALot. Which on Linux means DontYieldAtAll. &lt;/P&gt; &lt;H3&gt;Biased locking&lt;/H3&gt; &lt;P&gt;UseBiasedLocking: &quot;lazy&quot; lock/unlock for uncontended locks.&lt;/P&gt; &lt;H3&gt;Tiered compilation&lt;/H3&gt; &lt;P&gt;TieredCompilation: switching between the client and server JIT compiler. I recommend Alex Millers &lt;A id=mqot title=&quot;Java 7 page&quot; href=&quot;http://tech.puredanger.com/java7#tiered&quot;&gt;Java 7 page&lt;/A&gt; for details.&lt;/P&gt; &lt;H3&gt;Random things&lt;/H3&gt; &lt;P&gt;Consider disabling explicit GC: Even though the Java docs says that calling System.gc() will cause a GC to happen some time in the future, in Sun Java it will actually run a GC every time. Who knew!&lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;AggressiveOpt: More aggressive optimizations, may change between versions.&lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;Use486InstrOnly: Use only old instructions&lt;/P&gt; &lt;H3&gt;DTrace&lt;/H3&gt; &lt;P&gt;DTrace which &quot;injects instructions into your kernel, which is pretty scary.&quot;&lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;Lots of Java probes available. &lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;Proposal for new Java SE 7 functionality: possible to enter your own DTrace probes, which you can then turn on when you need them.&lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;&lt;I&gt;I&#39;m sure I missed over half of the interesting options Simon mentioned, was a bit busy with other stuff. It was an interesting sessions since I&#39;ve heard of some of these options, but had no idea there were so many. Nice explanations as well.&lt;/I&gt;&lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;&lt;I&gt;&lt;A id=oqoi title=&quot;Simon Ritter&#39;s weblog&quot; href=&quot;http://blogs.sun.com/simonri/&quot;&gt;Simon Ritter&#39;s weblog&lt;/A&gt; &lt;/I&gt;&lt;/P&gt;</content><link rel='replies' type='application/atom+xml' href='http://kjetilod.blogspot.com/feeds/6793932384791109123/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7256888056988953356/6793932384791109123' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7256888056988953356/posts/default/6793932384791109123'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7256888056988953356/posts/default/6793932384791109123'/><link rel='alternate' type='text/html' href='http://kjetilod.blogspot.com/2007/09/javazone-2007-sun-jvm-inside-and-out.html' title=''/><author><name>Kjetil</name><uri>http://www.blogger.com/profile/08256707219769938203</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://lh5.google.co.uk/kjetil.odegaard/RxOsNDblsbI/AAAAAAAAADw/l4iQqDP8bE8/s400/kjetilod.gif'/></author><thr:total>0</thr:total></entry></feed>