<?xml version="1.0"?>
<rss version="2.0">
<channel>
  <title>Stephan Schwab - java tag</title>
  <link>http://www.stephan-schwab.com/tags/java/</link>
  <description>Software Technology Consultant</description>
  <language>en</language>
  <copyright>Stephan Schwab</copyright>
  <lastBuildDate>Tue, 28 Oct 2008 21:32:43 GMT</lastBuildDate>
  <generator>Pebble (http://pebble.sourceforge.net)</generator>
  <docs>http://backend.userland.com/rss</docs>
  
  
  <item>
    <title>Sun offers support for Java 1.4 for the next 15 years</title>
    <link>http://www.stephan-schwab.com/2008/04/11/1207959748479.html</link>
    
      
        <description>
          &lt;p&gt;As a paid support offering for enterprise customers Sun now offers up to 15 years of support per Java SE family. Basically that means you could buy support for the Java 1.4 JVM and JDK for the next 15 years according to this press release.&lt;/p&gt;

&lt;blockquote&gt;&lt;a href=&#034;http://www.sun.com/aboutsun/pr/2008-04/sunflash.20080407.1.xml&#034;&gt;Sun Releases Java Platform Standard Edition For Business&lt;/a&gt;:&lt;br&gt;
Java SE for Business is designed for customers looking for longer, more predictable support for the platform - up to 15 years per family. Sun will also continue to support the latest non-subscription release of Java SE, at no cost, and deliver three years of quarterly maintenance updates per release family.
&lt;/blockquote&gt;

&lt;p&gt;Some people have been dubbed Java the new COBOL (&lt;a href=&#034;http://www.dailyack.com/2007/01/is-java-new-cobol.html&#034;&gt;1&lt;/a&gt;, &lt;a href=&#034;http://www.infoworld.com/article/07/12/28/52FE-underreported-java_1.html&#034;&gt;2&lt;/a&gt;, &lt;a href=&#034;http://www.artima.com/weblogs/viewpost.jsp?thread=42242&#034;&gt;3&lt;/a&gt;, &lt;a href=&#034;http://www.opensourceconnections.com/2008/01/02/is-java-the-new-cobol-2/&#034;&gt;4&lt;/a&gt;, &lt;a href=&#034;http://stuffthathappens.com/blog/2008/01/19/java-is-the-new-cobozap/&#034;&gt;5&lt;/a&gt;). Looks to me that there were not mistaken ;-)&lt;/p&gt;

&lt;!--
&lt;rdf:RDF xmlns:rdf=&#034;http://www.w3.org/1999/02/22-rdf-syntax-ns#&#034;
         xmlns:dc=&#034;http://purl.org/dc/elements/1.1/&#034;
         xmlns:trackback=&#034;http://madskills.com/public/xml/rss/module/trackback/&#034;&gt;
&lt;rdf:Description
    rdf:about=&#034;http://www.stephan-schwab.com/2008/04/11/1207959748479.html&#034;
    dc:identifier=&#034;http://www.stephan-schwab.com/2008/04/11/1207959748479.html&#034;
    dc:title=&#034;Sun offers support for Java 1.4 for the next 15 years&#034;
    trackback:ping=&#034;http://www.stephan-schwab.com/addTrackBack.action?entry=1207959748479&amp;token=5017724026214879591&#034; /&gt;
&lt;/rdf:RDF&gt;
--&gt;
        </description>
      
      
    
    
    
    <category>Java</category>
    
    <comments>http://www.stephan-schwab.com/2008/04/11/1207959748479.html#comments</comments>
    <guid isPermaLink="true">http://www.stephan-schwab.com/2008/04/11/1207959748479.html</guid>
    <pubDate>Sat, 12 Apr 2008 00:22:28 GMT</pubDate>
  </item>
  
  <item>
    <title>Is Java 6 really ready?</title>
    <link>http://www.stephan-schwab.com/2007/11/01/1193951070823.html</link>
    
      
        <description>
          &lt;p&gt;Ok... Now it&#039;s getting ugly with the Java 6 VM on Ubuntu Linux:&lt;/p&gt;

&lt;pre class=&#034;codeSample&#034;&gt;java.lang.OutOfMemoryError: PermGen space
#
# An unexpected error has been detected by Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0xb48d24d3, pid=4758, tid=3075954368
#
# Java VM: Java HotSpot(TM) Client VM (1.6.0_03-b05 mixed mode, sharing)
# Problematic frame:
# C  [libswt-pi-gtk-3346.so+0x2e4d3]  Java_org_eclipse_swt_internal_gtk_OS_GTK_1ACCEL_1LABEL_1GET_1ACCEL_1STRING+0x6
#
# An error report file with more information is saved as hs_err_pid4758.log
#
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp
#
Aborted (core dumped)
&lt;/pre&gt;
&lt;!--
&lt;rdf:RDF xmlns:rdf=&#034;http://www.w3.org/1999/02/22-rdf-syntax-ns#&#034;
         xmlns:dc=&#034;http://purl.org/dc/elements/1.1/&#034;
         xmlns:trackback=&#034;http://madskills.com/public/xml/rss/module/trackback/&#034;&gt;
&lt;rdf:Description
    rdf:about=&#034;http://www.stephan-schwab.com/2007/11/01/1193951070823.html&#034;
    dc:identifier=&#034;http://www.stephan-schwab.com/2007/11/01/1193951070823.html&#034;
    dc:title=&#034;Is Java 6 really ready?&#034;
    trackback:ping=&#034;http://www.stephan-schwab.com/addTrackBack.action?entry=1193951070823&amp;token=5689150723268578423&#034; /&gt;
&lt;/rdf:RDF&gt;
--&gt;
        </description>
      
      
    
    
    
    <category>Java</category>
    
    <category>Linux</category>
    
    <comments>http://www.stephan-schwab.com/2007/11/01/1193951070823.html#comments</comments>
    <guid isPermaLink="true">http://www.stephan-schwab.com/2007/11/01/1193951070823.html</guid>
    <pubDate>Thu, 01 Nov 2007 21:04:30 GMT</pubDate>
  </item>
  
  <item>
    <title>Java and Mac OS X: it&#039;s all about priorities</title>
    <link>http://www.stephan-schwab.com/2007/11/01/1193893447497.html</link>
    
      
        <description>
          &lt;p&gt;To most users Mac OS X is a desktop operating system. It has Unix under the hood, but the most important part that distinguishes Darwin (the FreeBSD variant) from Mac OS X is the user interface and the applications one can build by using libraries such as Cocoa and others.&lt;/p&gt;

&lt;p&gt;Now apparently Apple has done a number of improvements for the Java 5 VM and JDK libraries to allow Java developers to write equally compelling &lt;a href=&#034;http://my.opera.com/behrangsa/blog/2007/10/31/java-and-mac-osx-the-right-time-the-right-choice&#034;&gt;desktop applications&lt;/a&gt; in their language of choice. That makes sense and is a good thing.&lt;/p&gt;

&lt;p&gt;Server side Java developers and people interested in the bleeding edge can always use tools like Parallels or VMware Fusion to run another operating system (Windows, Linux or Solaris) to get access to the latest Java VM whether it is experimental or short after Sun releases a first production version. So it&#039;s not a matter of whether Java gets abandoned by Apple or not. It&#039;s simply a matter of where the priorities are. To a desktop application developer it&#039;s more important that his applications can be run on a solid and well equipped environment. Apparently Mac OS X Leopard (10.5) is such an environment. I&#039;ve always been happy with its predecessor Tiger (10.4) and I don&#039;t feel a big urge to use the Java 6 VM. For a current server side project I need to use Java 6 and I do that with Ubuntu Linux running on VMware Fusion. There I have the Sun Java 6 VM. It&#039;s a huge difference and I would love to keep working on OS X as I don&#039;t have to &lt;a href=&#034;/2007/10/29/1193689377397.html&#034;&gt;restart Eclipse so frequently&lt;/a&gt;.&lt;/p&gt;

&lt;!--
&lt;rdf:RDF xmlns:rdf=&#034;http://www.w3.org/1999/02/22-rdf-syntax-ns#&#034;
         xmlns:dc=&#034;http://purl.org/dc/elements/1.1/&#034;
         xmlns:trackback=&#034;http://madskills.com/public/xml/rss/module/trackback/&#034;&gt;
&lt;rdf:Description
    rdf:about=&#034;http://www.stephan-schwab.com/2007/11/01/1193893447497.html&#034;
    dc:identifier=&#034;http://www.stephan-schwab.com/2007/11/01/1193893447497.html&#034;
    dc:title=&#034;Java and Mac OS X: it&#039;s all about priorities&#034;
    trackback:ping=&#034;http://www.stephan-schwab.com/addTrackBack.action?entry=1193893447497&amp;token=5850637379556013416&#034; /&gt;
&lt;/rdf:RDF&gt;
--&gt;
        </description>
      
      
    
    
    
    <category>Java</category>
    
    <category>Mac</category>
    
    <comments>http://www.stephan-schwab.com/2007/11/01/1193893447497.html#comments</comments>
    <guid isPermaLink="true">http://www.stephan-schwab.com/2007/11/01/1193893447497.html</guid>
    <pubDate>Thu, 01 Nov 2007 05:04:07 GMT</pubDate>
  </item>
  
  <item>
    <title>Java on Leopard - enough complaining</title>
    <link>http://www.stephan-schwab.com/2007/10/31/1193865191531.html</link>
    
      
        <description>
          &lt;p&gt;&lt;a href=&#034;http://bill.dudney.net/roller/bill/entry/20071031&#034;&gt;This&lt;/a&gt; is definitely a comment worth sharing.&lt;/p&gt;
&lt;!--
&lt;rdf:RDF xmlns:rdf=&#034;http://www.w3.org/1999/02/22-rdf-syntax-ns#&#034;
         xmlns:dc=&#034;http://purl.org/dc/elements/1.1/&#034;
         xmlns:trackback=&#034;http://madskills.com/public/xml/rss/module/trackback/&#034;&gt;
&lt;rdf:Description
    rdf:about=&#034;http://www.stephan-schwab.com/2007/10/31/1193865191531.html&#034;
    dc:identifier=&#034;http://www.stephan-schwab.com/2007/10/31/1193865191531.html&#034;
    dc:title=&#034;Java on Leopard - enough complaining&#034;
    trackback:ping=&#034;http://www.stephan-schwab.com/addTrackBack.action?entry=1193865191531&amp;token=-1621789009730147776&#034; /&gt;
&lt;/rdf:RDF&gt;
--&gt;
        </description>
      
      
    
    
    
    <category>Java</category>
    
    <category>Mac</category>
    
    <comments>http://www.stephan-schwab.com/2007/10/31/1193865191531.html#comments</comments>
    <guid isPermaLink="true">http://www.stephan-schwab.com/2007/10/31/1193865191531.html</guid>
    <pubDate>Wed, 31 Oct 2007 21:13:11 GMT</pubDate>
  </item>
  
  <item>
    <title>Stale Java for the Mac Faithful</title>
    <link>http://www.stephan-schwab.com/2007/10/29/1193689377397.html</link>
    
      
        <description>
          &lt;p&gt;Now that Apple has released Leopard (Mac OS X 10.5.0) many blogs start talking about the missing JVM 1.6. Here is a quote from one of them:&lt;/p&gt;

&lt;blockquote&gt;&lt;a href=&#034;http://gigaom.com&#034;&gt;Om Malik&#039;s Broadband Blog&lt;/a&gt; in &lt;a href=&#034;http://gigaom.com/2007/10/29/stale-java-for-the-mac-faithful/#comments&#034;&gt;Stale Java for the Mac Faithful&lt;/a&gt;:&lt;br&gt;
&lt;p&gt;Mac releases of Java lag those for Linux and Windows, and release 1.6 speeds up applications considerably, something Java needs in its fight with Adobe (ADBE) and Microsoft. Apple teased Java developers at its worldwide development conference with details on how Leopard would work well with Java and the community got its hopes up.&lt;/p&gt;

&lt;p&gt;Part of the problem is that Apple insists on developing the JDK for MacOS. But another part is the company&amp;rsquo;s attitude towards innovation: That&amp;rsquo;s Apple&amp;rsquo;s Job.
&lt;/p&gt;
&lt;p&gt;As a company that makes both the hardware and the operating system, Apple has imposed more restrictions and regulations on its products than other computer manufacturers.&lt;/p&gt;

&lt;p&gt;It&amp;rsquo;s possible that giving developers tools and open access to platforms will further reduce Apple&amp;rsquo;s control over the desktop. But by limiting development tools Apple is playing a risky game that may send developers looking for more friendly development platforms.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Currently I&#039;m using Java 1.6 for a project on Ubuntu Linux. The IDE of choice is Eclipse 3.3 with a small number of plugins (Subclipse, M2Eclipse and Spring IDE). My experience so far is that Eclipse crashes arbitrarily with the latest JVM 1.6 upgrade 3. It&#039;s probably two or three times per day. That never happens with Apple&#039;s JVM 1.5 on Mac OS X (Tiger). On OS X I never close Eclipse throughout the week. I simply close the lid of the MacBook Pro, go home, use the laptop to surf the web in the evening and when I open it the next day I simply keep using Eclipse at the point where I left it.&lt;/p&gt;

&lt;p&gt;So from my point of view I&#039;m not so eager to use JVM 1.6 at this point in time. Speed improvements are one thing. But developer&#039;s productivity decreases drastically, if the tools are not stable. It&#039;s cheaper and easier to buy more powerful hardware, than to find skilled developers. I like to focus on my development problems and not on solving problems with the computing environment. In the end that saves a lot of time and money.&lt;/p&gt;

&lt;!--
&lt;rdf:RDF xmlns:rdf=&#034;http://www.w3.org/1999/02/22-rdf-syntax-ns#&#034;
         xmlns:dc=&#034;http://purl.org/dc/elements/1.1/&#034;
         xmlns:trackback=&#034;http://madskills.com/public/xml/rss/module/trackback/&#034;&gt;
&lt;rdf:Description
    rdf:about=&#034;http://www.stephan-schwab.com/2007/10/29/1193689377397.html&#034;
    dc:identifier=&#034;http://www.stephan-schwab.com/2007/10/29/1193689377397.html&#034;
    dc:title=&#034;Stale Java for the Mac Faithful&#034;
    trackback:ping=&#034;http://www.stephan-schwab.com/addTrackBack.action?entry=1193689377397&amp;token=4577093828835072443&#034; /&gt;
&lt;/rdf:RDF&gt;
--&gt;
        </description>
      
      
    
    
    
    <category>Java</category>
    
    <category>Mac</category>
    
    <comments>http://www.stephan-schwab.com/2007/10/29/1193689377397.html#comments</comments>
    <guid isPermaLink="true">http://www.stephan-schwab.com/2007/10/29/1193689377397.html</guid>
    <pubDate>Mon, 29 Oct 2007 20:22:57 GMT</pubDate>
  </item>
  
  <item>
    <title>Starting to love EJB3 Hibernate Annotations</title>
    <link>http://www.stephan-schwab.com/2007/03/08/1173410671927.html</link>
    
      
        <description>
          &lt;p&gt;As our current project allows for some experimentation and adoption of recent technologies, we spent today with EJB3 Hibernate Annotations to get away from the XML configuration one used to create with Hibernate before.&lt;/p&gt;

&lt;p&gt;The annotations need to be placed in the same compilation unit as the entity class lives in. The result is that these POJOs now are no longer POJOs in a very tight sense. That has been &lt;a href=&#034;http://www.theserverside.com/discussions/thread.tss?thread_id=42447&#034;&gt;criticized&lt;/a&gt; as polluting the codebase with ORM specific annotations. That&#039;s certainly right, but one does not replace one ORM tool for another very often and going with the EJB3 Java Persistence annotation one can replace ORM tools, as Hibernate is just one implementation of that API. So I wouldn&#039;t fear too much. After all those classes that become entity classes are meant to be stored into a database and somewhere I have to put the mapping. Doing so in Java code instead of an external XML file appears to be clearer and more appealing to a developer.&lt;/p&gt;

&lt;p&gt;Here is something we learned today.&lt;/p&gt;

&lt;p&gt;Let&#039;s define a persistent entity class called &lt;code&gt;Issue&lt;/code&gt;.&lt;/p&gt;

&lt;pre class=&#034;codeSample&#034;&gt;@Entity
@Table(name=&#034;issue&#034;)
@NamedQueries( { @NamedQuery(name = &#034;findIssueById&#034;, query = &#034;from Issue i where i.id = ?&#034;) })
public class Issue implements IdentifiableObject {

  @Id @GeneratedValue
  private long id ;

[...]
}&lt;/pre&gt;

&lt;p&gt;This entity will be persisted into the table &lt;code&gt;issue&lt;/code&gt; and you see that it has an id field. Other fields are omitted for clarity. Further we define a named query &lt;code&gt;findIssueById&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;In a generic DAO class using Spring&#039;s Hibernate template we create a method &lt;code&gt;findById&lt;/code&gt; as follows.&lt;/p&gt;

&lt;pre class=&#034;codeSample&#034;&gt;public Object findById(String query, long id) {
  List list = getHibernateTemplate().findByNamedQuery(query, id);
  if (list.isEmpty())
    return null ;
  else
    return list.get(0) ;
}&lt;/pre&gt;

&lt;p&gt;Elsewhere in the application we can the find any entity by calling findById passing in the name of the named query and of course the query criteria id.&lt;/p&gt;

&lt;pre class=&#034;codeSample&#034;&gt;Issue issueRead = (Issue) repository.findById(&#034;findIssueById&#034;, someId) ;&lt;/pre&gt;

&lt;p&gt;In your Spring application context configure your session factory using the &lt;code&gt;AnnotationSessionFactoryBean&lt;/code&gt;.&lt;/p&gt;

&lt;pre class=&#034;codeSample&#034;&gt;&amp;lt;bean id=&#034;mySessionFactory&#034; class=&#034;org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean&#034;&amp;gt;
  &amp;lt;property name=&#034;dataSource&#034; ref=&#034;myDataSource&#034;/&amp;gt;
  &amp;lt;property name=&#034;hibernateProperties&#034;&amp;gt;
    &amp;lt;props&amp;gt;
      &amp;lt;prop key=&#034;hibernate.dialect&#034;&amp;gt;org.hibernate.dialect.HSQLDialect&amp;lt;/prop&amp;gt;
      [...]
    &amp;lt;/props&amp;gt;
  &amp;lt;/property&amp;gt;
  &amp;lt;property name=&#034;annotatedClasses&#034;&amp;gt;
    &amp;lt;list&amp;gt;
      &amp;lt;value&amp;gt;net.caimito.savila.Issue&amp;lt;/value&amp;gt;
    &amp;lt;/list&amp;gt;
  &amp;lt;/property&amp;gt;
&amp;lt;/bean&amp;gt;&lt;/pre&gt;


&lt;!--
&lt;rdf:RDF xmlns:rdf=&#034;http://www.w3.org/1999/02/22-rdf-syntax-ns#&#034;
         xmlns:dc=&#034;http://purl.org/dc/elements/1.1/&#034;
         xmlns:trackback=&#034;http://madskills.com/public/xml/rss/module/trackback/&#034;&gt;
&lt;rdf:Description
    rdf:about=&#034;http://www.stephan-schwab.com/2007/03/08/1173410671927.html&#034;
    dc:identifier=&#034;http://www.stephan-schwab.com/2007/03/08/1173410671927.html&#034;
    dc:title=&#034;Starting to love EJB3 Hibernate Annotations&#034;
    trackback:ping=&#034;http://www.stephan-schwab.com/addTrackBack.action?entry=1173410671927&amp;token=2152954708132265194&#034; /&gt;
&lt;/rdf:RDF&gt;
--&gt;
        </description>
      
      
    
    
    
    <category>Java</category>
    
    <category>SpringFramework</category>
    
    <category>Experience</category>
    
    <category>Caimito</category>
    
    <category>Hibernate</category>
    
    <comments>http://www.stephan-schwab.com/2007/03/08/1173410671927.html#comments</comments>
    <guid isPermaLink="true">http://www.stephan-schwab.com/2007/03/08/1173410671927.html</guid>
    <pubDate>Fri, 09 Mar 2007 03:24:31 GMT</pubDate>
  </item>
  
  </channel>
</rss>
