tag:blogger.com,1999:blog-44577813823446709692023-12-15T04:09:34.276-07:00Chris Maki's BlogChris Makihttp://www.blogger.com/profile/16510702653624658586noreply@blogger.comBlogger34125tag:blogger.com,1999:blog-4457781382344670969.post-33435725145397215462009-06-01T09:57:00.003-06:002009-09-11T19:32:42.713-06:00CommunityOne first impressions<div><div>I arrive about an hour before CommunityOne officially started, there wasn't as much buzz in the air as years past, I remember CommunityOne 2006, it seemed to be something more exciting than this year. </div><div>
</div><div>Once I got checked in, I swung by the OSTK booth, we have a booth this year at JavaOne, only to find that the company that was to have custom panels installed hadn't done it yet. I hope it's all good by this afternoon.</div><div>
</div><div>I'm now at the general session for CommunityOne, it's in the main conference hall, where the JavaOne general session is held, except this year, the room is turned sideways, much wider and not as deep. I like this format better, everyone can feel closer to the stage. BTW, I'm in the second row, right behind the Sun executives. I wonder how this will compare to <a href="http://developer.apple.com/WWDC/">WWDC</a> next week.</div><div>
</div><div>First up is Dave Douglas, SVP of Cloud Computing @ SUN. He is talking about how his team is new, only been together for about a year. Then he touched on the changes since last year, aka: Oracle bought us :-) Instead he is talking about the economy, Obama, etc. There is a new book coming out Citizen Engineering, looks like the cover of Mythical Man Month. Dave is now talking about 20th Century initiatives vs. 21st Century, top down vs. community based. Sounds a lot like what Thomas Friedman discusses in the World is Flat (great book btw). Dave's challenge, think about "what can I do to help". A little plug for OpenOffice, "available in 80 languages btw, more than Office".</div><div>
</div><div>Sun has a campus ambassador program at hundreds of campuses around the world. On the stage four students, we all speak "open source" around the world. There goes the Brazil cheer from the audience. "We are at an important time with community, we need to take this ideas and spread them out". Up next is cloud computing.</div><div>
</div><div>Lew Tucker, Sun Cloud CTO. Cloud computing is everywhere, the government is even looking into using this. With a credit card and a few minutes you can have your own computer network. The economics of cloud computing are very attractive, you can turn it on and then turn it off. If you are a start-up, or any company, you can quickly and cheaply have your infrastructure up and running. Two main parts of Cloud Computing, Compute Service and Storage Service, in the middle is open APIs and Services. Lew is using a Mac and Safari for his demo. Lew is showing a drag and drop network configuration tool to set up your cloud computing infrastructure, looks great. The idea is any developer can setup their own cloud so they have the infrastructure you need. The idea behind what Dave and Lew are showing is how an individual can create and manage a large scale system without the need for your own data center.</div><div>
</div><div>Not to bead a dead horse, but all this cloud computing infrastructure is enabling the flat world platform. To make more sense of this statement, you need to read Thomas Friedman's <a href="http://www.overstock.com/Books-Movies-Music-Games/The-World-Is-Flat/2536807/product.html?sec_iid=33969">The World is Flat</a>.</div><div>
</div><div>Dave is now talking about security, what does the cloud have for security. Sun has been working with Center for Internet Security on creating a secure virtual machine and today Sun deployed a secure virtual machine to Amazon. One of the biggest uses of the cloud is for a development and test environment. One open source community that has taken this idea to heart is Yahoo! and Hadoop. What used to run on a 1,000 machines and only be known by two scientists in the world is now available to you and me. BTW, the Yahoo Hadoop cloud has 4,000 nodes.</div><div>
</div><div>Up next is opensolaris. At least Sun has a sense of humor, the lead of opensolaris is pretending to be a news anchor, very funny. He's also using this to give us an update on how opensolaris is being used. They are now talking about <a href="http://www.sun.com/bigadmin/content/dtrace/">DTrace</a> and how it's been around for about five years now and can help you analyze your application across all levels OS to application. Now we are talking about JavaFX and how easy it is. In just four lines of code, they were able to add reflection to a full-motion video (a clip of <a href="http://disney.go.com/disneypictures/up/">UP</a> btw).</div><div>
</div><div>How has virtualization changed networking? Traditionally, you have switches between the FW and the server, now SUN has created a virtual switch to virtually support virtual FWs and virtual Servers. They are now talking about xbow, pronounced cross-bow, and how you can define a virtual network on anything from your laptop (the demo we are seeing now) to your server grade systems. xbow lets you simulate how your system may work under different loads from a fully functional system to a constrained network load allowing you to test you environment in many different modes. Networking rewritten for the virtual environment. Networking has always been complex but with opensolaris, xbow, and DTrace you can really examine what's happening.</div><div>
</div><div><a href="http://en.wikipedia.org/wiki/ZFS">ZFS</a>, what is it? A discussion on what ZFS is and what it can do for you. ZFS takes away all the limits that were imposed on the file-system. They skipped the 64bit fs and went to a 128bit fs. They also showed one of the big features of ZFS, the ability to move through snapshots of your file-system over time.</div><div>
</div><div>Flash based storage is the first new storage technology in about 50 years. Not only does it support more io ops per second than a 15K HD, it takes less power. This is redefining the way storage is put together today. ZFS is the only file-system that supports flash storage natively.</div><div>
</div></div>Chris Makihttp://www.blogger.com/profile/16510702653624658586noreply@blogger.com1tag:blogger.com,1999:blog-4457781382344670969.post-19136486360935685622009-03-19T14:13:00.006-06:002009-03-19T15:40:40.538-06:00Maven Meet Up at Sonatype part IIBrian is now talking about Nexus. There are three types of repositories in Nexus:
<ul>
<li>Hosted - the repo lives on disk
</li><li>Proxy - this is a proxy to another repository
</li><li>Virtual - this allows you to convert between repository formats, say M1 is hosted, you can create a Virtual proxy that converts M1 to M2
</li></ul>
<br>
<p>
You can schedule tasks like cleaning up snapshots. There are RSS feeds for most of the things Nexus does so you know the state of your repo. It will download remote repo indexes. There is no database required for Nexus. Nexus provides a full set of REST APIs to all its features.
<br><p>
The only time you use a repository URL directly in Nexus is when you want to deploy an artifact. With staging & promotion you don't even need to use a repo URL to deploy your artifacts. Why have a stating & promotion strategy? What if you want to test something before actually release it? Enter Nexus stating & promotion. All release deployments occur against a single REST URL in Nexus. The URL can be set once in the corp-pom for all projects, regardless of repository. With templates you can define how Nexus creates this new stating repo. Currently, you can only stage your binary artifacts but not your site artifacts. If you stage something many times and decide only to keep the last build, you'll need to manually remove all but the last site's you generated (this assumes that you don't overwrite your existing site with each release). Since all of Nexus is controlled by REST URLs, you can build your own work flow to control when a repo is promoted or not.
<br><p>
Next up is procurement, how to control what artifacts are available to your projects. Procurement is effectively a firewall that separates the users from another repository (or repo group) in the system. By default, everything is denied.
<br><p>
Sonatype is planning on multiple versions of Nexus: Nexus (open source version, free), Nexus Pro, Nexus Enterprise (HA, Federation, etc.) and Nexus Compliance (legal, etc.).Chris Makihttp://www.blogger.com/profile/16510702653624658586noreply@blogger.com0tag:blogger.com,1999:blog-4457781382344670969.post-25985212689458641622009-03-19T10:14:00.006-06:002009-03-19T15:41:37.179-06:00Maven Meet Up at Sonatype part I<p>Maven 3.0 will be fixing what we've learned in Maven 1.0 and 2.0. Layered repository, at the command line there is really only one repo, but in an env like Eclipse there are many repositories, other projects, so Maven 3.0 will have the concept of layered repositories. Jason said they have a lot of integration tests to ensure the backwards compatibility of Maven 3.0 with Maven 2.0. Personally, I hope it goes better than the Maven 2.0.8 to Maven 2.0.9 transition.</p><p>Plugin extension points, something borrowed from Eclipse, plugins will have extension points. This way you can extend a plugin without having to hack it. Plugins will also be able to tell Maven, here are my output directories, this way in Eclipse Maven will not need to run all the plugins to get their generated source dirs. This would be a big improvement.</p><p>Mercury is the new repository and transport layer for Maven. Why Mercury? Maven 2 has inaccurate conflict resolution, based on custom graph walking algorithm, hard to replace, API is too complex. The resolution mechanism is too coupled to Plexus, cannot use it from other environments. Mercury is a general purpose library for artifact and repository management. ArtifactMetadata - artifact comprehension info, not only do you need GAV (GroupId, ArtifactId, Version) but you also need classifier, type, etc. Mercury repos can be local or remote, readable or read/write, this helps optimize Mercury. It also supports global exclusions.</p><p>Mercury has it's own metadata cache to cache metadata for remove repositories. The new transport layer is a Jetty client, supports connection multiplexing (NIO), concurrent connections, SSL support. Webtide added stream verification , proxy support and authentication.
</p><p>Oleg is now talking about Sonatype Proviso, a tool for updating binaries (e.g. Maven). Mercury Runner is a side project for Oleg, it gives you a way to run an application without defining a classpath.
Attribute based resolution, we don't just care about a JAR, or it's version, we actually want to know about it's quality, etc. Like this:
</p><pre>
<project>
...
<version>1.2</version>
...
<attributes>
<servletApi>3.0</servletApi>
<coverage:pmd>80</coverage:pmd>
<quality>alpha</quality>
</attributes>
...
<project>
</pre>
<pre>
<dependency>
<servletApi>[2.5,)</servletApi>
<coverage:pmd>[80,)</coverage:pmd>
</dependency>
</pre>Chris Makihttp://www.blogger.com/profile/16510702653624658586noreply@blogger.com0tag:blogger.com,1999:blog-4457781382344670969.post-23034233241625796692009-02-16T00:14:00.009-07:002009-02-16T00:34:58.723-07:00SLC Tattoo Convention 2009<p>On Saturday night, my <a href="http://madebynicole.blogspot.com/">wife</a> and I went to the SLC <a href="http://www.slctattoo.com/">Tattoo Convention</a>. It was a great way to spend Valentines day and Nicole said it was a great date. We saw a lot of amazing art and we were both inspired to spend more time on our art. As a result, I'm going to try and spend at least an hour a day for a year, or something close to that, on art.</p>
<br>
<p>My Dad was a professional artist and drawing was always a part of my childhood. That said, I haven't done much since. One of my boys loves to draw and he and I sometimes draw together, so I'm hoping he and my wife will join me on my 365 days of art.</p>
<br>
<p>So here it is, the first of at least 364 more drawings. I won't post them all here ;-)</p>
<br>
<p><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://farm4.static.flickr.com/3424/3283406221_b0e8b2512b.jpg?v=0"><img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 383px; height: 500px;" src="http://farm4.static.flickr.com/3424/3283406221_b0e8b2512b.jpg?v=0" border="0" alt="" /></a></p>Chris Makihttp://www.blogger.com/profile/16510702653624658586noreply@blogger.com0tag:blogger.com,1999:blog-4457781382344670969.post-63396161237375185592008-11-06T08:55:00.005-07:002008-11-12T09:39:29.016-07:00More Maven Best Practices @ ApacheCon by Brett Porter<div>Here are my notes from Brett's talk about Maven.</div><div>
</div><span class="Apple-style-span" style="font-size:large;"><span class="Apple-style-span" style="font-size:medium;">More Apache Maven Best Practices, </span></span>by Brett Porter
General Principles from last years presentation
<ul><li>Set up your environment in advance
</li><li>A repository manager is a must (e.g. Archiva)
</li><li>Keep your POM simple, write your build like you write code
</li><li>Keep the build portable
</li><li>Avoid hard coding
</li><li>Make artifacts portable and minimize resource filtering
</li><li>Keep db config out of the project
</li><li>Make sure the build is reproducible
</li><li>Lock down versions, lock down environmental variations (don't rely on getting the latest, use version numbers)
</li><li>Use the Enforcer plugin (<a href="http://maven.apache.org/plugins/maven-enforcer-plugin/">http://maven.apache.org/plugins/maven-enforcer-plugin/</a>)
</li><li>Use this plugin to ensure other modules do not use automatic versions like latest and latestRelease
</li><li>Release your project early and often</li></ul>Dependency Management
<ul><li>Transitive dependencies are a big part of Maven, however sometimes dependencies get messed up, use <span class="Apple-style-span" style="font-family:'courier new';">mvn dependency:tree</span> to analyze your dependencies.
</li><li>Use enforcer plugin to ban specific dependencies and then you can use global exclusions to keep that dependency out of the project
</li><li>Specify only what you need, specify scope, USE <span class="Apple-style-span" style="font-family:'courier new';">dependencyManagement</span>
</li><li>Use <span class="Apple-style-span" style="font-family:'courier new';">dependency:analyze</span>, find out what you're using but not declaring, find out what you're declaring but not using</li></ul>Integration Testing
<ul><li>Unfortunately, an afterthought in Maven 2.0.x, at least in lifecycle
</li><li>Tests in a separate module, tests in same project, you'll most likely need to use profiles
</li><li>In Maven, plugin ITs are in the project
</li><li>Using a separate project, most common pattern in Maven. If you're testing multiple modules put tests in another module
</li><li>create a parallel module, use the regular <span class="Apple-style-span" style="font-family:'courier new';">src/test/java</span> directory, add a dependency on the module being tested, you will typically put this in a profile to control when it's run (e.g. in your CI env)
</li><li>If you are testing in the same project (e.g. a plugin or framework example), use another source dir, like <span class="Apple-style-span" style="font-family:'courier new';">src/it</span> or use the <span class="Apple-style-span" style="font-family:'courier new';">src/test/java</span> path and exclude a package from the general test so they can be used during integration testing (this is the easiest approach)
</li></ul> Maven sites and reporting
<ul><li>There are two technologies working here, reporting and rendering, they are not the same thing!
</li><li>Site tips, avoid reports and documentation sites, some minimal project reports, like mailing lists, source repository may be relevant</li><li>use site inheritance, just like in your pom, you can break down the site.xml file, they sit along side your pom.xml file
</li><li>Use versioning in the URL
</li><li>Include release notes in the versioned usage documentation
</li><li>Report tips</li><ul><li>Set up what you'll use! Don't create reports with thousands of issues</li><li>It won't be used if, too much information or there is irrelevant information</li><li>Don't settle for the default settings</li></ul><li>Use active checks, not passive reports, fail the build
</li><li>Use profiles to control reports, you don't need to run the reports all the time</li></ul><div>Plugin Development
<ul><li>Sometimes it is easier to use a script for short, one-off, customizations, e.g. <span class="Apple-style-span" style="font-family:'courier new';">antrun</span> plugin, <span class="Apple-style-span" style="font-family:'courier new';">jruby</span>, <span class="Apple-style-span" style="font-family:'courier new';">groovy</span> plugin, etc.
</li><li>If you might use it twice, consider writing a plugin
</li><li>Writing a plugin isn't a big deal, you can write it in Java, Ruby, Groovy, etc.
</li><li>Write your functionality in components, with the Mojo as a "wrapper"
</li><li>Minimize Maven API dependencies and component exposure, e.g. use <span class="Apple-style-span" style="font-family:'courier new';">maven-artifact</span>, not <span class="Apple-style-span" style="font-family:'courier new';">maven-core</span> (be aware of your dependencies, only use what you need)
</li><li>Do as we say, not as we do. Maven fails to implement many of these practices in various projects. Maven commiters learned the hard way!
</li></ul><div>You can get Brett's slides <a href="http://us.apachecon.com/c/acus2008/sessions/50">here</a>.</div>
</div>
<br>Chris Makihttp://www.blogger.com/profile/16510702653624658586noreply@blogger.com3tag:blogger.com,1999:blog-4457781382344670969.post-69401569604271695912008-08-08T09:58:00.009-06:002008-08-10T10:57:47.111-06:00Seam and MavenA while back I <a href="http://cmaki.blogspot.com/2008/02/overstockcom-and-seam.html">mentioned</a> that I'd post a Maven project that would make building Seam applications with Maven a little easier. Here it is, I've got three projects actually. For the impatient, you can see all the projects over <a href="http://code.google.com/p/maven-additions/">here</a> on Google code.
The three projects I created are:<ol><li><b>basic-settings</b>, this is a parent pom project to define the JBoss repository, set your compiler to Java SE 5 (Maven defaults to Java SE 1.3), and sets some defaults for the Maven eclipse plugin.
<li><b>seam-dependencies</b> this project defines all your Seam dependencies. You will use this as a dependency in your Seam project. This defines the Hibernate and Seam JARs you need to get your Seam application working.
<li><b>seam-example</b> this is a sample application that uses both <b>basic-settings</b> and <b>seam-dependencies</b>, to illustrate how to put it all together. This application is a simplified version of the JPA-booking example that comes with Seam.</ol>These projects do not use Java EE in any way, so there isn't even a JBoss embedded dependency. My reason for doing this was to make building and deploying an application as easy as possible.
To get to the projects, you need to download the the source from my Google code project, which you can find <a href="http://code.google.com/p/maven-additions/">here</a>, once at the project page, click the "Project" tab and that will tell you how to check out the code. Now that you've got the code checked out, run <tt>mvn install</tt> for these projects:<ol><li>basic-settings<li>seam-dependencies</ol>With everything installed, you can try out the <b>seam-example</b> project. To run the project, use the Maven <a href="http://docs.codehaus.org/display/JETTY/Maven+Jetty+Plugin">Jetty</a> plugin, like this:<pre><code>cd seam-example
mvn jetty:run</code></pre>You can access the app from port 9090, using this URL: <a href="http://localhost:9090/seam-example">http://localhost:9090/seam-example</a>
I also did a Seam presentation at the <a href="http://www.ujug.org/web/content/view/111/1/">July</a> 2008 <a href="http://www.ujug.org">UJUG</a> meeting. You can see the presentation <a href="http://www.ujug.org/sponsors/Seamcolor.pdf">here</a>.Chris Makihttp://www.blogger.com/profile/16510702653624658586noreply@blogger.com10tag:blogger.com,1999:blog-4457781382344670969.post-28618016496098850012008-04-02T08:46:00.003-06:002008-04-02T13:46:33.508-06:00Accepted into the iPhone Developer ProgramI was surprised last night with an email from Apple letting me know that my application to join the <a href="http://developer.apple.com/iphone/program/">iPhone Developer Program</a> had been accepted.
I <a href="http://www.jroller.com/cmaki/entry/the_state_of_the_hibernate">started</a> my career as a NEXTSTEP developer so coming back to Mac OS X should be a lot of fun. I have a couple of ideas for iPhone apps, now if I could only change time like <a href="http://en.wikipedia.org/wiki/Energy_Policy_Act_of_2005#Change_to_daylight_saving_time">Dubya</a> and get 30 hours in a day :-)
Stay tuned, I'll post info on the apps I attempt to create here.Chris Makihttp://www.blogger.com/profile/16510702653624658586noreply@blogger.com5tag:blogger.com,1999:blog-4457781382344670969.post-49975375895590092902008-03-06T16:16:00.003-07:002008-03-06T16:25:56.448-07:00iPhone SDK now availableI totally forgot that today <a href="http://www.apple.com">Apple</a> had an iPhone event scheduled for today. I'm currently watching the session while I write this. I just signed up for the <a href="http://developer.apple.com/iphone">iPhone SDK</a> and cannot wait to get back into Objective-C. I used to be a NeXT (predecessor to Mac OS X) developer so seeing some of the familiar API's and language will be great.
The best part is the Exchange integration that will be coming in June, finally I will be able to get my work email on my iPhone (wait, is that something I really want?).
So are you going to build your own iPhone apps?
As I start to develop some apps, I'll post my experiences here asap.Chris Makihttp://www.blogger.com/profile/16510702653624658586noreply@blogger.com2tag:blogger.com,1999:blog-4457781382344670969.post-66715991854017342642008-03-02T20:46:00.003-07:002008-03-02T21:05:49.555-07:00JavaPosse Roundup 2008I'm off to the JavaPosse <a href="http://www.artima.com/weblogs/viewpost.jsp?thread=221098">Roundup 2008</a> tomorrow morning (Monday March 3, 2008). Three of us from Overstock.com are going together. It should be a real blast. Late last year, <a href="http://www.jamesward.org/wordpress/">James Ward</a> of Adobe came out to speak at the November <a href="http://www.ujug.org">UJUG</a> meeting about <a href="http://www.adobe.com/products/flex/">Flex</a>. After the meeting we were out at a local pub called, <a href="http://www.redrockbrewing.com/">Red Rock</a> and James said if there was one conference you were going to go to in 2008, the <a href="http://www.javaposse.com">Java Posse</a> Roundup 2008 should be it.
So I'll be there tomorrow afternoon, and cannot wait to meet everyone and to go skiing at <a href="http://www.skicb.com/">Crested Butte</a>.
I also put together a collection of past Posse episodes for the drive down, here they are:
<ul>
<li><a href="http://media.libsyn.com/media/dickwall/JavaPosse009.mp3">Episode 9</a>, interview with Josh Bloch
<li><a href="http://media.libsyn.com/media/dickwall/JavaPosse014.mp3">Episode 14</a>, interview with Jonathan Schwartz
<li><a href="http://media.libsyn.com/media/dickwall/JavaPosse025.mp3">Episode 25</a>, first episode with Joe Nuxoll
<li><a href="http://media.libsyn.com/media/dickwall/JavaPosse032.mp3">Episode 32</a>, interview with Gavin King
<li><a href="http://media.libsyn.com/media/dickwall/JavaPosse070.mp3">Episode 70</a>, interview with Brett Porter of Maven
<li><a href="http://media.libsyn.com/media/dickwall/JavaPosse099.5.mp3">Episode 99.5</a>, interview with Charles Nutter and Thomas Enebo (JRuby)
<li><a href="http://media.libsyn.com/media/dickwall/JavaPosse100.mp3">Episode 100</a>, the number says it all
<li><a href="http://media.libsyn.com/media/dickwall/JavaPosse107.mp3">Episode 107</a>, special from JavaPosse Roundup 2007
<li><a href="http://media.libsyn.com/media/dickwall/JavaPosse155.mp3">Episode 155</a>, interview with Martin Odersky (Scala)
</ul>
See you there!Chris Makihttp://www.blogger.com/profile/16510702653624658586noreply@blogger.com0tag:blogger.com,1999:blog-4457781382344670969.post-42410565022832435842008-03-02T20:08:00.000-07:002008-03-02T21:06:53.139-07:00Update on my dadA quick update on my dad. After having a <a href="http://cmaki.blogspot.com/2008/01/very-sad-day.html">stroke</a> on January 31, 2008, and a good family friend <a href="http://cmaki.blogspot.com/2008/02/goodbye-to-family-friend.html">passing away</a> a few days later, I'm happy to say that my dad has come home. After being in the hospital for about three weeks and catching the virus that caused the hospital to be locked down (meaning that he had no visitors for 10 days right after Bill K passed away), he was discharged because the virus had another breakout. Last weekend was a little scary, his blood sugar levels were way up, and his blood pressure was too high. My mom tried to reach a doctor but no one was available (the Canadian health care system for you).
My folks finally got to a doctor on Wednesday and it turns out that he had the wrong prescription for his diabetes. Once the prescription was straightened out, he started to feel better. It will take several weeks for him to really feel the full impact of the medication but I can hear it in his voice already. He is starting to do much better. One more good thing, he can talk like his old self, fortunately the stroke only affected his balance which he is working on correcting.
To everyone that contacted me, thank you very much for your thoughts, concerns, and comments.
Dad - its great to have you back home, I love you very much!Chris Makihttp://www.blogger.com/profile/16510702653624658586noreply@blogger.com8tag:blogger.com,1999:blog-4457781382344670969.post-79060976702592867922008-02-27T21:10:00.003-07:002008-02-27T21:40:18.098-07:00Guitar Hero III - Where have you been?For Christmas my wife and I got our family (we have three boys 11, 10, and 9) an <a href="http://www.xbox.com/ ">XBox 360</a>. But not any old XBox, the Halo 3 <a href="http://www.xbox.com/en-US/hardware/x/xbox360halo3console/default.htm">edition</a>. My 10 year old and I have been playing Halo for years (<a href="http://en.wikipedia.org/wiki/Halo:_Combat_Evolved">Halo</a> and <a href="http://en.wikipedia.org/wiki/Halo_2">Halo 2</a>), so getting the 360 late last year once <a href="http://www.halo3.com/">Halo 3</a> came out, seemed a no brainer. Since I'd been playing <a href="http://en.wikipedia.org/wiki/Half-Life_2">Half Life 2</a> for a while on our old <a href="http://en.wikipedia.org/wiki/Xbox">XBox</a>, my wife also got me the <a href="http://orange.half-life2.com/">Organge Box</a> for Christmas (great set of gifts btw, thanks honey).
I've always liked Halo but Half Life is a way more engaging game, the physics are better, you can interact with just about everything and the <a href="http://jin-saotome.deviantart.com/art/Half-Life-Gravity-Gun-74928646">gravity gun</a> is hard to beat. I also think the the story is way more interesting. However, for pure game play, not much else comes close to <a href="http://orange.half-life2.com/portal.html">Portal</a>, Valve's new game introduced as part of the Orange Box. So Christmas was great I played a lot of Half Life 2 and <a href="http://orange.half-life2.com/hl2ep1.html">Half Life 2 Episode One</a> (almost finished). Then it happened...
A couple of weeks back we were at our local <a href="http://www.bestbuy.com">Best Buy</a> and they had a pallet of <a href="http://www.guitarhero.com/">Guitar Hero III</a> wireless guitar and game bundles. We've been talking about getting <a href="http://www.rockband.com">Rock Band</a> so we could all play, but we thought we'd start with GH3 first. When we got home I started to play on easy to get the feel of the game and ended up almost finishing the solo-career game.
I'm not sure how to describe the experience you get playing the game but the first thing that came to mind was "this is the ultimate air guitar experience." If you've ever listened to your favorite song and wished you could play the guitar (I know, I should have learned to play the guitar, but I didn't and now I'm too lazy), then GH is for you. After playing for a couple of weeks, my wife started to play and it has been a blast. We are almost through the co-op career on Medium but <a href="http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewAlbum?i=162994173&id=162993934&s=143441">Knights of Cydonia</a> is kicking our ass!
So if you were wondering where the <a href="http://www.jboss.com/products/seam">Seam</a> Maven <a href="http://maven.apache.org/guides/introduction/introduction-to-archetypes.html">archetype</a> is, now you know, GH3 has taken all my free time, and what a great ride it's been.
BTW, now I find myself wishing all my favorite songs were in GH3. While driving to work I keep thinking, I want to play that on my plastic wireless guitar :-)Chris Makihttp://www.blogger.com/profile/16510702653624658586noreply@blogger.com0tag:blogger.com,1999:blog-4457781382344670969.post-87833786635909426942008-02-14T11:00:00.003-07:002008-02-14T20:47:57.168-07:00Overstock.com and SeamAs I mentioned a while <a href="http://cmaki.blogspot.com/2007/08/good-bye-consulting-hello-overstockcom.html">back</a>, I now work at <a href="http://www.overstock.com">Overstock.com</a>. One of the things I've been working on for a couple of months is bringing <a href="http://www.jboss.com/products/seam">JBoss Seam</a> to Overstock. First off, just to clarify where we are using Seam: We will not be using Seam for the public Overstock.com website, the one you might be familiar with <a href="http://www.overstock.com">here</a> however; we will be using it for internal application development.
This is a really exciting time for me at Overstock because I'm helping to usher in some new technologies like Seam and my other favorite open source project, <a href="http://maven.apache.org">Maven</a>. Since something like Seam is new to Overstock, I've had to put together some training courses, get "the seam <a href="http://www.michaelyuan.com/blog/seam-next-gen-web-framework/">Book</a>" and put together a Maven <a href="http://maven.apache.org/plugins/maven-archetype-plugin/">Archetype</a> to jump start projects.
Over the next couple of days, I'll be posting a working pom file (along with a download) you can use for your own Seam/Maven project. My efforts are based on Michael Yuan's <a href="http://www.michaelyuan.com/blog/2007/10/02/jboss-seam-project-setup-with-maven/">posts</a> <a href="http://www.michaelyuan.com/blog/2007/10/09/jboss-seam-project-setup-with-maven-—-part-2-ear-deployment/">about</a> Seam and Maven, with tweaks so you don't have to inherit from the Seam pom.
One last thing on the Seam front, in case you <a href="http://in.relation.to/8577.lace">missed</a> <a href="http://raibledesigns.com/rd/entry/leasons_learned_from_using_seam">it</a>, there is a new Seam <a href="http://seamframework.org">community site</a> now available. The best part of all is that it is built on Seam. If you cannot eat your own dog food than your framework sucks :-)Chris Makihttp://www.blogger.com/profile/16510702653624658586noreply@blogger.com2tag:blogger.com,1999:blog-4457781382344670969.post-50799880543532792982008-02-03T10:08:00.000-07:002008-02-04T20:08:46.060-07:00Goodbye to a family friendOn Thursday, January 31st my Dad, Bill Maki, and a <a href="http://cmaki.blogspot.com/2008/01/very-sad-day.html">stroke</a>. What I didn't know till later in the day was that a longtime family friend (45+ year and my Dad's best friend, Bill Kapush (another Bill), was admitted to the hospital with chest pain. There is only one hospital in my home town and they were down the hall from one another. The next day, Friday February 1st, while still in the hospital, in the care of a nurse and in mid sentence, Bill Kapush put his head down and died!
I couldn't believe it, on Wednesday, January 30th, Bill Kapush, Bill Maki, and my mom were having dinner together and everything seemed okay. Two days later and my dad has had several strokes, has been diagnosed with dimensia and cannot talk too well and Bill Kapush is dead. My dad and Bill had stated to talk to one another every day for the last few years, it was part of their routine, another change my dad will have to make.
I'd like to offer my condolences to the Kapush family, I know it was a big shock to all of you and my thoughts and prayers are with you.
If you live near your parents, why don't you drop by and say hi, if you don't live near them call them today to say hi, or better still let them know you love them, you never know how fast life can change everything.Chris Makihttp://www.blogger.com/profile/16510702653624658586noreply@blogger.com0tag:blogger.com,1999:blog-4457781382344670969.post-55385666986435443552008-01-31T16:09:00.000-07:002008-01-31T16:23:44.908-07:00A very sad dayUnlike my usual posts, this one is not technical in nature. I've had a really rough day and wanted to record it so I could look back and remember how things went.
So today is my birthday, another year older and probably the scariest day of my life so far. This morning around 8:30 my folks called to wish me a happy birthday and when I talked to my dad (who is 76 btw) I noticed he was having a real hard time talking, then he started to slur, at that point I realized something was up. My mom took my dad to the ER and it turns out that he had had a <a href="http://en.wikipedia.org/wiki/Stroke">stroke</a>, a couple perhaps. Unfortunately, there was worse news, he has <a href="http://en.wikipedia.org/wiki/Dementia">dementia</a>. I guess this explains why my mom has beens saying for a while that my dad is forgetting things, not aware of what's happening, etc.
I think the scariest thing, for me at least, is talking to him. He doesn't sound like my dad, and when he talks I just want to hug him and make it better (I guess that's what happens when you yourself are a dad). It seems that he isn't really aware of his diagnosis, so maybe that is a good thing.
So have you had a loved one that has gone through this? If so, how did you handle it? What did your family do, did they gather around one another or stay away?
I was planning on going to my home town tonight but my mom asked me not to, to give them a few days to work it out.
Dad - if you read this, I love you and hope you know what a great dad you are!Chris Makihttp://www.blogger.com/profile/16510702653624658586noreply@blogger.com3tag:blogger.com,1999:blog-4457781382344670969.post-89585507107354307642007-12-20T20:19:00.000-07:002007-12-20T20:27:10.083-07:00All Apple Fan, All Geek?So after reading <a href="http://raibledesigns.com/rd/entry/part_apple_fan_part_geek">Matt Raible's</a> post, I had to know how I measured up. So here it is:
<a href="http://www.justsayhi.com/bb/geek" style="text-decoration: none; background: url('http://assets.justsayhi.com/badges/910/161/geek_badge1_green.ipkdy5k321.jpg') no-repeat; display: block; width: 268px; height: 82px;"><span style="display: block; padding-left: 125px; padding-top: 28px; color: #000; font-family: Arial; font-size: 22px;">73% Geek</span></a>
<a href="http://www.justsayhi.com/bb/apple_addiction" style="color: #80A9DD; text-decoration: none; display: block; width: 286px; height: 128px; padding-top: 50px; padding-left: 17px; background: url(http://assets.justsayhi.com/badges/691/479/apple_addiction.ocopv3ot8f.jpg) no-repeat; font-family: Times New Roman, sans-serif; font-size: 30px;">89%<span style="display: none;">How Addicted to Apple Are You?</span></a>
For fun, my wife and I thought we'd see how we'll do in the pending <a href="http://www.justsayhi.com/bb/zombie">Zombie Apocalypse</a>, we got a 55% chance (I tried to copy the URL and reloaded the page, maybe I should re-evaluate my Geek percentage).Chris Makihttp://www.blogger.com/profile/16510702653624658586noreply@blogger.com2tag:blogger.com,1999:blog-4457781382344670969.post-58526204060683995092007-11-06T20:04:00.001-07:002007-11-06T20:19:10.259-07:00Rocky Mountain Software SymposiumI just finished uploading my slides for this weekends <a href="http://www.nofluffjuststuff.com/show_view.jsp?showId=110">Rocky Mountain Software Symposium</a> (aka NFJS Denver). I have two sessions, one on JPA and another on Maven 2.
<a href="http://www.nofluffjuststuff.com/show_topics.jsp?showId=110#speaker6749">Here</a> are my presentations. I hope to see you there.Chris Makihttp://www.blogger.com/profile/16510702653624658586noreply@blogger.com3tag:blogger.com,1999:blog-4457781382344670969.post-7642625042746040252007-11-05T12:44:00.000-07:002007-11-06T20:19:35.587-07:00Eclipse TipAre you tired of seeing all Java files in your Eclipse project showing this icon: <img src="http://help.eclipse.org/help31/topic/org.eclipse.jdt.doc.user/images/org.eclipse.jdt.ui/obj16/jcu_obj.png" /> Would you like to know if a Java file is an <a href="http://java.sun.com/j2se/1.5.0/docs/guide/language/enums.html">enum</a>, an Interface, or maybe an <a href="http://java.sun.com/j2se/1.5.0/docs/guide/language/annotations.html">annotation</a>? Just turn on the <i>Java Type Indicator</i> preference and your class icons will change from this:
<img src="http://www.rateyourwriting.com/without.png" />
to this:
<img src="http://www.rateyourwriting.com/with.png" />.
For detailed instructions on how to turn this preference on, check out this Eclipse <a href="http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse.jdt.doc.user/concepts/cjavaviews_decorators.htm">help</a> page.Chris Makihttp://www.blogger.com/profile/16510702653624658586noreply@blogger.com0tag:blogger.com,1999:blog-4457781382344670969.post-50025771008485791832007-10-28T22:46:00.001-06:002007-10-28T23:22:20.146-06:00Upgrade to Leopard, the story so farI was really looking forward to upgrading to Leopard today but I'm not sure if I'm happier now that it's all done. Apple is starting to do some really <a href="http://gizmodo.com/gadgets/screw-paper/apple-sets-two-iphone-limit-no-cash-accepted-315858.php">stupid</a> things lately. I've been a Apple/Next user/developer since 1992, eight years on Next and the last seven years on Apple. I have to ask, what the hell are they thinking? <b>No Java 6 support</b>, key bindings removed for Front Row, you cannot use an AirDisk with Time Machine, AirDisks don't work and so on.
I guess I'll have to see how things go over the next week or two, but I'm not going to install Leopard on any other mac in my house till things get better. On a similar note, I bought a Apple TV a few months back and returned it after two days. I've never been unhappy with an Apple product before, but this seems to be becoming a trend :-) I love my iPhone, but Apple's tendency to control every aspect of my computer is really starting to piss me off. BTW, wtf is up with Front Row, when I browse out of the "Music" section the music stops, Front Row 1.x didn't do this, it played music till you picked something else for it to play.
I'm going to watch a movie, I'm sure that will be more enjoyable than the last hour has been.Chris Makihttp://www.blogger.com/profile/16510702653624658586noreply@blogger.com0tag:blogger.com,1999:blog-4457781382344670969.post-14183730137050224422007-10-11T05:54:00.001-06:002008-03-12T07:50:10.347-06:00Getting Maven and Eclipse to work together to filter resourcesI don't really care for any of the <a href="http://www.eclipse.org/">Eclipse</a> plugins currently available for Maven (<a href="http://m2eclipse.codehaus.org/">m2eclipse</a> or <a href="http://code.google.com/p/q4e/">Q4E</a>), however I do like the Maven <a href="http://maven.apache.org/plugins/maven-eclipse-plugin/">plugin</a> for eclipse (it seems to be the only one that works). At <a href="http://www.overstock.com/">Overstock.com</a> everyone uses Eclipse, so as we are moving to Maven it is important that Maven work well in the IDE. Most folks checkout their code, develop and then check there code back into <a href="http://subversion.tigris.org/">svn</a> via Eclipse, never hitting the command line. Obviously, the Maven Eclipse plugin won't be good for them, so currently we are using m2eclipse for Eclipse/Maven integration. One of the problems I've been running into is filtering resources, I believe if you are using m2eclipse and you choose (from the popup menu) <tt>Maven -> Update Source Folders</tt> all your resources will be filtered (if you have filtering turned on in your <tt>pom.xm</tt>). I don't want to do that and folks will forget to do it, furthermore, since I do use the Maven Eclipse plugin (requiring the command line) and I don't use m2eclipse, this won't work for me. So how do you get Maven and Eclipse to work together?
This <a href="http://jira.codehaus.org/browse/MNGECLIPSE-343">feature request</a> for m2eclipse provides some pointers. Eugene suggests using a Maven build(er), but I cannot do that (because I'm not using m2ecilpse and I couldn't get it to work correctly when I tried), so I'll use a Program builder instead. In the <b>Package Explorer</b>, right click on your project and select properties, this brings up the <tt>Properties for xxx</tt> dialog box. In the list on the left, choose Builders, as shown in the image below (click on any of the images below for a larger version):
<a href="http://farm3.static.flickr.com/2237/1541445443_05b2f61b04_o.jpg"><img src="http://farm3.static.flickr.com/2125/1541445095_36ea97f882_o.jpg"/></a>
Next, click the <tt>New...</tt> button and choose the Program builder:
<a href="http://farm3.static.flickr.com/2026/1542307598_88e28037ae_o.jpg"><img src="http://farm3.static.flickr.com/2354/1541445257_336f2cf0f6.jpg?v=0"/></a>
In the <tt>Properties for New_Builder (1)</tt> dialog box, use the <tt>Browse File System...</tt> button to locate your copy of the mvn executable. For the <tt>Working Directory</tt> section, click the <tt>Browse Workspace...</tt> button and select your project. For the <tt>Arguments</tt> section add the following: <pre><tt>resources:resources resources:testResources</tt></pre> Here is how the dialog should look like so far:
<a href="http://farm3.static.flickr.com/2261/1541445879_2dcc255088_o.jpg"><img src="http://farm3.static.flickr.com/2032/1542306928_9d4ded4f92_o.jpg"/></a>
To finish things off, select the <tt>Build Options</tt> tab at the top of the <tt>Properties for New_Build (1)</tt> dialog box and make sure the <tt>During auto builds</tt> check box is selected (actually you want all check boxes under <tt>Run the builder</tt> to be checked except for <tt>During a "Clean"</tt>). Next select the <tt>Specify working set of relevant resources</tt> check box and then click <tt>Specify Resources...</tt>. In the dialog box that pops up, navigate to your <tt>src/main/resources</tt> and <tt>src/test/resources</tt> folders and click the check box to the left so these folders are included in your working set, click <tt>Finish</tt>. Here is what the <tt>Build Options</tt> tab should look like:
<a href="http://farm3.static.flickr.com/2098/1542347942_cba7b29525_o.jpg"><img src="http://farm3.static.flickr.com/2376/1542347734_12f30e00b1.jpg?v=0"/></a>
That's it, now when you refresh your workspace, try to run a unit test, etc. all your resources are filtered just as if you were doing it from the command line.
If you have a way to do this correctly with m2eclipse or Q4E please let me know.
<b>Update:</b> you may want to add the <tt>-o</tt> command line switch for Maven so that it doesn't try to look for JARs to download. You will want to add <tt>-o</tt> to the <tt>resources:resources...</tt> code above.
<b>Update 2:</b> If you are using the m2eclipse plugin, check out <a href="http://www.jroller.com/eu/entry/maven_resource_filtering">Eugene Kuleshov's response</a> to this post. Also, if you decide to keep using an external builder, you'll want to make sure the <tt>"Refresh resources upon completion."</tt> check box is selected on the <tt>Refresh</tt> tab of the builder dialog box.
<b>Update 3/12/08:</b> In the "Build Options" section above you'll need to select all options under "Run the builder", so that it runs both during and after a clean. Also, I no longer use the m2eclipse builder, I only use a Program Builder.Chris Makihttp://www.blogger.com/profile/16510702653624658586noreply@blogger.com13tag:blogger.com,1999:blog-4457781382344670969.post-49280253829520330662007-10-10T09:07:00.000-06:002007-10-10T09:18:23.127-06:00Welcome to the Twilight ZoneSince I'm caught up on the latest <a href="http://www.javaposse.com">Java Posse</a> episode, I thought I'd listen to the <a href="http://www.alpine-usa.com/US-en/products/product.php?model=iDA-X001">radio</a> on my way into work today. It turns out my <a href="http://www.kcpw.org">local</a> NPR station just started it's fall membership drive. After about five minutes of listening, one of the local sponsor's (a car dealership) joked about programming everyone's car radios to always tune to an NPR station. Laughing, I decided to switch stations, well guess what? Every station I turned to was NPR. No kidding, it was so bizarre that I had to call my wife to tell her. When I turned the radio back on, it was on another station. Then when I went back to NPR, all stations played NPR.
I'm not sure what was going on but it seems that my radio only wants NPR ;-)Chris Makihttp://www.blogger.com/profile/16510702653624658586noreply@blogger.com0tag:blogger.com,1999:blog-4457781382344670969.post-43646656947765346892007-09-28T09:52:00.000-06:002007-09-28T11:20:46.699-06:00Annotated JAXB ClassesOver the last week or so, I've started to use JAXB along with the <a href="http://www.restlet.org/">Restlet</a> framework. We are actively developing <a href="http://www.oreilly.com/catalog/9780596529260/">RESTful web services</a> here at <a href="http://www.overstock.com">Overstock.com</a>. So being new to the Restlet framework, I was eager to get started. One type of representation supported by Restlet is of course XML. To generate XML representations we are using <a href="http://jcp.org/en/jsr/detail?id=222">JAXB 2</a>. Being an <a href="http://www.theserverside.com/tt/articles/article.tss?l=JPAObjectModel">advocate</a> of <a href="http://www.theserverside.com/news/thread.tss?thread_id=46926#239918">annotations</a>, I thought I'd start with annotated <a href="http://chris-richardson.blog-city.com/">POJO's</a> and let the JAXB provider do the rest (I assumed this would be a lot like JPA). I ran into a problem however, trying to create a JAXBContext for my package, I got this error:<pre><code>WARNING: Problem creating Marshaller
javax.xml.bind.JAXBException: "com.overstock" doesnt contain ObjectFactory.class or jaxb.index</code></pre>It took me a while to figure out what went wrong. So now that I've got things working correctly, I thought I'd post this example and solution to hopefully save you some time.
Given this class:<pre><a name="line1"> 1</a> <span style="color:0000ff;"><strong>package com.overstock;</strong></span>
<a name="line2"> 2</a>
<a name="line3"> 3</a> <span style="color:0000ff;"><strong>import javax.xml.bind.annotation.XmlAccessType;</strong></span>
<a name="line4"> 4</a> <span style="color:0000ff;"><strong>import javax.xml.bind.annotation.XmlAccessorType;</strong></span>
<a name="line5"> 5</a> <span style="color:0000ff;"><strong>import javax.xml.bind.annotation.XmlElement;</strong></span>
<a name="line6"> 6</a> <span style="color:0000ff;"><strong>import javax.xml.bind.annotation.XmlRootElement;</strong></span>
<a name="line7"> 7</a>
<a name="line8"> 8</a> @<span style="color:#2040a0;">XmlRootElement</span><span style="color:4444FF;"><strong>(</strong></span><span style="color:#2040a0;">name</span><span style="color:4444FF;">=</span><span style="color:#008000;">"example"</span>, <span style="color:#2040a0;">namespace</span><span style="color:4444FF;">=</span><span style="color:#008000;">"http://overstock.com/example"</span><span style="color:4444FF;"><strong>)</strong></span>
<a name="line9"> 9</a> @<span style="color:#2040a0;">XmlAccessorType</span><span style="color:4444FF;"><strong>(</strong></span><span style="color:#2040a0;">XmlAccessType</span>.<span style="color:#2040a0;">FIELD</span><span style="color:4444FF;"><strong>)</strong></span>
<a name="line10">10</a> <strong>public</strong> <strong>class</strong> <span style="color:#2040a0;">ExampleJaxbClass</span> <span style="color:4444FF;"><strong>{</strong></span>
<a name="line11">11</a>
<a name="line12">12</a> @<span style="color:#2040a0;">XmlElement</span><span style="color:4444FF;"><strong>(</strong></span><span style="color:#2040a0;">required</span><span style="color:4444FF;">=</span><strong>true</strong><span style="color:4444FF;"><strong>)</strong></span>
<a name="line13">13</a> <strong>private</strong> <span style="color:#2040a0;">String</span> <span style="color:#2040a0;">elementOne</span><span style="color:4444FF;">;</span>
<a name="line14">14</a> <strong>private</strong> <span style="color:#2040a0;">String</span> <span style="color:#2040a0;">elementTwo</span><span style="color:4444FF;">;</span>
<a name="line15">15</a>
<a name="line16">16</a> <strong>protected</strong> <span style="color:#2040a0;">ExampleJaxbClass</span><span style="color:4444FF;"><strong>(</strong></span><span style="color:4444FF;"><strong>)</strong></span> <span style="color:4444FF;"><strong>{</strong></span>
<a name="line17">17</a> <strong>super</strong><span style="color:4444FF;"><strong>(</strong></span><span style="color:4444FF;"><strong>)</strong></span><span style="color:4444FF;">;</span>
<a name="line18">18</a> <span style="color:4444FF;"><strong>}</strong></span>
<a name="line19">19</a>
<a name="line20">20</a> <strong>public</strong> <span style="color:#2040a0;">String</span> <span style="color:#2040a0;">getElementOne</span><span style="color:4444FF;"><strong>(</strong></span><span style="color:4444FF;"><strong>)</strong></span> <span style="color:4444FF;"><strong>{</strong></span>
<a name="line21">21</a> <strong>return</strong> <span style="color:#2040a0;">elementOne</span><span style="color:4444FF;">;</span>
<a name="line22">22</a> <span style="color:4444FF;"><strong>}</strong></span>
<a name="line23">23</a> <strong>public</strong> <strong>void</strong> <span style="color:#2040a0;">setElementOne</span><span style="color:4444FF;"><strong>(</strong></span><span style="color:#2040a0;">String</span> <span style="color:#2040a0;">elementOne</span><span style="color:4444FF;"><strong>)</strong></span> <span style="color:4444FF;"><strong>{</strong></span>
<a name="line24">24</a> <strong>this</strong>.<span style="color:#2040a0;">elementOne</span> <span style="color:4444FF;">=</span> <span style="color:#2040a0;">elementOne</span><span style="color:4444FF;">;</span>
<a name="line25">25</a> <span style="color:4444FF;"><strong>}</strong></span>
<a name="line26">26</a> <strong>public</strong> <span style="color:#2040a0;">String</span> <span style="color:#2040a0;">getElementTwo</span><span style="color:4444FF;"><strong>(</strong></span><span style="color:4444FF;"><strong>)</strong></span> <span style="color:4444FF;"><strong>{</strong></span>
<a name="line27">27</a> <strong>return</strong> <span style="color:#2040a0;">elementTwo</span><span style="color:4444FF;">;</span>
<a name="line28">28</a> <span style="color:4444FF;"><strong>}</strong></span>
<a name="line29">29</a> <strong>public</strong> <strong>void</strong> <span style="color:#2040a0;">setElementTwo</span><span style="color:4444FF;"><strong>(</strong></span><span style="color:#2040a0;">String</span> <span style="color:#2040a0;">elementTwo</span><span style="color:4444FF;"><strong>)</strong></span> <span style="color:4444FF;"><strong>{</strong></span>
<a name="line30">30</a> <strong>this</strong>.<span style="color:#2040a0;">elementTwo</span> <span style="color:4444FF;">=</span> <span style="color:#2040a0;">elementTwo</span><span style="color:4444FF;">;</span>
<a name="line31">31</a> <span style="color:4444FF;"><strong>}</strong></span>
<a name="line32">32</a> <span style="color:4444FF;"><strong>}</strong></span></pre>You can easily convert it to XML via the <code>javax.xml.bind.Marshaller</code> class, like this:<pre><a name="line1"> 1</a> <strong>public</strong> <strong>class</strong> <span style="color:#2040a0;">ExampleTest</span> <span style="color:4444FF;"><strong>{</strong></span>
<a name="line2"> 2</a>
<a name="line3"> 3</a> @<span style="color:#2040a0;">Test</span>
<a name="line4"> 4</a> <strong>public</strong> <strong>void</strong> <span style="color:#2040a0;">generateXml</span><span style="color:4444FF;"><strong>(</strong></span><span style="color:4444FF;"><strong>)</strong></span> <strong>throws</strong> <span style="color:#2040a0;">JAXBException</span> <span style="color:4444FF;"><strong>{</strong></span>
<a name="line5"> 5</a> <span style="color:#2040a0;">ExampleJaxbClass</span> <span style="color:#2040a0;">ex</span> <span style="color:4444FF;">=</span> <strong>new</strong> <span style="color:#2040a0;">ExampleJaxbClass</span><span style="color:4444FF;"><strong>(</strong></span><span style="color:4444FF;"><strong>)</strong></span><span style="color:4444FF;">;</span>
<a name="line6"> 6</a> <span style="color:#2040a0;">ex</span>.<span style="color:#2040a0;">setElementOne</span><span style="color:4444FF;"><strong>(</strong></span><span style="color:#008000;">"first Element Value"</span><span style="color:4444FF;"><strong>)</strong></span><span style="color:4444FF;">;</span>
<a name="line7"> 7</a> <span style="color:#2040a0;">ex</span>.<span style="color:#2040a0;">setElementTwo</span><span style="color:4444FF;"><strong>(</strong></span><span style="color:#008000;">"second Element Value"</span><span style="color:4444FF;"><strong>)</strong></span><span style="color:4444FF;">;</span>
<a name="line8"> 8</a>
<a name="line9"> 9</a> <span style="color:#444444;">// Get a JAXB Context for the object we created above</span>
<a name="line10">10</a> <span style="color:#2040a0;">JAXBContext</span> <span style="color:#2040a0;">context</span> <span style="color:4444FF;">=</span> <span style="color:#2040a0;">JAXBContext</span>.<span style="color:#2040a0;">newInstance</span><span style="color:4444FF;"><strong>(</strong></span><span style="color:#2040a0;">ex</span>.<span style="color:#2040a0;">getClass</span><span style="color:4444FF;"><strong>(</strong></span><span style="color:4444FF;"><strong>)</strong></span><span style="color:4444FF;"><strong>)</strong></span><span style="color:4444FF;">;</span>
<a name="line11">11</a>
<a name="line12">12</a> <span style="color:#444444;">// To convert ex to XML, I need a JAXB Marshaller</span>
<a name="line13">13</a> <span style="color:#2040a0;">Marshaller</span> <span style="color:#2040a0;">marshaller</span> <span style="color:4444FF;">=</span> <span style="color:#2040a0;">context</span>.<span style="color:#2040a0;">createMarshaller</span><span style="color:4444FF;"><strong>(</strong></span><span style="color:4444FF;"><strong>)</strong></span><span style="color:4444FF;">;</span>
<a name="line14">14</a>
<a name="line15">15</a> <span style="color:#444444;">// Make the output pretty</span>
<a name="line16">16</a> <span style="color:#2040a0;">marshaller</span>.<span style="color:#2040a0;">setProperty</span><span style="color:4444FF;"><strong>(</strong></span><span style="color:#2040a0;">Marshaller</span>.<span style="color:#2040a0;">JAXB_FORMATTED_OUTPUT</span>, <strong>true</strong><span style="color:4444FF;"><strong>)</strong></span><span style="color:4444FF;">;</span>
<a name="line17">17</a> <span style="color:#2040a0;">StringWriter</span> <span style="color:#2040a0;">sw</span> <span style="color:4444FF;">=</span> <strong>new</strong> <span style="color:#2040a0;">StringWriter</span><span style="color:4444FF;"><strong>(</strong></span><span style="color:4444FF;"><strong>)</strong></span><span style="color:4444FF;">;</span>
<a name="line18">18</a>
<a name="line19">19</a> <span style="color:#444444;">// marshall the object to XML</span>
<a name="line20">20</a> <span style="color:#2040a0;">marshaller</span>.<span style="color:#2040a0;">marshal</span><span style="color:4444FF;"><strong>(</strong></span><span style="color:#2040a0;">ex</span>, <span style="color:#2040a0;">sw</span><span style="color:4444FF;"><strong>)</strong></span><span style="color:4444FF;">;</span>
<a name="line21">21</a>
<a name="line22">22</a> <span style="color:#444444;">// print it out for this example</span>
<a name="line23">23</a> <span style="color:#2040a0;">System</span>.<span style="color:#2040a0;">out</span>.<span style="color:#2040a0;">println</span><span style="color:4444FF;"><strong>(</strong></span><span style="color:#2040a0;">sw</span>.<span style="color:#2040a0;">toString</span><span style="color:4444FF;"><strong>(</strong></span><span style="color:4444FF;"><strong>)</strong></span><span style="color:4444FF;"><strong>)</strong></span><span style="color:4444FF;">;</span>
<a name="line24">24</a> <span style="color:4444FF;"><strong>}</strong></span>
<a name="line25">25</a> <span style="color:4444FF;"><strong>}</strong></span></pre><div>Here is the XML generated by the annotations above:<pre><code><?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns2:example xmlns:ns2="http://overstock.com/example">
<elementOne>first Element Value</elementOne>
<elementTwo>second Element Value</elementTwo>
</ns2:example></code><pre></pre></pre></div><div>Now for the problem. To create a marshaller, you first need to create a <code>JAXBContext</code> via its <code>newInstance()</code> factory method. You can create a context for a specific JAXB class, as in the example above, or you can create a context for a list of packages (check out the javadoc <a href="http://java.sun.com/webservices/docs/1.6/api/javax/xml/bind/JAXBContext.html">page</a> for more). When using the Restlet class <code>JaxbRepresentation</code> (only available in Restlet 1.1m1), it uses the package version of <code>newInstance()</code>, that's when I got my error above. I didn't want to create an <code>ObjectFactory </code>(apparently this is another way to get around the above error), at least not yet if I could help it, so I wanted to get some more info on the <code>jaxb.index</code> file. I couldn't find out much, I even looked at the JSR-222 <a href="http://jcp.org/aboutJava/communityprocess/mrel/jsr222/index.html">spec</a>. Well, it turns out that all you need to do is add class names to the file and place the file in the package (directory) where your JAXB annotated classes reside (it's similar in one way to a jpa persistence.xml file but without the xml). Here is the content of my <code>jaxb.index</code> file for the example class above:</div><pre><code>ExampleJaxbClass</code></pre>As you can see, its just the class name, not the fully qualified name (the package name is determined by the directory you placed the file in) or the <code>.class</code> name.
If you want to test this out, we need to slightly change the test above. Modify line 10 in the unit test above to look like this:
<pre><span style="color:#2040a0;">JAXBContext</span> <span style="color:#2040a0;">context</span> <span style="color:4444FF;">=</span> <span style="color:#2040a0;">JAXBContext</span>.<span style="color:#2040a0;">newInstance</span><span style="color:4444FF;"><strong>(</strong></span><span style="color:#2040a0;">ex</span>.<span style="color:#2040a0;">getClass</span><span style="color:4444FF;"><strong>(</strong></span><span style="color:4444FF;"><strong>)</strong></span>.<span style="color:#2040a0;">getPackage</span><span style="color:4444FF;"><strong>(</strong></span><span style="color:4444FF;"><strong>)</strong></span>.<span style="color:#2040a0;">getName</span><span style="color:4444FF;"><strong>(</strong></span><span style="color:4444FF;"><strong>)</strong></span><span style="color:4444FF;"><strong>)</strong></span><span style="color:4444FF;">;</span></pre>
If the package <code>com.overstock</code> does not have <code>jaxb.index</code> file, this change will cause the test to throw the <code>JAXBException</code>. Add the file and everything works great.
If you know where there is good documentation on this let me know I couldn't find any :-)
<div>
</div><div>Code formatting courtesy of <a href="http://www.palfrader.org/code2html/code2html.html">Code2HTML</a>.</div>Chris Makihttp://www.blogger.com/profile/16510702653624658586noreply@blogger.com22tag:blogger.com,1999:blog-4457781382344670969.post-10319983864014251922007-09-14T22:00:00.000-06:002007-09-16T12:17:51.209-06:00Goodbye consulting, hello Overstock.comIt would have been much better if I'd posted this month's ago but I've been so busy with work and the <a href="http://www.ujug.org/">UJUG</a> (Utah Java User Group) that I haven't had much time to blog. I'm hopping this will change from today onward.
So my first bit of news is that after being a consultant for most of the last eight years or so I've finally decided to take a full-time job with <a href="http://www.overstock.com/">Overstock.com</a>. I actually started back in April of this year, so I've been there for a while now. I must say that I'm having more fun at Overstock.com than I've had in years. That is part of the reason I haven't been blogging, my day job is so satisfying that when I get home I don't need to challenge myself with something interesting, I get to do interesting stuff all day long.
I'm hoping to start blogging a little more often (like more than every two months) and talk a little bit about what we are doing, from a technology standpoint that is.
On another note, I just finished an article on JPA for <a href="http://www.theserverside.com/">TheServerSide.com</a>. I think it will be posted on Tuesday of next week (Sept. 18th). If you are interested in looking at the source, you can check out the project page <a href="http://www.rateyourwriting.com/maven2/site">here</a>.Chris Makihttp://www.blogger.com/profile/16510702653624658586noreply@blogger.com7tag:blogger.com,1999:blog-4457781382344670969.post-87137003742645278292007-07-20T05:04:00.000-06:002007-07-31T14:29:24.553-06:00Salsa and the iPhoneOn Tuesday my wife and I (along with our three boys) went out for dinner. At some point my wife asked what time it was, so I reached down, grabbed my mobile phone (<a href="http://direct.motorola.com/hellomoto/slvr/">SLVR</a>) and much to my surprise, it slipped out of my hands and right into the salsa in front of me. Once I cleaned it off, I told my wife it was 6 PM or something. Then I realized that the USB port was full of salsa. I cleaned it out the best I could and hoped that I hadn't toasted another phone (the last time I had a <a href="http://www.sonyericsson.com/spg.jsp?cc=us&lc=en&ver=4000&template=ps1_1_2_3&zone=ps&lm=ps1&pid=9932">"cool"</a> phone was about three years ago and that one was washed with the rest of my clothes about a week after I got it). When we got home, I plugged it in and let it charge all night. The next day, around 9 AM or so, I started to get the low-batter warning. Around 10 AM, it shut off. Another phone, gone.
Joking around I said, now it's time for an iPhone. After talking with my wife for a while I realized that it would be really cool to get an iPhone. After all, I was now phoneless (never mind the beaten up, featureless one I had at home). A quick run down to our local <a href="http://www.apple.com/retail/thegateway/week/20070729.html">Apple store</a>, and I had an 8GB iPhone.
<img src="http://images.apple.com/iphone/images/contentfooter_activation20070625.png"/>Chris Makihttp://www.blogger.com/profile/16510702653624658586noreply@blogger.com1tag:blogger.com,1999:blog-4457781382344670969.post-87413137286005950722007-07-13T22:12:00.000-06:002007-07-15T13:22:07.063-06:00I was on the Java Posse?<img hspace="10" align="left" src="http://groups.google.com/group/javaposse/icon?v=2&pfb=do"/>I was really surprised last week wen I was listening to the <a href="http://javaposse.com/"> Java Posse</a> and who are they interviewing at the java.net booth? <a href="http://java.sun.com/community/usergroups/">Java User Group</a> folks, and low and behold there I am. Check out <a href="http://javaposse.com/index.php?post_id=228551 ">episode #129</a> at the 39:29 mark to hear about the <a href="http://www.ujug.org">Utah Java User Group</a>.
BTW, if you don't already listen to the Posse, I'd highly recommend it, it's a great source for the latest news and interviews with the who's who of the Java community.Chris Makihttp://www.blogger.com/profile/16510702653624658586noreply@blogger.com0tag:blogger.com,1999:blog-4457781382344670969.post-27304033351358308212007-06-12T07:55:00.000-06:002007-06-12T08:24:21.634-06:00Safari 3.0 Public BetaAfter hearing about the various <a href="http://www.apple.com/macosx/leopard/">Mac OS X Leopard</a> announcements, I was happy to see a public beat for <a href="http://www.apple.com/safari/">Safari</a>. I downloaded it yesterday and started to play around with it. I was really surprised, it is a lot faster than Safari 2.x. Not only is it faster, but I cannot live without the new inline find feature - it is so cool. Yes Firefox has had this for years, but not as usable as Safari's implementation. As a longtime <a href="http://www.gnu.org/software/emacs/">emacs</a> user, I've always liked inline searching way more than the popup finder window most applications have.
If you haven't tried out the new Safari yet, I'd suggest you give it a try. If you are a windows user, have you tried it yet? The closest I get to windows is <a href="http://www.parallels.com/en/products/desktop/">Parallels</a> on my mac and I try to avoid that if possible too.
Oh yeah, Apple also fixed the annoying quit "feature" where Safari would just quit, no matter how many windows you had open, if you hit apple-q (or Safari->Quit Safair). Again, another Firefox feature but a welcome addition nonetheless.
Go windows? Let me know how Safari performs.
<b>Update</b>: I just installed Safari in Windows via Parallels, and to my surprise not only did Safari get installed but so did <a href="http://www.apple.com/macosx/upgrade/softwareupdates.html">Software Update</a>. Wow, Software Update is an integral part of Mac OS X. Does this mean that Apple is starting to take over the Windows desktop? What do you think?Chris Makihttp://www.blogger.com/profile/16510702653624658586noreply@blogger.com0