<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>blog.leenarts.net</title>
	
	<link>http://blog.leenarts.net</link>
	<description>Weblog by Jeroen Leenarts. Dutch software developer. Java, Mac, OSX and other tidbits...</description>
	<lastBuildDate>Thu, 26 Aug 2010 10:20:17 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/blogleenartsnet" /><feedburner:info uri="blogleenartsnet" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><geo:lat>52.15</geo:lat><geo:long>6.1</geo:long><item>
		<title>Enabling HTTP request response logging on JBoss 4.2</title>
		<link>http://feedproxy.google.com/~r/blogleenartsnet/~3/-tDrGC1nUdA/</link>
		<comments>http://blog.leenarts.net/2010/08/26/http-request-response-logging-jboss-4-2/#comments</comments>
		<pubDate>Thu, 26 Aug 2010 09:47:17 +0000</pubDate>
		<dc:creator>Jeroen</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://blog.leenarts.net/?p=439</guid>
		<description><![CDATA[Today I had a bit of a fiddle with JBoss 4.2 due to IE7/IE8 compatibility differences. When opening or downloading a file in IE7 over an SSL connection (HTTPS), IE7 requires a bit of HTTP header-fu to allow you to actually perform that action. It&#8217;s simple really. Just add &#8220;Pragma: public&#8221; and &#8220;Cache-Control: maxage=3600&#8243; to]]></description>
			<content:encoded><![CDATA[<p>Today I had a bit of a fiddle with JBoss 4.2 due to IE7/IE8 compatibility differences.</p>
<p>When opening or downloading a file in IE7 over an SSL connection (HTTPS), IE7 requires a bit of HTTP header-fu to allow you to actually perform that action.</p>
<p>It&#8217;s simple really. Just add &#8220;Pragma: public&#8221; and &#8220;Cache-Control: maxage=3600&#8243; to your HTTP headers and you&#8217;re good to go.</p>
<p>In Java code:</p>
<pre class="brush: java;">
response.setHeader(&quot;Pragma&quot;, &quot;public&quot;);
response.setHeader(&quot;Cache-Control&quot;, &quot;maxage=3600&quot;);
</pre>
<p>To check if it&#8217;s working was a different matter. How to check the HTTP header content when things get sent over an HTTPS connection&#8230; FireBug doesn&#8217;t work, and so doesn&#8217;t any other developer tooling in any browser. Tracing the network traffic is pretty useless too, it&#8217;s encrypted. Last option, trace it on the server. Simply enabling network tracing on the Java VM didn&#8217;t work. For some reason JBoss doesn&#8217;t pick up this Java VM setting, probably because they are using a NIO based stack or something. I really don&#8217;t know.</p>
<p>JBoss does use Catalina for it&#8217;s HTTP/HTTPS/Web container handling. Catalina is another name for Tomcat. Tomcat has this valve thing which allows you to plug into the processing pipe. Good thing there are standard Valve implementations available that do just what I needed.</p>
<p>Just drop the next snippet somewhere appropriate:</p>
<pre class="brush: xml;">
&lt;!-- Enable http request/response logging.--&gt;
&lt;Valve className=org.apache.catalina.valves.RequestDumperValve
           prefix=localhost_access_log. suffix=.log
           pattern=common directory=${jboss.server.home.dir}/log
           resolveHosts=false /&gt;
</pre>
<p>Appropriate in my case was in the file &#8220;[JBOSS-HOME]/server/default/deploy/jboss-web.deployer/server.xml&#8221;.</p>
<p>And lo and behold it logged:</p>
<pre class="brush: plain;">
11:46:44,262 INFO  [[localhost]]           authType=BASIC
11:46:44,262 INFO  [[localhost]]      contentLength=48189
11:46:44,262 INFO  [[localhost]]        contentType=application/pdf
11:46:44,262 INFO  [[localhost]]             header=Pragma=public
11:46:44,262 INFO  [[localhost]]             header=Cache-Control=maxage=3600
11:46:44,262 INFO  [[localhost]]             header=Expires=Thu, 01 Jan 1970 01:00:00 CET
11:46:44,262 INFO  [[localhost]]             header=X-Powered-By=Servlet 2.4; JBoss-4.2.3.GA (build: SVNTag=JBoss_4_2_3_GA date=200807181417)/JBossWeb-2.0
11:46:44,332 INFO  [[localhost]]             header=X-Powered-By=JSF/1.2
11:46:44,332 INFO  [[localhost]]             header=X-Powered-By=Servlet 2.4; JBoss-4.2.3.GA (build: SVNTag=JBoss_4_2_3_GA date=200807181417)/JBossWeb-2.0
11:46:44,332 INFO  [[localhost]]             header=X-Powered-By=JSF/1.2
11:46:44,332 INFO  [[localhost]]             header=Content-Type=application/pdf
11:46:44,332 INFO  [[localhost]]             header=Content-Length=48189
11:46:44,332 INFO  [[localhost]]             header=Date=Thu, 26 Aug 2010 09:46:44 GMT
11:46:44,332 INFO  [[localhost]]            message=null
11:46:44,332 INFO  [[localhost]]         remoteUser=admin
11:46:44,332 INFO  [[localhost]]             status=200
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.leenarts.net/2010/08/26/http-request-response-logging-jboss-4-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.leenarts.net/2010/08/26/http-request-response-logging-jboss-4-2/</feedburner:origLink></item>
		<item>
		<title>-XX:-DontCompileHugeMethods</title>
		<link>http://feedproxy.google.com/~r/blogleenartsnet/~3/UjSBXNzWLa0/</link>
		<comments>http://blog.leenarts.net/2010/05/26/dontcompilehugemethods/#comments</comments>
		<pubDate>Wed, 26 May 2010 22:03:28 +0000</pubDate>
		<dc:creator>Jeroen</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://blog.leenarts.net/?p=433</guid>
		<description><![CDATA[Read some stuff today about huge methods and the JVM&#8217;s JIT Compiler. The JIT proces detects hotspots in code. If a hotspot is detected (usually 1000 to 1500 hits depending on your platform and JVM version) the JIT process marks a method for compilation to machine instructions. After compilation, method invocations are generally crazy fast]]></description>
			<content:encoded><![CDATA[<p>Read some stuff today about huge methods and the JVM&#8217;s JIT Compiler.</p>
<p>The JIT proces detects hotspots in code. If a hotspot is detected (usually 1000 to 1500 hits depending on your platform and JVM version) the JIT process marks a method for compilation to machine instructions. After compilation, method invocations are generally crazy fast on a method since the JIT process had like a thousand times to see what generally happens during the execution of a method and can optimise accordingly. (So never ever use the Xcomp option on the JVM, it forces compilation from the start, but this is generally slower, because the compilation will not be optimized in any way.)</p>
<p>The thing is, when performing this operation of marking methods for compilation there&#8217;s a catch. An 8k byte code instructions catch to be exact. If a method in byte code contains more then 8000 byte code instructions it will never ever be marked for compilation, period. About 2500 lines of Java code should do the trick. But believe me, I&#8217;ve seen crazy fools create monsters methods of that magnitude.</p>
<p>It gets even better though. When looking for methods to mark for compilation, the JIT process uses a call graph when doing it&#8217;s magic work of granting methods the privilege of optimized compilation. And here comes the catch in that, if a big fat honking pile of 8k byte code is encountered in a method while walking the call graph, JIT says: &#8220;I aint touching that!&#8221;. Thus any method called from that pile of poop not reachable in any other way through the call graph, will never ever feel the warm love of JIT optimized compilation.</p>
<p>Now you could use the lovely &#8220;-XX:-DontCompileHugeMethods﻿&#8221; argument when invoking the JVM. But from what I&#8217;ve understand it&#8217;s a bad thing to do, because amongst others it forces the JVM to go digging through those 8k wonders of human creativity.</p>
<p>Other option is to just use your sane mind and round up and terminate the morons in your project creating these 8k monsters. It&#8217;s good practice anyway to keep your methods small and task focussed in any object oriented language.</p>
<p>The gist is, don&#8217;t use &#8220;-XX:-DontCompileHugeMethods﻿&#8221;. Go bananas during a code review whenever you find any method which is too big for comfort. Let&#8217;s just say that the <a href="http://checkstyle.sourceforge.net/config_sizes.html">default statement count suggested by checkstyle</a> is a good one. So any method or constructor above 30 statements in length should be cause for investigation during a code review.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.leenarts.net/2010/05/26/dontcompilehugemethods/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.leenarts.net/2010/05/26/dontcompilehugemethods/</feedburner:origLink></item>
		<item>
		<title>Installing MS Office for Mac frrresh</title>
		<link>http://feedproxy.google.com/~r/blogleenartsnet/~3/eJaGrjVPbEU/</link>
		<comments>http://blog.leenarts.net/2010/05/05/installing-ms-office-for-mac-frrresh/#comments</comments>
		<pubDate>Wed, 05 May 2010 07:13:41 +0000</pubDate>
		<dc:creator>Jeroen</dc:creator>
				<category><![CDATA[Random thoughts]]></category>

		<guid isPermaLink="false">http://blog.leenarts.net/?p=431</guid>
		<description><![CDATA[For some reason installing Office for Mac 2008 all in one go (installation, SP1 update and updates) led to a severely broken installation. Read somewhere on the internet that I should&#8217;ve rebooted my system after every installation. That&#8217;s 5 reboots for you, once after initial install, once after SP1 update, once after a point release,]]></description>
			<content:encoded><![CDATA[<p>For some reason installing Office for Mac 2008 all in one go (installation, SP1 update and updates) led to a severely broken installation.</p>
<p>Read somewhere on the internet that I should&#8217;ve rebooted my system after every installation. That&#8217;s 5 reboots for you, once after initial install, once after SP1 update, once after a point release, once after a second point release and once for an auto updater update. Jikes!</p>
<p>Rebooting like a mad mad did result in a working system though. Don&#8217;t know why. Tried it n two separate clean OSX installs and it went off without a glitch. Except for the insane amount of rebooting that is.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.leenarts.net/2010/05/05/installing-ms-office-for-mac-frrresh/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.leenarts.net/2010/05/05/installing-ms-office-for-mac-frrresh/</feedburner:origLink></item>
		<item>
		<title>Quick personal note… Selling my couch. :)</title>
		<link>http://feedproxy.google.com/~r/blogleenartsnet/~3/z2pzM5eDXyM/</link>
		<comments>http://blog.leenarts.net/2010/01/15/quick-personal-note-selling-my-couch/#comments</comments>
		<pubDate>Fri, 15 Jan 2010 11:48:24 +0000</pubDate>
		<dc:creator>Jeroen</dc:creator>
				<category><![CDATA[Random thoughts]]></category>

		<guid isPermaLink="false">http://blog.leenarts.net/2010/01/15/quick-personal-note-selling-my-couch/</guid>
		<description><![CDATA[More details on the dutch trading site Marktplaats. hoekbank-chaise-longue-rood Edit: It sold on january 29th.]]></description>
			<content:encoded><![CDATA[<p>More details on the dutch trading site Marktplaats.</p>
<p><a href="http://huis-inrichting.marktplaats.nl/banken-bankstellen/312530560-hoekbank-chaise-longue-rood.html">hoekbank-chaise-longue-rood</a></p>
<p>Edit:<br />
It sold on january 29th. <img src='http://blog.leenarts.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.leenarts.net/2010/01/15/quick-personal-note-selling-my-couch/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.leenarts.net/2010/01/15/quick-personal-note-selling-my-couch/</feedburner:origLink></item>
		<item>
		<title>WordPress iPhone 2.0 still not usable</title>
		<link>http://feedproxy.google.com/~r/blogleenartsnet/~3/dtoT5PKLP_M/</link>
		<comments>http://blog.leenarts.net/2009/11/11/wordpress-iphone-2-0-still-not-usable/#comments</comments>
		<pubDate>Wed, 11 Nov 2009 10:51:57 +0000</pubDate>
		<dc:creator>Jeroen</dc:creator>
				<category><![CDATA[Random thoughts]]></category>

		<guid isPermaLink="false">http://blog.leenarts.net/2009/11/11/wordpress-iphone-2-0-still-not-usable/</guid>
		<description><![CDATA[I was planning on live blogging the J-Fall conference I am today. Well, after losing two complete posts due to crashes and problems in the WordPress app, I gave up.]]></description>
			<content:encoded><![CDATA[<p>I was planning on live blogging the J-Fall conference I am today.</p>
<p>Well, after losing two complete posts due to crashes and problems in the WordPress app, I gave up.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.leenarts.net/2009/11/11/wordpress-iphone-2-0-still-not-usable/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.leenarts.net/2009/11/11/wordpress-iphone-2-0-still-not-usable/</feedburner:origLink></item>
		<item>
		<title>Mac OSX Open Terminal Here Service</title>
		<link>http://feedproxy.google.com/~r/blogleenartsnet/~3/9rUt8ckOI3M/</link>
		<comments>http://blog.leenarts.net/2009/09/03/open-service-here/#comments</comments>
		<pubDate>Thu, 03 Sep 2009 22:00:02 +0000</pubDate>
		<dc:creator>Jeroen</dc:creator>
				<category><![CDATA[Mac OSX]]></category>

		<guid isPermaLink="false">http://blog.leenarts.net/?p=405</guid>
		<description><![CDATA[Mac OSX Snow Leopard has revived the Services menu. I&#8217;ve implemented a really simple Service called &#8220;Open Terminal Here&#8221;. It&#8217;s a small service which becomes available in the context menu of every file and folder in the Finder with an entry called &#8220;Open Terminal Here&#8221;. It&#8217;s function is really simple, it activated the Terminal application]]></description>
			<content:encoded><![CDATA[<p>Mac OSX Snow Leopard has revived the Services menu.</p>
<p>I&#8217;ve implemented a really simple Service called &#8220;Open Terminal Here&#8221;. It&#8217;s a small service which becomes available in the context menu of every file and folder in the Finder with an entry called &#8220;Open Terminal Here&#8221;.</p>
<p>It&#8217;s function is really simple, it activated the Terminal application and changes the current directory to selected directory or the containing directory, depending whether you selected a file or folder.</p>
<p>The linked zip file contains a file named: &#8220;Open Terminal Here.workflow&#8221;<br />
If you would like to change the name appearing in your services menu, just change the name of the file to something else. make sure the extension remains the same. For example: &#8220;Any other Name.workflow&#8221;.</p>
<p>After you are happy with the services name, copy the resulting file to the directory &#8220;Library/Services&#8221; in your user&#8217;s home directory. Now you can open a Terminal window at the location you&#8217;ve just selected, it works for multiple selections too.</p>
<p>Here&#8217;s the link to the zip file: <a href="http://blog.leenarts.net/wp-content/uploads/2009/09/Open-Terminal-Here-0.2.zip" title="Open Terminal Here 0.2.zip">Open Terminal Here 0.2.zip</a></p>
<p>Oh just a little tip, to open the current Terminal.app path you&#8217;re at into a Finder window, just type &#8220;open .&#8221; followed by a return. (Yes, that&#8217;s 4 characters, a space and finally a dot.)</p>
<p>Some people have reported some issues while installing this service. Please see the comments for a workaround by j.g. Owen.</p>
<p>Version 0.2:<br />
-should fix a localization problem.</p>
<p>I&#8217;ve also created a SVN repository for this little bit of code: <a href="http://svn.leenarts.net/svn/opensource/Open%20Terminal%20Here/">http://leenarts.net/svn/opensource/Open%20Terminal%20Here/</a><br />
When asked for a username and password, just enter empty strings.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.leenarts.net/2009/09/03/open-service-here/feed/</wfw:commentRss>
		<slash:comments>20</slash:comments>
		<feedburner:origLink>http://blog.leenarts.net/2009/09/03/open-service-here/</feedburner:origLink></item>
		<item>
		<title>Silverlight 3.0.40723.0 crashes Safari under Snow leopard</title>
		<link>http://feedproxy.google.com/~r/blogleenartsnet/~3/33fLFbn9u9w/</link>
		<comments>http://blog.leenarts.net/2009/08/31/silverlight-3-0-40723-0-crashes-safari-under-snow-leopard/#comments</comments>
		<pubDate>Mon, 31 Aug 2009 08:49:04 +0000</pubDate>
		<dc:creator>Jeroen</dc:creator>
				<category><![CDATA[Random thoughts]]></category>

		<guid isPermaLink="false">http://blog.leenarts.net/?p=397</guid>
		<description><![CDATA[This is the first big issue i&#8217;ve seen with Snow Leopard so far. Nothing to bad for me for now, but I discovered this while loading the intranet site at my work. The welcome page contains a Silverlight applet. Removing Silverlight from my internet pluging folder resolved the issue. I&#8217;m guessing Microsoft will have a]]></description>
			<content:encoded><![CDATA[<p>This is the first big issue i&#8217;ve seen with Snow Leopard so far.</p>
<p>Nothing to bad for me for now, but I discovered this while loading the intranet site at my work. The welcome page contains a Silverlight applet. Removing Silverlight from my internet pluging folder resolved the issue.</p>
<p>I&#8217;m guessing Microsoft will have a solution for this pretty soon.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.leenarts.net/2009/08/31/silverlight-3-0-40723-0-crashes-safari-under-snow-leopard/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://blog.leenarts.net/2009/08/31/silverlight-3-0-40723-0-crashes-safari-under-snow-leopard/</feedburner:origLink></item>
		<item>
		<title>JDK 7 – Project Coin is final</title>
		<link>http://feedproxy.google.com/~r/blogleenartsnet/~3/U8N0UpFVV9s/</link>
		<comments>http://blog.leenarts.net/2009/08/29/jdk-7-project-coin-is-final/#comments</comments>
		<pubDate>Sat, 29 Aug 2009 10:13:16 +0000</pubDate>
		<dc:creator>Jeroen</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[JDK7 Project Coin]]></category>

		<guid isPermaLink="false">http://blog.leenarts.net/?p=390</guid>
		<description><![CDATA[Friday Joseph Darcy announced through a blog post that Project Coin is final. Project Coin is just one of the changes coming to JDK 7. But, since the changes in Project Coin are all small changes to the Java language, every single Java developer will have to deal with these coming changes. It&#8217;s looking like]]></description>
			<content:encoded><![CDATA[<p>Friday Joseph Darcy announced through <a href="http://blogs.sun.com/darcy/entry/project_coin_final_five">a blog post</a> that <a href="http://openjdk.java.net/projects/coin/">Project Coin</a> is final.</p>
<p>Project Coin is just one of the changes coming to JDK 7. But, since the changes in Project Coin are all small changes to the Java language, every single Java developer will have to deal with these coming changes.</p>
<ul>
<li>It&#8217;s looking like we can use <b>Strings in switch statements</b>:
<pre class="brush: java;">
static boolean booleanFromString(String s) {
  switch(s) {
    case &quot;true&quot;:
      return true;
    case &quot;false&quot;:
      return false;
  }
  throw new IllegalArgumentException(s);
}  </pre>
</li>
<li><b>Automated Resource Blocks</b>, Josh Bloch proposed a construct like the one below:
<pre class="brush: java;">try (BufferedReader br = new BufferedReader(new FileReader(path)) {
  return br.readLine();
}</pre>
<p>instead of:</p>
<pre class="brush: java;"> BufferedReader br = new BufferedReader(new FileReader(path));
 try {
   return br.readLine();
 } finally {
   br.close();
 }</pre>
</li>
<li>
<b>Improved Type Inference</b>, the diamond operator. Instead of:</p>
<pre class="brush: java;">Map &lt;String, List &lt;String&gt; anagrams = new HashMap &lt;String, List &lt;String&gt;();</pre>
<p>you can do:</p>
<pre class="brush: java;">Map &lt;String, List &lt;String&gt; anagrams = new HashMap &lt;&gt;();</pre>
</li>
<li><b>Simplified VARARG method invocation</b>:
<pre class="brush: java;">static &lt;T&gt; List &lt;T&gt; asList(T... elements) { ... }

static List &lt;Callable &lt;String&gt; stringFactories() {
  Callable &lt;String&gt; a, b, c;
  ...
  *// Warning: ** uses unchecked or unsafe operations *
  return asList(a, b, c);
}</pre>
<p>After this change:</p>
<pre class="brush: java;">*// Warning: ** enables unsafe generic array creation *
static &lt;T&gt; List &lt;T&gt; asList(T... elements) { ... }

static List &lt;Callable &lt;String&gt; stringFactories() {
  Callable &lt;String&gt; a, b, c;
  ...
  return asList(a, b, c);
}</pre>
</li>
<li>Something with <b>better literal integers</b>, can&#8217;t seem to find the details at the moment.</li>
<li>And <b>language support for <a href="http://jcp.org/en/jsr/detail?id=292">JSR 292</a></b>. But this one is only interesting when dealing with dynamic languages.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.leenarts.net/2009/08/29/jdk-7-project-coin-is-final/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.leenarts.net/2009/08/29/jdk-7-project-coin-is-final/</feedburner:origLink></item>
		<item>
		<title>JBoss with SQL Server and EJB3 is giving me a hard time</title>
		<link>http://feedproxy.google.com/~r/blogleenartsnet/~3/HETRoB-Opuk/</link>
		<comments>http://blog.leenarts.net/2009/06/23/jboss-with-sql-server-and-ejb3-is-giving-me-a-hard-time/#comments</comments>
		<pubDate>Mon, 22 Jun 2009 23:28:52 +0000</pubDate>
		<dc:creator>Jeroen</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[EJB3]]></category>
		<category><![CDATA[JBoss]]></category>
		<category><![CDATA[MSSQL]]></category>

		<guid isPermaLink="false">http://blog.leenarts.net/?p=381</guid>
		<description><![CDATA[Today I had a bit of a fuss with JBoss and SQL Server. For some reason, when I declare an entity with an Id field, the persistency layer tries to push a bad query to the database. Let me explain. I&#8217;ve got an entity sort of looking like this: @Entity public class Contract { @Id]]></description>
			<content:encoded><![CDATA[<p>Today I had a bit of a fuss with JBoss and SQL Server. For some reason, when I declare an entity with an Id field, the persistency layer tries to push a bad query to the database.</p>
<p>Let me explain.</p>
<p>I&#8217;ve got an entity sort of looking like this:</p>
<pre class="brush: java;">
@Entity
public class Contract {

@Id
@GeneratedValue(strategy = GenerationType.Identity)
private int contractId;
...
}
</pre>
<p>When tryin to persist this through the entity manager SQL trace on MS SQL show a query somewhat looking like:</p>
<pre class="brush: sql;">
insert into Contract (contractid, ...) values (null, ...)
</pre>
<p>You see, a null value. Sounds reasonable, I didn&#8217;t set any value on the contractid field. BUT the persistency layer should not try to insert anything into the contractid column, because MSSQL doesn&#8217;t allow it. The above SQL results in a &#8220;DEFAULT or NULL are not allowed as explicit identity values.&#8221; I&#8217;m not sure what to try next though, everywhere I looked on the internet, all examples boil down too: &#8220;Something similar should work in MS SQL too, but I haven&#8217;t tested that&#8230;&#8221;</p>
<p>Better luck tomorrow. For now, I googled my brains out trying to find anything helpfull.</p>
<p>Anybody out there have any suggestions?</p>
<p><b>Update on the next day:</b><br />
It turns out that the problem was the dialect configured in the Hibernate properties in the persistence.xml. By default our development environment enters the right value for Hypersonic DB, while it should actually be like this:
<pre class="brush: xml;">&lt;property name=&quot;hibernate.dialect&quot; value=&quot;org.hibernate.dialect.SQLServerDialect&quot;/&gt;</pre>
<p>And now it all works. A default SQL Server 2005 with JBoss and the latest MSSQL JDBC driver, all running EJB3.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.leenarts.net/2009/06/23/jboss-with-sql-server-and-ejb3-is-giving-me-a-hard-time/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://blog.leenarts.net/2009/06/23/jboss-with-sql-server-and-ejb3-is-giving-me-a-hard-time/</feedburner:origLink></item>
		<item>
		<title>Upgraded WordPress to 2.8</title>
		<link>http://feedproxy.google.com/~r/blogleenartsnet/~3/6eNayxO_1X4/</link>
		<comments>http://blog.leenarts.net/2009/06/12/upgraded-wordpress-to-2-8/#comments</comments>
		<pubDate>Fri, 12 Jun 2009 09:56:17 +0000</pubDate>
		<dc:creator>Jeroen</dc:creator>
				<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://blog.leenarts.net/2009/06/12/upgraded-wordpress-to-2-8/</guid>
		<description><![CDATA[I&#8217;ve updated WordPress to 2.8 last night. I haven&#8217;t seen any problems myself so far. But if you do notice something, please let me know. Which reminds me, does the mail form still work after this update&#8230; I&#8217;ll go check that right now. . . . It still works.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve updated WordPress to 2.8 last night. I haven&#8217;t seen any problems myself so far. But if you do notice something, please let me know.</p>
<p>Which reminds me, does the mail form still work after this update&#8230; I&#8217;ll go check that right now. <img src='http://blog.leenarts.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>.<br />
.<br />
.<br />
It still works. <img src='http://blog.leenarts.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.leenarts.net/2009/06/12/upgraded-wordpress-to-2-8/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.leenarts.net/2009/06/12/upgraded-wordpress-to-2-8/</feedburner:origLink></item>
		<item>
		<title>Back from the JavaOne 2009</title>
		<link>http://feedproxy.google.com/~r/blogleenartsnet/~3/OpMVKb0scp8/</link>
		<comments>http://blog.leenarts.net/2009/06/10/back-from-the-javaone-2009/#comments</comments>
		<pubDate>Wed, 10 Jun 2009 09:21:28 +0000</pubDate>
		<dc:creator>Jeroen</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[JavaOne]]></category>

		<guid isPermaLink="false">http://blog.leenarts.net/?p=357</guid>
		<description><![CDATA[Phew, back from the JavaOne 2009 again. First time I&#8217;ve been there. And boy could you feel the recession at the JavaOne&#8230; I think the number of visitors was at an all time low. Also in San Francisco itself recession was around you. Loads and loads of properties available for lease or sale. But me]]></description>
			<content:encoded><![CDATA[<p>Phew, back from the JavaOne 2009 again.</p>
<p><img src="http://blog.leenarts.net/wp-content/uploads/2009/06/dscf0130.jpg" alt="Too bad Jonathan's assistent didn't allow my camera to focus." border="0" width="333" height="250" style="float: right; margin: 5px" /> First time I&#8217;ve been there. And boy could you feel the recession at the JavaOne&#8230; I think the number of visitors was at an all time low. Also in San Francisco itself recession was around you. Loads and loads of properties available for lease or sale.</p>
<p>But me and my colleagues did our best to support the global and local economy by living large. <img src='http://blog.leenarts.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Besides the conference we did all sorts of fun activities. I even biked the Golden Gate the last Friday afternoon.</p>
<p>I also learned a valuable lesson when returning from another time-zone. When I got home I did some things and then went to my girl&#8217;s place. I should&#8217;ve asked her to keep me awake at all costs. Sunday I sat down on her couch and I kind of instantly fell asleep. I paid the price on Monday and Tuesday. Fortunately my employer was very understanding about Monday and Tuesday I&#8217;ll recover by working a few extra hours this week or next week. <img src='http://blog.leenarts.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>More to come later. Suffice to say that on record nobody from Sun was allowed to spill any details on the Oracle/Sun merger. I understood of the record that there will be another JavaOne next year. Let&#8217;s hope that by then it is clear what will happen with Java, cause right now it&#8217;s anybodies guess what Oracle has in store for us. I&#8217;m expecting a whole lot, but it is still a bit early to say what exactly Oracle will keep and what Oracle will throw away. I do think JavaFX is here to stay though, the new JavaFX 1.2 is a major improvement compared to the 1.1 release. Check <a href=http://blogs.infosupport.com/blogs/paul_bakker/archive/2009/06/04/javaone-javafx-1-2-released.aspx>Paul Bakker&#8217;s entry on JavaFX</a> for more details.</p>
<p>Too bad the assistant of Jonathan Swartz didn&#8217;t allow my camera to focus properly.</p>
<p>Also many thanks to Bert, Paul, Marcel and Hans for being such great travel companions throughout the week.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.leenarts.net/2009/06/10/back-from-the-javaone-2009/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.leenarts.net/2009/06/10/back-from-the-javaone-2009/</feedburner:origLink></item>
		<item>
		<title>AVG 8 and Mozilla Thunderbird</title>
		<link>http://feedproxy.google.com/~r/blogleenartsnet/~3/Z04yGeuwCwA/</link>
		<comments>http://blog.leenarts.net/2009/05/02/avg-8-and-mozilla-thunderbird/#comments</comments>
		<pubDate>Sat, 02 May 2009 18:10:16 +0000</pubDate>
		<dc:creator>Jeroen</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[avg]]></category>
		<category><![CDATA[connection refused]]></category>
		<category><![CDATA[outbound]]></category>
		<category><![CDATA[outgoing]]></category>
		<category><![CDATA[smtp]]></category>
		<category><![CDATA[thunderbird]]></category>

		<guid isPermaLink="false">http://blog.leenarts.net/2009/05/02/avg-8-and-mozilla-thunderbird/</guid>
		<description><![CDATA[Something I ran into on a system of a relative. When running AVG 8&#8242;s outbound mail scanner and your ISP does not require you to provide a username and password when connecting for an outbound SMTP session&#8230; Make sure that you do NOT check the checkbox in the SMTP settings dialog near the username and]]></description>
			<content:encoded><![CDATA[<p>Something I ran into on a system of a relative.</p>
<p>When running AVG 8&#8242;s outbound mail scanner and your ISP does not require you to provide a username and password when connecting for an outbound SMTP session&#8230;</p>
<p>Make sure that you do NOT check the checkbox in the SMTP settings dialog near the username and password field in ThunderBird. If you do, you probably have trouble sending email.</p>
<p>This seems to only happen with AVG 8 or later when you check the scan outgoing messages option in AVG system tray application.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.leenarts.net/2009/05/02/avg-8-and-mozilla-thunderbird/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.leenarts.net/2009/05/02/avg-8-and-mozilla-thunderbird/</feedburner:origLink></item>
		<item>
		<title>Yup, this time it seems to be really it for SUN</title>
		<link>http://feedproxy.google.com/~r/blogleenartsnet/~3/iCc6QaCvhvI/</link>
		<comments>http://blog.leenarts.net/2009/04/20/yup-this-time-it-seems-to-be-really-it-for-sun/#comments</comments>
		<pubDate>Mon, 20 Apr 2009 13:26:26 +0000</pubDate>
		<dc:creator>Jeroen</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Random thoughts]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://blog.leenarts.net/?p=350</guid>
		<description><![CDATA[It seems Oracle has put forward a bid on SUN Microsystems. Sun apparently has accepted this offer and both parties are now in final negotiations. Personally I didn&#8217;t see this one coming. The IBM/Sun brush a short while ago was kind of obvious to me. Still a bit of a surprise, but yeah IBM absorbing]]></description>
			<content:encoded><![CDATA[<p>It seems <a href="http://finance.yahoo.com/news/Oracle-Buys-prnews-14969049.html">Oracle has put forward a bid on SUN Microsystems</a>. Sun apparently has accepted this offer and both parties are now in final negotiations.</p>
<p>Personally I didn&#8217;t see this one coming. The IBM/Sun brush a short while ago was kind of obvious to me. Still a bit of a surprise, but yeah IBM absorbing SUN I can dig that.</p>
<p>Now Oracle has stepped up to the plate and dumped a load of money on the table. Oracle never has been my favourite when it came to Java related technology. Lots of cool demo&#8217;s that are hard to reproduce in real life situations if you ask me. Also Oracle doesn&#8217;t give me that welcoming feeling when getting into contact with them. I guess we&#8217;ll just have to wait and see how this ordeal is going to affect Java in general.</p>
<p>I see a lot of competition between IBM and Oracle in the future. Because let&#8217;s just face it, is there any other big Java player to speak of if this deal gets finalised? There just aren&#8217;t any other vendors that could offer a complete no holds barred JEE stack besides those two big names.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.leenarts.net/2009/04/20/yup-this-time-it-seems-to-be-really-it-for-sun/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.leenarts.net/2009/04/20/yup-this-time-it-seems-to-be-really-it-for-sun/</feedburner:origLink></item>
		<item>
		<title>Latest iPhone WordPress app crashes a lot</title>
		<link>http://feedproxy.google.com/~r/blogleenartsnet/~3/5NYWkgqmGu4/</link>
		<comments>http://blog.leenarts.net/2009/04/15/latest-iphone-wordpress-app-crashes-a-lot/#comments</comments>
		<pubDate>Wed, 15 Apr 2009 21:48:16 +0000</pubDate>
		<dc:creator>Jeroen</dc:creator>
				<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://blog.leenarts.net/?p=348</guid>
		<description><![CDATA[While posting from the J-Spring conference with my iPhone I noticed the WordPress App (v.1.21) crashed a lot when trying to upload pictures. It worked wonderful at the last J-Fall. I sure hope they&#8217;ll fix this, cause I can not find a solution or workaround on the web at the moment. Perhaps re-installing the WordPress]]></description>
			<content:encoded><![CDATA[<p>While posting from the J-Spring conference with my iPhone I noticed the WordPress App (v.1.21) crashed a lot when trying to upload pictures. It worked wonderful at the last J-Fall. I sure hope they&#8217;ll fix this, cause I can not find a solution or workaround on the web at the moment. Perhaps re-installing the WordPress App might work?</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.leenarts.net/2009/04/15/latest-iphone-wordpress-app-crashes-a-lot/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://blog.leenarts.net/2009/04/15/latest-iphone-wordpress-app-crashes-a-lot/</feedburner:origLink></item>
		<item>
		<title>J-Spring: That’s it for today</title>
		<link>http://feedproxy.google.com/~r/blogleenartsnet/~3/SLIjXdLxcJU/</link>
		<comments>http://blog.leenarts.net/2009/04/15/j-spring-thats-it-for-today/#comments</comments>
		<pubDate>Wed, 15 Apr 2009 14:45:45 +0000</pubDate>
		<dc:creator>Jeroen</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[NL-Jug]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://blog.leenarts.net/2009/04/15/j-spring-thats-it-for-today/</guid>
		<description><![CDATA[I&#8217;ve decided to skip the last round of sessions, it&#8217;s sunny today and air in the session rooms is very warm and stale. Also the battery if my phone is almost dead. Update: I&#8217;ve updated all the posts of today, checked spelling, adjusted tags and uploaded photo&#8217;s. Enjoy&#8230;.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve decided to skip the last round of sessions, it&#8217;s sunny today and air in the session rooms is very warm and stale. Also the battery if my phone is almost dead. <img src='http://blog.leenarts.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong>Update:</strong><br />
I&#8217;ve updated all the posts of today, checked spelling, adjusted tags and uploaded photo&#8217;s. Enjoy&#8230;.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.leenarts.net/2009/04/15/j-spring-thats-it-for-today/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://blog.leenarts.net/2009/04/15/j-spring-thats-it-for-today/</feedburner:origLink></item>
	</channel>
</rss><!-- Dynamic page generated in 0.946 seconds. --><!-- Cached page generated by WP-Super-Cache on 2010-08-27 16:25:51 -->
