Matt RaibleMatt Raible is a Web Developer and Java Champion. Connect with him on LinkedIn.

The Angular Mini-Book The Angular Mini-Book is a guide to getting started with Angular. You'll learn how to develop a bare-bones application, test it, and deploy it. Then you'll move on to adding Bootstrap, Angular Material, continuous integration, and authentication.

Spring Boot is a popular framework for building REST APIs. You'll learn how to integrate Angular with Spring Boot and use security best practices like HTTPS and a content security policy.

For book updates, follow @angular_book on Twitter.

The JHipster Mini-Book The JHipster Mini-Book is a guide to getting started with hip technologies today: Angular, Bootstrap, and Spring Boot. All of these frameworks are wrapped up in an easy-to-use project called JHipster.

This book shows you how to build an app with JHipster, and guides you through the plethora of tools, techniques and options you can use. Furthermore, it explains the UI and API building blocks so you understand the underpinnings of your great application.

For book updates, follow @jhipster-book on Twitter.

10+ YEARS


Over 10 years ago, I wrote my first blog post. Since then, I've authored books, had kids, traveled the world, found Trish and blogged about it all.

Busy Weekend

I was planning on taking this weekend off to let my left arm heal a bit. Furthermore, Julie and Holly headed up to Steamboat for some skiing and it was "Daddy Weekend". While the kids and I had a lot of fun, I was unable to overcome my addiction to work.

Saturday night I finally managed to get AppFuse running under CruiseControl. Previously, I'd always run into OOM exceptions before the 10-12 minute process of testing a particular flavor. This seems to be due to Ant and the copying of 700 files 3-4 times makes it run out of memory. For each web framework, the basic install is tested, then tested again with AppGen, and finally iBATIS is installed and tested. While the tests all run and report pass/failed correctly, the memory is so close to being maxed that e-mail cannot be sent, and half the time the webapp isn't viewable. Nevertheless, the process keeps on humming. To see the build status for each different AppFuse flavor, see http://home.raibledesigns.com:8080. Having you all click on this link should crash CruiseControl for sure. ;-)

Last night, I got caught up with working on the appfuse.org website. Rather than having a splash page, I changed it to use frames to wrap the java.net homepage, as well as other AppFuse sites. The top navigation should allow you to navigate to java.net, the wiki, demos and JIRA w/o having to type in new URLs. The fun part of this exercise was using CSS to hide images and compress the standard java.net header. If you'd like to do this for your java.net project, add the following to your www/project_tools.html page:

<style type="text/css">
    .topline, .topbar { border: 0 }
    #banner { height: 0px }
    #banner img { display: none; }
</style>

This week should be a pretty good one. I'm working full-time on finishing up AppFuse 1.9.1, and I hope to have it released before this weekend. My parents are coming into town on Thursday night, so that's my deadline. If I don't have everything done by then, I'll probably release anyway. For the full plan of attack for 1.9.1, please see The road to 1.9.1.

If I can finish the AppFuse release this week, I can work on Spring Live next week. After that, I'm booked up with client work for quite some time. So wish me luck, I'll be burning the midnight oil most of this week.

Finally, it was nice to see that many of you bought into my April Fools joke. While it wasn't as good as last year, I still had fun writing it. As some noted, it's not that unbelievable. However, the part about me dropping something for another is out of character. I changed my major 3 times in college, but never dropped the previous ones. For the record, I like Rails and I've been promoting it at Virtuas and SourceBeat. We've talked about starting a Rails practice, but (to be honest) haven't seen a whole lot of demand from clients. Hopefully that will change in the future and virtuas.com/rails will get filled in.

Posted in Java at Apr 03 2006, 04:09:19 PM MDT 1 Comment

Done with AppFuse, moving to Ruby on Rails

Ruby on Rails For the last few weeks, I've been building an application with Ruby on Rails. While I enjoy its simplicity and the ability to get things done quickly, the thing I really like is there's a whole team of developers supporting this framework. If I develop an application with AppFuse, chances are I'll find a bug or two, and then I'll have to spend additional time that night fixing it. Furthermore, I'm beginning to loath the compile/deploy cycle that AppFuse requires you to do.

