<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Javatech &#187; Spring</title>
	<atom:link href="http://javatech.org/category/spring/feed/" rel="self" type="application/rss+xml" />
	<link>http://javatech.org</link>
	<description>The Bleeding Edge of Java Technology</description>
	<lastBuildDate>Wed, 24 Jun 2009 22:30:48 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Discovering Roo</title>
		<link>http://javatech.org/2009/06/discovering-roo/</link>
		<comments>http://javatech.org/2009/06/discovering-roo/#comments</comments>
		<pubDate>Sun, 14 Jun 2009 20:51:49 +0000</pubDate>
		<dc:creator>deevis</dc:creator>
				<category><![CDATA[Application Servers]]></category>
		<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Spring]]></category>
		<category><![CDATA[Web Frameworks]]></category>
		<category><![CDATA[aspectj]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[roo]]></category>

		<guid isPermaLink="false">http://javatech.org/?p=77</guid>
		<description><![CDATA[I decided to follow along with the presentation given by Ben Alex during the SpringOne Keynote Address by Rod Johnson.
First &#8211; I have to install Roo and get the Roo shell up and running.  I&#8217;m really excited at this point because Roo does look really cool &#8211; really RAD!
So I download Roo and explode it [...]]]></description>
			<content:encoded><![CDATA[<p>I decided to follow along with the presentation given by Ben Alex during the <a title="SpringOne Keynote Address by Rod Johnson" href="http://www.infoq.com/presentations/SpringOne-Keynote-Rod-Johnson" target="_self">SpringOne Keynote Address by Rod Johnson</a>.</p>
<p>First &#8211; I have to install Roo and get the Roo shell up and running.  I&#8217;m really excited at this point because Roo does look really cool &#8211; really RAD!</p>
<p>So I <a title="Download Roo 1.0.0.M1" href="http://s3.amazonaws.com/dist.springframework.org/milestone/ROO/spring-roo-1.0.0.M1.zip" target="_self">download Roo</a> and explode it out to where I explode all of my 3rd party tools and then open <a title="cygwin" href="http://www.cygwin.com/">cygwin</a> (I&#8217;m on Windows and am trying hard to move away from Dos&#8230;) and navigate to the new directory.  I find a bin directory with two scripts in it: roo.bat and roo.sh.  Sweet!  They have a linux version ( cygwin == linux in many ways ).  So I run roo.sh and get:</p>
<p><strong>./roo.sh</strong></p>
<pre style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 800px; height: 204px; text-align: left;" dir="ltr">Exception in thread "main" java.lang.NoClassDefFoundError: org/springframework/roo/bootstrap/Bootstrap
Caused by: java.lang.ClassNotFoundException: org.springframework.roo.bootstrap.Bootstrap
        at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
Could not find the main class: org.springframework.roo.bootstrap.Bootstrap.  Program will exit.</pre>
<p>OK &#8211; take a step back.  What have I done wrong here.</p>
<p>I back up a directory and also try <strong>./bin/roo.sh</strong>.  I look in the readme.txt and create the symlink for install on linux that they recommend:</p>
<p><strong>ln -s /path/to/roo/bin/roo.sh /usr/bin/roo</strong></p>
<p>I type in &#8216;roo&#8217; and get the same BootStrap Exception.</p>
<p>So then I invoke the wisdom of Google and learn that most everyone who encounters this error gets it because they are in Dos and are working in a different drive than where Roo is installed.  I&#8217;m on the same drive &#8211; but it&#8217;s not working in cygwin!  No hits on this somehow?!?  I find some other results which want me to additionally set an environment variable ROO_HOME.  I do this by running from the Roo install directory ( above bin, that is&#8230;):</p>
<p><strong>export ROO_HOME=`pwd`</strong></p>
<p><strong>env | grep ROO</strong></p>
<p>I still get the same problem (ClassNotFoundException: org.springframework.roo.bootstrap.Bootstrap), so I cave and go into a Dos prompt.  Well, first I add %ROO_HOME%\bin to my path, and *then* go into a Dos prompt.  I run &#8216;roo&#8217; and get the same Bootstrap Exception again.  But now, I am on the wrong drive, and cd to the same drive I installed Roo on &#8211; now things are working.</p>
<p>Time to even start using Roo in this example : <strong>15 minutes</strong></p>
<p>So, Roo is working now &#8211; I have a shell up and running.  I&#8217;m stoked because it really is cool.  It has &#8216;hint&#8217; as a keyword and tab-based auto-completion which is contextual &#8211; it auto-completes the correct things at the correct times.<br />
<a title="Creating a Project with Roo" href="http://javatech.org/article_yet_to_be_written">Creating a project with Roo</a> is a very nice experience : <strong>3 minutes</strong></p>
<p>I already have maven2 installed so I&#8217;m able to exit out of Roo and run &#8216;mvn eclipse:eclipse&#8217; and import the project into Eclipse : <strong>2 minute</strong>s</p>
<p>Wow, now we&#8217;re flying.  Except, wait, there a bunch of &#8220;.aj&#8221; files in my project.  Cool, <a title="Spring Roo Leverages AspectJ" href="http://javatech.org/article_yet_to_be_written">Roo is leveraging AspectJ</a>.  Suck, I don&#8217;t have AJDT plugin configured for Eclipse and I&#8217;m missing a bunch of the stuff Roo has added to my project ( 9 .aj files in all ).  Thinking this might not matter, I run the JUnitTest that Roo created for my project and see only 1 test being run &#8211; the demo has a bunch of tests being run ( added via AspectJ ).  Also, when I auto-complete on my entity class I created, I don&#8217;t get any of the framework added static methods.  Translation: I need to install the AJDT plugin for Eclipse: <strong>10 minutes</strong> ( http://download.eclipse.org/tools/ajdt/34/update ).</p>
<p>Now things are good to go &#8211; I now see the out-of-the box static methods added to my domain class ( Choice.java ).   And now when I run the JUnitTest I see that 8 new tests have been added and run.  But there&#8217;s something else stinky in the state of Denmark!</p>
<pre style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 800px; height: 40px; text-align: left;" dir="ltr">IllegalStateException: Entity manager has not been injected (is the Spring Aspects JAR configured as an AJC/AJDT aspects library?</pre>
<p>No, the SpringAspects JAR is *NOT* configured as an AJC/AJDT aspects library!  I don&#8217;t know what the SpringAspects JAR is nor what it means to configure it as an AJC/AJDT aspects library.  Basically, this means you need to select the spring-aspects.jar to be in the Aspect Path of the AspectJ Build configuration of the project.  A picture is worth a 1,000 words here</p>
<div id="attachment_84" class="wp-caption alignnone" style="width: 310px"><img class="size-medium wp-image-84" title="aspectj_spring_aspects_configuration" src="http://javatech.org/wp-content/uploads/2009/06/aspectj_spring_aspects_configuration-300x170.jpg" alt="Adding spring-aspects.jar to AspectJ Build path" width="300" height="170" /><p class="wp-caption-text">Adding spring-aspects.jar to AspectJ Build path</p></div>
<p><strong>10 minutes</strong></p>
<p>So, we&#8217;re up to 40 minutes of time spent when the whole thing up until now should only be 5 minutes.</p>
<p>But wait, there&#8217;s more.  Now I find that I don&#8217;t have setters being woven into my Choice.java class by the Choice_Roo_Javabean.aj aspect.  I see the correct code in the aspect, but Eclipse&#8217;s autocomplete and the actual compilation fail when I attempt to access new Choice().setNamingChoice().    I can deal with this later because I&#8217;ve got to get on with the demo.</p>
<p>Next up &#8211; Roo will automatically update the companion aspect files it creates as new properties are added to the domain entity.  That is, if I simply add a new property called &#8216;description&#8217; to my entity, and I have roo running in the background, then the Choice_Roo_Javabean.aj is automatically updated with the new getter/setter methods, and the Choice_Roo_ToString.aj is updated to include description.  SUPER COOL.</p>
<p>On a tangent, it is not mandatory that these woven aspects dictate the toString and javabean parts of the entity class.  The class has annotations in it to specify that the framework will handle these concerns: @RooJavaBean, @RooToString.  There is also a @RooEntity which adds all of the dao-ish methods to the class.  This is a pattern taken from Grails.</p>
<p>At this point we have an autogenerated JavaBean and a companion TestCase that works.</p>
<p>What about the webapp?  Inside of Roo shell, we can now run:</p>
<p><strong>new controller automatic</strong></p>
<p>With a few arguments to generate the framework jsps, the wiring, the formBackingObject functionality and even the crud forms for the domain entity.  The ordering of the fields on the crud forms matches the order in which they appear in the java file.  Changing the order of properties in the java file will change their order in the ToString.aj and crud JSPs as well. <strong>2 minutes</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://javatech.org/2009/06/discovering-roo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sun to be bought by Oracle for $7.4 Billion</title>
		<link>http://javatech.org/2009/06/sun-to-be-bought-by-oracle-for-7-4-billion/</link>
		<comments>http://javatech.org/2009/06/sun-to-be-bought-by-oracle-for-7-4-billion/#comments</comments>
		<pubDate>Sun, 14 Jun 2009 17:45:09 +0000</pubDate>
		<dc:creator>deevis</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Spring]]></category>

		<guid isPermaLink="false">http://javatech.org/?p=75</guid>
		<description><![CDATA[The mighty behemoth, proprietary squelchor of innovation, and extremely expensive Oracle is about to acquire the open-source, free, and always innovative Sun.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m a little late on this to really consider it news in the sense that news is usually new.  And I must admit I was sceptical when I first heard it, but it&#8217;s true.  Sun themselves admit it : http://www.sun.com/aboutsun/pr/2009-04/sunflash.20090420.1.xml.</p>
<p>The mighty behemoth, proprietary squelchor of innovation, and extremely expensive Oracle is about to acquire the open-source, free, and always innovative Sun ( and with that Java!).  Anyway I look at this it sucks &#8211; for Java, at least.  This will, in my humble opinion, accelerate Java&#8217;s path to Cobol &#8211; which it is destined to become as more agile languages come to maturity and continue to grow in popularity ( ruby, python, erlang ).</p>
<p>Rod Johnson, with Spring, is singing an optimistic tune ( <a title="Rod Johnson talks about the future of Java" href="http://www.infoq.com/presentations/SpringOne-Keynote-Rod-Johnson" target="_self">Spring Keynote Address on Future of Java</a> ) .  One that talks about Java having reached maturity and that it doesn&#8217;t really need to evolve anymore.  C doesn&#8217;t really evolve &#8211; it does what it does and does it very well.  As Rod says, &#8220;It doesn&#8217;t pretend to be C#.&#8221;  Point taken.  He goes on to say that in many ways the innovation in the Java community has already moved outside of the Java core.  Language improvements include Groovy and Scala.  Framework improvements come in the form of Grails ( and, he doesn&#8217;t mention this, Seam ).</p>
<p>Rod&#8217;s address is largely true, but it is also to drum up excitement for their new application generation project ROO.  This gives alot of the functionality one would get from Rails or Seam, but does things within a shell rather than all command line.  This is actually kind of nice because the shell can keep track of the context each subsequent command is running in and also allows for some pretty snazzy auto-completion features.</p>
<p>Should we Javaheads run around screaming the sky is falling?  Probably not.  But if we don&#8217;t get up to snuff with Grails and new projects like Seam and Roo which look to make things a whole lot RAD-der, then we&#8217;d better accept our role as stewards to the next generation of Cobol applications.</p>
<p>One more thing &#8211; Ruby, for example, is still missing a lot of enterprise tooling which we take for granted in the Java world.  Applications like JConsole and JProfiler don&#8217;t yet exists &#8211; so another way to look at this is on the larger programming stage, where what we&#8217;ve learned with Java should be created for Ruby, Python, and Erlang to ease the passing of the torch when the time comes.</p>
]]></content:encoded>
			<wfw:commentRss>http://javatech.org/2009/06/sun-to-be-bought-by-oracle-for-7-4-billion/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Conventionally Annotated Configuration &#8211; Spring, Hibernate, Eclipse</title>
		<link>http://javatech.org/2009/02/a-conventionally-annotated-configuration-spring-hibernate-eclipse/</link>
		<comments>http://javatech.org/2009/02/a-conventionally-annotated-configuration-spring-hibernate-eclipse/#comments</comments>
		<pubDate>Wed, 18 Feb 2009 07:31:29 +0000</pubDate>
		<dc:creator>deevis</dc:creator>
				<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Hibernate]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Spring]]></category>
		<category><![CDATA[Maven]]></category>
		<category><![CDATA[Tomcat]]></category>

		<guid isPermaLink="false">http://javatech.org/2009/02/18/a-conventionally-annotated-configuration-spring-hibernate-eclipse/</guid>
		<description><![CDATA[I&#8217;m starting on a personal project and decided I was going to take the time to do things right.  This means different things to different folks, but to me it basically entails:

Using the latest and greatest versions of everything.  Eclipse 3.4.  Hibernate 3.3.1.  Spring 2.5.6.  Tomcat 6.  Maven 2.0.9.  Java 6 ( 7? ), DWR [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m starting on a personal project and decided I was going to take the time to do things right.  This means different things to different folks, but to me it basically entails:</p>
<ol>
<li>Using the latest and greatest versions of everything.  Eclipse 3.4.  Hibernate 3.3.1.  Spring 2.5.6.  Tomcat 6.  Maven 2.0.9.  Java 6 ( 7? ), DWR 3.0.</li>
<li>Using Eclipse plugins to do as much as possible without causing headaches</li>
<li>Using as little XML configuration as possible &#8211; conventions, conventions, conventions!!!</li>
<li>Using JPA annotations for ORM classes.</li>
<li>Using Annotations for IOC dependencies.</li>
<li>Using Annotations for Transactional demarcation.</li>
<li>Using Annotations for MVC mappings.</li>
<li>Using very basic JSTL-based JSP&#8217;s for views.</li>
<li>Using Sitemesh to present a uniform look and feel across all pages.</li>
<li>For icing on the cake I&#8217;d like to also include GWT components.</li>
</ol>
<p><strong>Using the latest and greatest versions of everything</strong><br />
If you install Eclipse 3.4 first, and then install the Maven Integration plugin, it will greatly simplify things.  Just add Maven Integration to your project and then use &#8220;Add Dependency&#8221; option to quickly scour the entire repository and find the exact groupIds, artifactIds, and versions you want.  It also has a great view of the dependency hierarchy!  Getting all of these bleeding-edge versions to play nice together has its fair share of challenges.</p>
<p><strong> Using as little XML configuration as possible</strong></p>
<p><strong>Using Eclipse plugins to do as much as possible without causing headaches</strong></p>
<p>I already mentioned Maven Integration above to help with getting the LAGV of all the technologies being used.  Also of great value and import are SysDeo and  Subclipse.  Sysdeo is great for deploying and debugging your webapp in Tomcat.  Subclipse is great for seamless integration with an SVN repostiory.  Yes &#8211; use SCM on personal projects, you never know when you&#8217;ll need to revert or bring the code down onto a new machine.</p>
<p>But where do we draw the line here?  When do we have so much annotation cruft that an externalized xml configuration will seem like the ideal solution ( from whence we currently come in search of clarity! ).</p>
<p><strong>Using very basic JSTL-based JSP&#8217;s for views</strong><br />
OK &#8211; well, tonight I was getting ready to put together the first couple of jsp&#8217;s now that the @Controller mappings are working and the pages are being served correctly.  I&#8217;ve got the method mapped correctly with @RequestMapping and I&#8217;ve got the model being put into pagescope with @ModelAttribute.  I&#8217;m ready to loop through a List using JSTL forEach.  But wait, can this possibly be true?  Tomcat6 has no implementation of JSTL.  JSTL 1.2 is the LAGV and the JSTL 1.1 is abandoned.  Only *Glassfish* ships with the reference implementation of JSTL 1.2?!?  Oh brother.  Thanks to <a title="Tomcat6 depends on Glassfish?!?" href="http://www.mularien.com/blog/2008/02/19/tutorial-how-to-set-up-tomcat-6-to-work-with-jstl-12/">Peter Mularien for writing a nice post</a> informing me of this.</p>
<p>As if needing to download and install glassfish in order to get the JSTL 1.2 implementation jars for Tomcat6 wasn&#8217;t bad enough, well I hit a couple more snags after that.  First of all, I want to know who decided on the namespaces for JSTL 1.1 vs 1.2.  Here they are:</p>
<p>1.0  == &lt;%@taglib prefix=&#8221;c&#8221; uri=&#8221;http://java.sun.com/jsp/core&#8221; %&gt;</p>
<p>1.1 &amp; 1.2 ==&lt;%@taglib prefix=&#8221;c&#8221; uri=&#8221;http://java.sun.com/jsp/jstl/core&#8221; %&gt;</p>
<p>I mean all they did was add the &#8220;jstl&#8221; into the path?!?  I&#8217;m supposed to remember this?  OK &#8211; I&#8217;ll try harder to remember for next time.</p>
<p>Then, I learned that Maven2 doesn&#8217;t copy &#8220;system&#8221; provided jars into WEB-INF/lib by default and they need to be placed there manually as part of the project.  So, the appserv-jstl.jar I copied from glassfish wasn&#8217;t being included because I linked Maven to it as a system ( vs provided, or compile, or test, etc&#8230; ) dependency.</p>
]]></content:encoded>
			<wfw:commentRss>http://javatech.org/2009/02/a-conventionally-annotated-configuration-spring-hibernate-eclipse/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