As a result of my experience with Rails, and my decision to use it for all future web development, it makes no sense for me to keep maintaining AppFuse. Virtuas has decided to start a Rails Practice and I'm going to be the Practice Leader for it. In addition, I'll be writing a "Rails Live" book for SourceBeat. Hopefully we'll have an ERP out for that by the end of this summer.

If you live near Denver, have a lot of experience with Spring, and are interested in becoming the Spring Practice Leader for Virtuas, please let me know.

Posted in Java at Apr 01 2006, 09:56:12 AM MST 14 Comments

Tapestry 4.0 support in AppFuse's CVS

I spent the last couple of days upgrading AppFuse from Tapestry 3.0.3 to Tapestry 4.0.1. While the integration isn't as clean as I'd like it to be, everything works and all tests pass, so that's good. I did post a few remaining issues to the Tapestry mailing list, but there's nothing major. While the upgrade was frustrating (it took me 4 hours to figure out I needed "validators" instead of "validator"), I feel I know a fair bit more about Tapestry now. Furthermore, my experience on the Tapestry user mailing list was incredible. Yesterday, for every question I'd send, I'd get 2-3 replies in a matter of minutes. It was like having my own personal Tapestry consultant by my side. It goes to show that Tapestry is a thriving community, with a lot of folks willing to help out. Thanks guys - I really appreciate the help.

Update: You can view the FishEye Changelog to see what the upgrade entailed.

Posted in Java at Mar 31 2006, 05:49:25 PM MST 7 Comments

Carpal Tunnel

Anatomy of the Hand Every month or so, after working a long-ass week, my left arm usually starts hurting as if I have carpal tunnel. Usually, I go get a massage and it feels better the next day, or a few days shortly after. The Massage Therapist always asks me if I've been diagnosed with carpal tunnel, to which I reply "No." They also ask me if I have tingling in my hands or forearms, and I always tell them "No, I just get a dull pain in my forearms when I work a long week." So I've never really had carpal tunnel AFAIK, just symptoms every month or so.

That all changed this week. I started noticing the dull pain in my left forearm at TSSJS, and I started noticing the tingling in my left hand yesterday. I've never had tingling before. Furthermore, last week was a pretty light typing week (but I might've played cards too much ;-)). So now I'm worried; I'll probably get a massage this week and I have a chiropractor appointment next week. The only think I can think of that might be causing the tingling is: 1) riding my bike to work, or 2) the cheap-ass crappy keyboard I have at work.

I went to the Apple Store and CompUSA to get an ergonomic keyboard tonight, but had no luck. The Apple Store only sell the standard Apple keyboard and CompUSA only sells black Microsoft keyboards. The M$ keyboard's will work, but it seems wrong to hookup a Microsoft keyboard to a MacBook Pro with a cinema display. I have a meeting in South Denver tomorrow morning, so I'm going to stop by Micro Center. Hopefully they'll have something good.

Carpal Tunnel is a scary thing as a programming professional. It's one of the few things that can put you out of commission as a programmer. It looks like I'd better start taking it seriously if I want to keep slingin' code for the next 10 years.

Related: Carpal Tunnel in May 2004.

A Week Later: I went to a repetitive motion specialist yesterday. They said that hand surgeons hate them b/c they can solve most issues. They worked my left arm and hand, and expect everything to be better with a couple more treatments. It already feels a lot better, but I'm also doing stretches every hour - which helps a lot too.

Posted in General at Mar 28 2006, 09:25:53 PM MST 40 Comments

css.appfuse.org

It's almost the end of March and we've only received a couple entries for the CSS Framework Design Contest. In an effort to show what contest entries look like, I've developed and deployed an application to http://css.appfuse.org (login as an administrator with mraible/tomcat). This application utilizes the CSS Framework and has a few themes packaged with it. In addition, you can set it to use an external stylesheet to make development easier. The default theme and selectable themes are pretty ugly right now, so don't get your hopes up. The good news is this is a work-in-progress, so hopefully it'll get better soon.

The theme setup I'd like to use in AppFuse relies on loading a default.css from styles/themes/<theme name>. I've designated styles/default.css as a place to import the css-framework files, as well as specify rules for all themes. I'm open to alternative suggestions, but I think this is a good start.

I hope to evolve this application, along with the CSS Framework Design submissions to show what's possible with CSS in web applications - as well as provide a repository of downloadable themes. It's likely we won't ship the "CSS Selector" logic with AppFuse, but it should be easy to install one of these themes in your AppFuse-based application.

You'll notice that the themes currently available aren't working that well. I'm working with the authors to see what I need to fix. It's probably related to how I have things setup in the application. One of the things I discovered in this exercise is that CoolMenus isn't very CSS-friendly. It requires you modify JavaScript to change its positioning. I've left the menu in place for now, but I hope to replace it in the next few weeks with a more CSS-friendly version.

Since we've only received two theme submissions for the CSS Design Contest, I'm going to extend it to the end of April. Hopefully css.appfuse.org will encourage more participation. Any thoughts, comments or bug reports are most welcome.

Posted in The Web at Mar 27 2006, 10:56:12 PM MST 10 Comments

Back from Vegas

This weekend was one of my smoothest returns from Vegas in my life. It probably helped that Julie joined me there on Friday and we flew back together on Saturday. My BOF on Friday night was very well received and I heard a lot of positive comments about it afterwards. What do you expect when you give people free beer. ;-)

After the BOF, the Virtuas Crew had a kick-ass dinner at BOA Steakhouse in Caesar's. Before we were done, a college buddy of mine arrived in Vegas, so Julie and I met him at Harrah's for some blackjack and craps. We had an fun night of gambling with my buddy, who started with $5K at the first blackjack table. Apparently, Julie brought him luck and he ended up winning a few grand by the time the night was over. We had breakfast and walked back to Caesar's as the sun was coming up. We saw Gier and Hani catching cabs as we were walking in. 5 hours later, we'd had a good night's sleep and headed to the airport. We got sidetracked at Emeril's for lunch and enjoyed some good laughs with a couple friends before leaving.

When we got home last night, both kids had just fallen asleep. Of course, we wanted to wake them up, but also realized that sleeping children is quite a blessing. They were tickled to death when they woke up this morning and we were home. Today was a great day, and a big reason why it was so easy to transition from Vegas to Denver. The kids and I let Julie sleep in a little and took a stroller ride to the local bagel shop (a mere 3 blocks away) for a couple hours. It was a windy walk and we arrived home motivated to do some kite-flying at the park. We had fun at the park and it was super cute watching Abbie fly her first kite. After that, we headed to Dave & Buster's for lunch. Abbie never let me sit down because she wanted to play games the whole time. 2 hours later, we were on our way back home.

The day ended with Jack and I running errands. I needed to buy a new laptop backpack since mine got shredded in the wash a couple of weeks ago. We headed to Gart Sports, where I shopped and Jack stabbed stuff with a tent stake he found. He was like a hunter on the loose, crouching, jumping and yelling at stuff throughout the corner of the store we were in. It's a good thing no one else was around.

I ended up with the only backpack that could fit my laptop, which seems quite strange. I've been to the Apple Store, REI and Gart Sports and I've found the laptop backpack situation is abysmal. A couple of years ago, the selection was quite good. Oh well, I only paid $35 and I'll probably look for one online this week. The ideal backpack would have a built-in camelback and laptop holder (since I use it primarily when commuting on my bike).

After Garts, we headed to the Apple Store in Cherry Creek. I had to buy a new power cord for my MacBook Pro. I left mine in Vegas, possibly at the BOF. The Apple Store is pretty close to the "breakfast playground" - so I had to let Jack play in it. 15 minutes of jumping on eggs, waffles, climbing on bananas and sliding down bacon made Jack a very happy camper.

It's great to be home. AFAIK, I'm not travelling for a couple weeks, possibly more than a month. My next big trip is to The Ajax Experience and JavaOne in May. This week is supposed to be in the 60s, so I'm looking forward to a nice week of Colorado spring weather. With any luck, I'll get a signification amount done on both AppFuse and Spring Live this week. It might take a couple of late nights to make it happen, but I feel pretty motivated right now.

Posted in General at Mar 26 2006, 10:06:32 PM MST 1 Comment

[TSSJS] Java Web Frameworks Sweet Spots BOF

I've finished composing my "Java Web Framework Sweet Spots" document and presentation for tonight's BOF at TSSJS. Unfortunately, the BOF is at 6:30 and Crazy Bob's wedding is at 6. So I won't be able to make it to the wedding, but I do hope to have a toast to Bob and his new bride. I have been successful in securing beer for the BOF, so you'd better get their early if you want a free one. Caesar's doesn't have kegs, so it's $6/beer and we've purchased 100 of them for attendees. After that, it turns into a cash bar. Thanks to Virtuas, Codehaus, SourceBeat and yours truly for pitching in for the free booze.

My presentation tonight will be short and sweet. Rather than going through each framework author's responses, I'm just going to highlight their "sweet spot" responses. This allows me to get away with creating a measly 8-page presentation, as well as have a more interactive session. I've taken everyone's responses to the 6 questions I asked, and compiled them in a document. This document is available on the Virtuas site, just click on the link below to download it.

» View Java Web Framework Sweet Spots

Posted in Java at Mar 24 2006, 05:27:24 PM MST 28 Comments

[TSSJS] Apache Geronimo Prime Time with Jeff Genender

I'm sitting in Jeff's talk now, getting ready to listen to him ramble on about Geronimo. The room is about half full, and it's one of the smaller rooms. However, people are still streaming in, and it's the furthest room from the main conference area.

Jeff started his presentation with a little "Open Source Arcade" fun. The cartoon depicted a pac-man game with JBoss and Geronimo and resulted in a loud applause from the audience. This talk is going to cover Geronimo's architecture, how to use it, how to configure it, what it doesn't have and address common concerns.

Geronimo is a conglomeration of best-of-breed open source projects. Rather than reinventing the wheel, Geronimo embraces and reuses other open source projects: Axis, MX4J, ServiceMix, Spring, ActiveMQ, Jetty, Tomcat, Derby, Tranql, Apache Directory Server and OpenEJB. There's many others, but these are the headliners.

Geronimo is a carpet roll. Just like a carpet, it allows you to roll-your-own application server. Rather than using all the pieces of J2EE, you can just pick the ones you need? Currently, Geronimo ships with a collection of pre-configured assemblies: j2ee-tomcat-server, j2ee-jetty-server, minimal-tomcat-server and web-jms-tomcat-server. The last two will be available in the 1.1 release. The nickname for minimal-tomcat-server is "Little G".

Why another J2EE application server? Because J2EE is now a commodity. You used to have to spend a lot of money for J2EE servers. Now open source projects have commodotize J2EE and flattened the landscape. Also, the other application servers are LGPL and Geronimo is Apache Licensed, which is much more friendly to businesses.

Geronimo isn't just an application server, but also a top-level apache project with a healthy and active community. There are many other components coming out of this project, including:

  • The Geronimo API/Kernel/Assemblies/App Server
  • GBuild - Open Source Testing
  • DevTools - Eclipse Plugin for Geronimo Application Development with the Web Tools Platform (WTP)
  • J2EE Specifications - open source versions, eliminating the jta.jar problem you get with Maven. In my experience, most of these work, but Geronimo's javamail implementation doesn't work last time I tested it.
  • Home for OpenEJB, ActiveMQ, ServiceMix, Yoko (Corba) and XBean - all stand-alone sub-projects.

The Kernel of Geronimo *is* what is known as Geronimo. It controls the component (GBean) Lifecycle. A GBean is the Glue, the Wrapper, a Plugin to the Kernel. It conforms to JSR-77, the J2EE Management Specification and controls lifecycle, running states and naming conventions. The GBean architecture allows for simple development - you just need to implement the GBeanLifecycle, declare the GBean in a Plan (IoC) and deploy it. Plugging in 3rd party components is easy - for example Apache Directory and Quartz. Jeff wrote an article showing how to do this.

Jeff is now walking through the directory structure, which is pretty standard:

bin
config-store
deploy
docs
lib
repository (similar to Maven 1's structure)
schema
var

If you're familiar with Tomcat, Geronimo's "bin" directory is very similar. There's startup.sh/.bat, geronimo.sh and you can also use java -jar ./server.jar to start the server. Apparently, many of the scripts were copied from the Tomcat project.

Interestingly enough, my MacBook Pro's battery has been *much* more efficient today. I've been running for about 2.5 hours and the battery says it still has over an hour left. I believe this is largely because I've had my airport turned off most of the day.

Geronimo's Web Console is one of the nicer looking consoles I've seen for application servers. The user accounts for this are set in $GERONIMO_HOME/var/security/users.properties. It was donated by Abock (sp?) and I believe it's built on Pluto. For deploying applications, you can use the web console, drop WARs/EARs into the deployer directory or use the deployer tool (deployer.sh). When using the deployer tool, you'll need to have a plan file.

A plan file is an XML document (external or internal depending on nature of plan file). It's a descriptor to extend your application (setup JNDI DataSources, etc.) and similar to jboss-web.xml and weblogic.xml. Embedded examples: geronimo-application.xml, geronimo-web.xml, geronimo-ra.xml. For external plan files, you can use any name for the file. This file describes the GBean's attributes and references, as well as its dependencies. There are many different types of plans to describe information: web, application, resource adapters, security, naming references, EJB, schemas (in $GERONIMO_HOME/schemas directory).

The $GERONIMO_HOME/var/config/config.xml is Geronimo's central configuration file and allows you to override default values, as well as configure (or disable) GBeans. However, you can use the web console to configure everything in this file - and often it's much easier.

Now Jeff is going to do a demo of deploying and configuring Roller on Geronimo. This should be good, especially since he expects Murphy's Law, "if something can go wrong, it will", to come into play. He's showing us the plan file and how he had to hide a few classes, to prevent Geronimo's classes from conflicting. Jeff tried to show us how Geronimo allows you to download JDBC Drivers from w/in the console. Doh! We're in a conference room without an internet connection. Jeff had a backup plan and was able to successfully create a connection pool. After creating a security realm, he deployed roller.war and it all worked.

What Geronimo doesn't have? It lacks full clustering with respect to EJB/JNDI/Distributed cache. It *does* have full clustering with session replication and fail-over for the Tomcat web component, which fits 90% of clustering use cases. Uses Tomcat Clustering GBeans. Also, it can't run with Java 5 (only with 1.4.2) b/c the Corba component doesn't work with Java 5.

Now Jeff is doing Q&A, so I decided to try out my connecting to the Net via Bluetooth. It's actually pretty fast, GMail is surprisingly fast. From Bandwidth Speed Test, here are my results:

Communications: 87.1 kilobits per second
Storage: 10.6 kilobytes per second
1MB file download: 1.6 minutes
Subjective rating: Slow

Posted in Java at Mar 24 2006, 01:39:01 PM MST

[TSSJS] Friday Morning: RIFE and Seam

This is my 2nd day in Vegas and so far this town is treating me fairly well. I haven't lost all of my money, but the $25/hand blackjack tables haven't been kind. Yesterday, I woke up with a glass full of Berocca next to my bed - which means I passed out before drinking it. I needed it too, Matt Filios won a poker tourney and a bunch of us enjoyed "bottle table" (with Kettle One vodka) to celebrate. Spendy and good, but painful the next day.

Last night, I heard it was Crazy Bob's bachelor party, so I went to bed early to avoid the debauchery. Julie and a good friend of mine are flying in tonight, so there will be plenty of that this evening. So after a good night's sleep, I'm up early and attending the conference. The first hour has a lot of good sessions: Introduction to Seam (Gavin), Dive into RIFE (Geert), OSWorkflow (Hani) and Transforming Enterprise Java into a Commodity (Geir).

I'm sitting in Geert Bevin's session titled "Dive into RIFE" and it's a pretty small audience - maybe 20 people. Geert is the CTO of Uwyn, a small custom application development company. He's the founder of RIFE and creator of many RIFE projects: RIFE/Crud, RIFE/Jumpstart, RIFE/Continuations, Bamboo (forum), Bla-bla List (RIA todo list), Drone (Information bot) and Elephant (blog).

What is RIFE? It's a full-stack component framework to quickly and consistently develop and maintain Java web applications.

  • Integrated layers allow you to quickly get results with a minimal amount of code
  • Best practices are enforced in a pleasant way, providing many additional features and a consistent approach throughout all applications
  • Components can easily be resused in many contexts
  • Creating maintainable applications is our first goal
  • A lot of attention goes to code-level developer comfort
  • Frustration reduction by instant changes and reloads
  • Creative solutions for difficult problems
  • Embraces established standards (XHTML, HTTP, SQL, ...)
  • Geared to developing web applications and doesn't abstract away too much
  • Everything besides the web engine is designed to be independently usable
  • Attention to the whole life-cycle of your application

Geer is now talking about all the different pieces of RIFE - how it has a JDBC abstraction like Spring JDBC, web services support (even publishing of RSS Feeds) and a content management framework. Now we're going to look at RIFE/Jumpstart.

What is RIFE/Jumpstart? It's a source archive that you unzip and run. It makes it easy to start with new RIFE applications and contains everything you need (including Jetty). It has immediate support for more common development environments (X-develop, Netbeans, Eclipse, IDEA and Ant). Geert just showed us a video of getting started with Jumpstart and how you can easily use X-develop to build and deploy the app to Jetty. The Jumpstart application currently uses JUnit, but since the RIFE teams is starting to use TestNG more and more, it's likely they'll change in the near future. RIFE Jumpstart looks similar to AppFuse, except they have the save+reload problem solved - using JVM HotSwapping.

Now I've moved to the Introduction to Seam session. Gavin King is the presenter and the room is packed. It's a big room, so that's saying a lot. Gavin is talking about JSF, how backing beans work and what's in the faces-config.xml. How does Seam compare to J2EE? Much simpler code. There's fewer artifacts (no DTOs). Less noise (EJB boilerplate, Struts boilerplate). More transparent (no direct calls to HttpSession or HttpRequest). It's also much more powerful for complex problems.

JSF is amazingly flexible and extensive. EJB interceptors support a kind of "AOP lite" and EJB3 is a powerful ORM engine. Everything (except for the JSP pages) is unit testable can be tested with JUnit or TestNG. For testing the view layer, Gavin recommends using Selenium.

A backing bean is often "pure glue" and is just noise. Furthermore, it accounts for more LOC than any other component. It doesn't really decouple layers, in fact the couple is more coupled than it otherwise would be. Gavin calls this "wedding cake architecture." These applications look good in the window, but don't taste good when you eat them. I get his point, but have to disagree on the taste of wedding cake. It's always been good at the wedding's I've attended. ;-)

By default, web applications in general do not work in a multi-window application. To make it work, it generally requires a major architecture change. A couple of other areas for improvement in traditional web applications: application leaks memory (not cleaning up session objects) and "flow" is weakly defined. Navigation rules are totally ad hoc and difficult to visualize. How can this code be aware of the long-running business process?

JBoss Seam - what does it do? It unifies the EJB3 and JSF component models. It simplifies Java EE 5, filling a gap. In addition, it integrates jBPM and makes it more developer-friendly. Deprecate so-called stateless architecture. Decouple the technology from the execution environment. Run EJB3 apps in Tomcat or in TestNG or use Seam with JavaBeans and Hibernate. Gavin is using Tomcat for the first time and thinks it's hot-deploy architecture is totally broken. Of course, he usually uses JBoss and never has a problem with hot-deploy. It's interesting to hear this from Gavin, especially since I've heard from others that Hibernate breaks the reloading - and it's not the server's fault.

I'm going to head to another session now, but I did look ahead at some of Gavin's slides. Interestingly enough, the jPBM pageflow definition's XML looks quite similar to Spring Web Flow. Speaking of flows, I heard an interesting comments from someone yesterday after they attended Geert's continuations talk. Apparently, after seeing his talk, they think that RIFE's continuations offer a much more elegant solution to pageflow than these "XML programming" mechanisms.

I tried to go to Hani's OSWorkflow talk, but he was doing Q&A when I walked in. Apparently, he finished 25 minutes early. Then I walked into Geir's talk only to find Dan Deiphouse finishing up an XFire talk. Oh well, there's nothing wrong with having a few minutes to mingle between talks.

Posted in Java at Mar 24 2006, 11:56:30 AM MST 7 Comments

Using JasperReports with AppFuse and Spring MVC

JasperReports LogoIt's been over a year since Gilberto wrote a message to the mailing list about how to use JasperReports with AppFuse's Spring MVC flavor. Now he's created a tutorial for how to use JasperReports in AppFuse. Thanks Gilberto!

I've seen a fair amount of howtos for Spring MVC + JasperReports. I've even written one myself as part of Chapter 6.5 in Spring Live. However, I haven't seen many articles detailing how to integrate JasperReports with other Java web frameworks. Are they out there and I'm just not seeing them? It'd be great if we could show how to integrate JasperReports with all the web frameworks that AppFuse supports.

Posted in Java at Mar 22 2006, 07:46:58 AM MST 6 Comments