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.
You searched this site for "appfuse". 771 entries found.

You can also try this same search on Google.

Fixing your java.net project's homepage

If you're hosting your open source project at java.net, you might be annoyed by the fact that you can't disable the forums or issue tracker. The forums pretty much suck, mainly because there's no "remember me" on the site and it's a pain to click 3 times just to answer someone's question. They also don't have the ability to quote a previous message. In addition to the less-than-adequate forums, the issue tracker doesn't hold a candle to JIRA.

For the longest time, I've been wanting to remove both the "Discussion forums" and "Project issues" links from the AppFuse homepage. I asked the java.net folks, and they didn't have a solution. Finally, I thought of one on my own.

In case you didn't know - you can create a project_tools.html file in your project's www directory - which allows you to append items to the menu on the left site. Add a little JavaScript action and you can manipulate or remove items as well. Here's what I'm using to remove the link for the Discussion forums, as well as change the Project issues to point to JIRA. If you find any issues with this script, please let me know.

<script type="text/javascript">

function replaceLinks() {
    try {
        var tools = document.getElementById("projecttools");
        var links = tools.getElementsByTagName("a");
        for (i=0; i < links.length; i++) {
            if (links[i].getAttribute("href").indexOf("ProjectIssues") > -1) {
                links[i].setAttribute("href", "http://issues.appfuse.org/browse/APF");
                links[i].innerHTML="JIRA Issue Tracker";
            }

            if (links[i].getAttribute("href").indexOf("ProjectForumView") > -1) {
                links[i].parentNode.style.display = "none";
            }
        }
    } catch (e) {}
}

window.onload=replaceLinks;
</script>

Related: AppFuse and Equinox get some FishEye lovin'.

Posted in Java at Jul 29 2005, 02:39:36 PM MDT Add a Comment

Site Status

Last weekend's crash made me change a few things on this site - all for the better. Instead of having a single server for hosting the AppFuse Wiki, there's now a read-only mirror at http://appfuse.org/wiki. Keith (of KGB Internet) has been kind enough to setup an rsynch cron that synchronizes from raibledesigns.com daily.

As part of the "fixing", I upgraded Roller and JSPWiki. Roller's search is still broken for the most part, but it seems to be due to some orphaned records, which I can hopefully fix soon. When upgrading JSPWiki, I broke the print as HTML feature, which I hope to fix today.

Last, but not least, I've enabled Roller's Planet feature. If you have a blog where you talk about AppFuse or it's related technologies, let me know and I'll add you. As far as contributing to Roller, I'm ashamed to admit that I haven't committed any code in months (maybe even a year). Integrating Acegi Security has been on my todo list for a couple of months now - and I hope to find some time soon. Unfortunately, life, AppFuse and Spring Live keep getting in the way. ;-)

5 minutes later: Print as HTML is fixed.

Posted in Roller at Jul 29 2005, 10:29:02 AM MDT 1 Comment

OSCON: Next week in Portland

I'm starting to get pretty pumped about OSCON next week in Portland. Unlike the rest of the conferences I attend, this one is close to home. My parents live in Salem, Oregon - which is a mere 40 miles south of Portland. I spent my last two years of high school in Salem, so I still have a few friends in the area too. To get the most out of the trip, I'm flying into Portland on Sunday and commuting from Salem to Portland for the first couple days.

On Monday, I'm going to do a Ruby-immersion day and spend it listening to Dave Thomas and David Heinemeier Hansson. I hope to come out of these sessions with enough knowledge to write a webapp in Rails. Since I'm aspiring to be an open source web frameworks expert, instead of Just Java - this seems like a good fit. In the next few months, I plan on learning more about Rails, as well as other open source web frameworks in general (any and all suggestions welcome).

Tuesday, I'm giving an AppFuse Tutorial and Wednesday I'll be duking it out with Matthew Porter. Other tutorials and sessions I hope to attend are Kathy Sierra's Creating Passionate Users, Joe Walnes' SiteMesh talk and I could probably stand to learn a bit more about Beehive.

Another reason this conference will be a lot of fun is because many of the SourceBeat Authors are attending. It's always a good time when you rendezvous with a bunch of smart developers. Last, but not least, if you're attending OSCON, you might want to check the New Sessions entry on O'Reilly's blog.

Posted in Java at Jul 28 2005, 11:53:56 AM MDT 12 Comments

Taming JSF 1.1

A couple weeks ago, I received an e-mail from Ray Davis of University of California, Berkeley. In the e-mail, he provided me a link to his team's Confluence Wiki - where he describes their experience and frustrations with JSF 1.1. I really like how Ray explains the problems they experienced, as well as how they fixed them. The "request thread" scope they created sounds similar to what Spring Web Flow does.

Our experience left us very happy with Spring, moderately happy with Hibernate, and not at all happy with JSF. We did manage to deliver a Pilot Gradebook that told us what we needed to know, but sacrificed reliability, consistency, and scalability to do so.

In January 2005, when we moved to full-time work on the official Sakai 2.0 Gradebook, JSF was our biggest concern.

It's a good read for those looking to jump into JSF. I think JSF 1.2 will solve a lot of problems, but who knows how long it will take to get a RI and MyFaces version of that.

Posted in Java at Jul 27 2005, 02:51:40 PM MDT 9 Comments

Tapestry 4.0 and AppFuse

It looks like someone might integrate Tapestry 4.0 into AppFuse before I get a chance. Now that Tapestry 4 has reached Beta 3, this seems like an excellent idea to me. My only request is to not make the initial Tapestry 4 integration depend on JDK 5. I plan to start working on AppFuse 2.0 in September and it would be nice to have Tapestry 4 in AppFuse 1.9 as well as 2.0. I'd love to start this next month, but I'm attending OSCON and working on Spring Live for most of the month.

P.S. The main reason I'm writing this post is to send a trackback to the developer who wants to do this work. I was unable to leave a comment on their site, nor find a contact e-mail address. ;-)

Posted in Java at Jul 26 2005, 05:33:08 PM MDT 1 Comment

Down all weekend - what happened?

Some of you might have noticed that this site was down all weekend. I didn't notice it until Saturday morning, at which point I was so beat from traveling last week that I didn't care. I tried to fix it for 5 minutes, then gave up figuring Keith (at KGB Internet) would be able to fix it. I sent him an e-mail asking for help - hoping he could kill a stray process or something. I didn't do any more investigating until Sunday - when it was still down. This site has been extremely stable for the last few months, so the fact that it all just stopped working really had (and still has) me puzzled.

I spent about an hour trying to get things to startup again, to no avail. The problem seemed to be related to the fact that the first time I'd try to hit Roller - it would peg the CPU and the number of database connections would start to skyrocket. Within seconds, the connection pool would become exhausted and Hibernate stack traces would begin to litter my logs. I spent hours doing this dance. At one point, I suspected a DOS attack - why else would the connections skyrocket for no reason?

While I was doing the site-fix dance, I created a read-only copy of the AppFuse Wiki at http://appfuse.org/wiki. When I tried to restart Tomcat on appfuse.org, I got stack traces from the JSPs. Upgrading to the latest stable release of JSPWiki (2.2.28) fixed the problem. However, when I'd start the "wiki" app, it would hang when I tried to request pages. Guessing that this was related to the data volume of pages (11.5 MB gzipped), I cleared out the wiki pages directory and started the wiki context with no data. That worked. I was then able to copy the pages back in and get everything back to normal.

Back to this site. I tried several things last night, including upgrading Roller to 1.2, upgrading Tomcat to 5.5.9 and upgrading the JDK to 5.0. Nothing worked, so I gave up and went to bed. This morning, I decided to try JDK 5 with Roller 1.2 and the instance of Tomcat (5.0.28) that's been working so well for the past few months. Still no dice. But I did manage to get the wiki to spit out the errors it did on appfuse.org. Remembering that this was caused by JDK 5, I went ahead and upgraded JSPWiki to 2.2.28 and did the empty directory dance to get the wiki started. Voila! - everything was fixed!

So that's my story. I still don't know the root cause, but I think the JDK 5 + JSPWiki 2.2.28 combination fixed the problem. I also suspect that something is different today than yesterday b/c the number of database connections didn't immediately spike like it did yesterday. I turned the search feature off as part of my site-fixing dance, so that's still off. I've been afraid to touch anything since I got it all working again. I'll try to turn it back on tonight. In the meantime, I need to figure out how to fix the startup problem with JSPWiki.

Update: I think I figured out the problem - particularly with JSPWiki. I was using JSPWiki's PageViewCountPlugin to track page hits. This file had grown to be just over 59 MB! Deleting the file allowed JSPWiki to start problem-free.

Posted in Roller at Jul 25 2005, 10:05:03 AM MDT 1 Comment

[DJUG] Building an Open Source ESB and Ruby on Rails

Managing Chaos
Building an Open Source Enterprise Service Bus from Scratch

Bruce Tate got rained out in Texas, so Bruce Snyder and Jeff Genender are talking about building an ESB with open source software. Bruce and Jeff created this product in the last project they were on. I was lucky enough to work with them on it the first half of this year - but only after the ESB was created. The final product was very stable and the client loved it.

Bruce is a Geronimo committer and one of the founders of the Castor project. Jeff is also a Geronimo guy and is currently working on a JBoss Live book for SourceBeat. The problem that the ESB was trying to solve was fixing a horrendous data flow. A lot of the data flow was occurring between people's PCs, shared drives, FTP servers, HTTP Servers, web servers - and rarely were things automated. Bruce recalls one of his first days when he heard the trading guys yelling at each other to "close the spreadsheet".

The solution to the problem was building an Enterprise Service Bus (ESB) that performed the following:

  • Centralized Management of Activities
  • Powerful Scheduler
  • Guaranteed Event and Activity Execution
  • Durable Transactions
  • Pluggable ESB Components for Activities
  • Staging Database for Single Common Data Location
  • Logging and Notification of Activities
  • Proactive Response to Failed Activities
  • J2EE Architecture - Provides for True 24/7 Uptime

The pluggable components were called transformers and were standalone JARs that lived on their own, but could be managed by the ESB. Notifications were key so the traders would be notified when something went wrong.

Architecture

Scheduler (Quartz) » Workflow (jBPM) » Persisted Guaranteed Messaging (JMS). JMS talked to Activities (a.k.a. transformers).

The Quartz Java Scheduler is an open source project from OpenSymphony. It's a persisted scheduling engine, so it'll live through app server restarts. It also has millisecond granularity.

For workflow, the Java Business Process Manager (jBPM) was used. It doesn't use BPEL, and was used to track multiple activities and make decisions based on an activity's completion or failure status. Other functionality included tracking the activity state (running, cancelled, completed) and sending/managing notifications. Workflow was very important because the previous system had no way of detecting where things failed in a process. With the new system, downstream dependencies were handled, the escalation path was based on success or failure - and automatic retry occurred on failures if the failure reason was a known and configured expectation.

For messaging, JMS was used - implemented with EJB and MDB. This provided guaranteed and persisted messages. Events were automatically recovered if the server failed.

Activities/Transformers were pluggable components (wrapped with EJBs for transactionality). The nice thing about using EJBs was it was easy to create JARs for each transformer, drop them into JBoss and they'd immediately become available.

The system was all managed with a management console, that was a webapp implemented in Struts, Spring and Hibernate. Most of the Spring and Hibernate classes and configuration was generated with Middlegen and XDoclet. The management console allowed you to kick off activities, monitor their progress, as well as manage users with Active Directory and single sign-on with NTLM and jCIFS.

Solution Facts

Since December 2004, over 200,000 jobs have been run through this system. Of those, 500K activities have been run, with < 10,000 failed activities (2% failure rate). Nearly all failures were due to external issues, such as unavailability of remote systems and databases, or source files not available.

Tools and APIs Used

When Jeff showed up, it was a Microsoft shop using ASP, Visual Studio and some PowerBuilder. They brought Jeff in to help them use and adopt open source. The first thing they did was install and begin to use CVS (previously source control was done on shared drives). They also used Maven to build everything and produce a project site - which the managers and C-types loved. One thing they mentioned is they often got questions from higher-ups like "How much does it cost?" They did have problems with Maven, but it was mainly due to the poor documentation. They found a lot of Maven solutions by cracking open plugins and looking at their Jelly files.

Development Lessons Learned

Configuring EJBs and MDBs as singletons helped solve some problems (a JBoss setting allows you to configure this). As for running Spring in a heavily-managed environment, they found that setting singleton="false" solved a lot of problems. The next problem they had was mixing Hibernate and JTA Transactions. No details, just that they had an interesting time and it took them a few days to get it working. The last problem they encountered was using Hibernate and/or Spring JDBC to manage hundreds of thousands of records. Since these O/R tools create objects for each record, OOM errors occurred with large resultsets.

Business Lessons Learned

All notification messages came from the ESB, leading many to believe the problem was the ESB - rather than the data sources it was talking to. By using open source, they saved the company $500K in licenses fees. The interesting part was the company had a 3rd-generation agreement with IBM, and owned $12 million worth of licenses for WebSphere and WSAD. The reason this group used open source was because there weren't enough licenses.

Bruce and Jeff's presentation was good, but they looked like a couple of goofballs standing up there in their t-shirts and shorts (standard Virtuas gear). I guess that's what happens when you get a 2-hour notice. The worst part about the presentation was the fact that the A/C doesn't work and it's about 85° in here. I told Geary he'd better keep in short or I'm outta here. ;-)

Ruby on Rails
David Geary

David got into Rails by reading an article called "Rolling with Rails". In the article, the author claimed that you can develop webapps in Rails at least 10 times faster than in Java. David responded to the article on his blog with an entry called the Ruby on Rails Koolaid. He experienced quite a butt-whooping from various folks, including Rails' founder - and realized afterwards that the claims might be valid. After working with Rails, David believes that Rails is probably 5-10 times faster.

Ruby

Potent mix of SmallTalk, Perl and Python. Everything is an object. No static type checking. Duck Typing (talks like a duck, walks like a duck, it probably is a duck). Testing usually solves the lack of static types. Blocks - like anonymous inner classes, but retain state. Mixins - a cheap way of doing multiple inheritance. Dynamic classes - can modify at runtime (add methods, renaming methods, etc.). Rails takes great advantage of the dynamic attributes as part of its framework.

David is now showing a ContactsController that has 5 methods for CRUDing a Contact object. 4 of the 5 methods are one-liners. It kinda reminds me of my Hibernate DAOs after integrating Spring. ;-)

Rails

Ruby-based MVC framework. Convention over configuration. Scaffolding - builds pieces of your application for you. ActiveRecord does O/R Mapping. Has a built-in testing framework. Near-zero configuration (no XML). Zero-second deploy time (development environment).

David's first demo is being done by audience member Kirk. David asked for a volunteer from the audience with MySQL experience, and the ability to type in a few commands. David said his 6-year old daughter was able to do this demo last night successfully - so Kirk's gonna look pretty bad if he can't pull it off. ;-)

Using scaffolding, Rails generates 1 controller, a test for it, a helper class, a css file and 5 rhtml templates. Kirk pulled off the demo, even though he had a bit of trouble with the Mac environment. This is a lot like AppFuse's AppGen in a sense - except AppGen has to parse a bunch of XML files and reconfigure them.

David keeps hammering that the most productive feature of Rails is that there is zero deploy time. Save. Refresh. It looks very similar to developing a static HTML site.

Rails has ActiveRecord, ActionPack (MVC), ActionMailer, ActionWebService, Ajax Support, Transactions and Security. Currently at version 0.13.1 - the last version before 1.0.

David is delivering an excellent presentation, but it's too damn hot without A/C - I'm outta here.

Posted in Java at Jul 13 2005, 11:03:46 PM MDT 6 Comments

Scaling with Rails

Whenever I talk to developers in the Java community about Rails, the first question out of their mouth is usually "But can it scale?" Today, David has written a nice post titled It's boring to scale with Ruby on Rails.

The one thing that I see time and time again is that Java developers don't seem to realize that some of the highest traffic sites on the net are using LAMP stacks similar to what Rails advocates. IMHO, I don't think "Rails can't scale" is a valid argument. In fact, I don't know if there's any argument or way to put down Rails anymore.

As a developer, my guess is the rates for programming in Ruby developer are less than for programming in Java (unless you're a Ruby Superstar of course), so that's one reason not to program in it. However, since Rails is one of those new bright and shiny things, chances are you might be able to get high rates for it. As far as Enterprise Adoption of Rails, unfortunately I think that's still pretty far on the horizon. I think the hardest part is convincing management that they'll be able to find developers to support it. Mind you, I didn't say good developers, just developers. Period. This is information I've gathered from talking to my Java developer friends.

Try convincing a Fortune 500 company to program in Rails vs. Struts and they'll probably choose Struts because there are thousands of Struts Developers. Is this a good decision on their part? I don't think so. I think it's more important to hire smart people that can learn a technology, rather than hiring those that know a technology. Of course, if someone knows a technology really well, there's probably no harm in hiring them.

I think Rails can become a real contender in the Enterprise if managers can be convinced that it'll be easy to maintain Rails application. Remember that most of software cost is maintenance. Because of this, the whole "it's super productive to develop with" doesn't matter so much - does it? Are Rails applications easy to maintain? My guess is yes, but how do you convince CTOs and CIOs? Another thing I think Rails needs for Enterprise Adoption is good tool support. Drag and Drop type of stuff. Why? Because management loves that stuff (because then they can develop apps) and it's a great sales tool. ASP.NET has been successful because of Visual Studio, not because of its ease-of-use and simple syntax.

Will I learn Rails and use it to develop applications? I certainly hope to, but it's hard enough convincing companies to use something other than Struts - so I don't know if I'll have much luck in selling Rails. The one cool thing about my new job at Virtuas is its an open source company, not just a Java open source company. This opens the doors for me to learn about Rails (and others) and compare them to Java Web Frameworks.

Update: Aaron Rustad has written an interesting article for DeveloperWorks that compares Rails to Struts+Hibernate: Ruby on Rails and J2EE: Is there room for both?

Posted in Java at Jul 12 2005, 08:45:26 AM MDT 28 Comments

How to be a better Trainer/Teacher

Kathy Sierra has a great post titled Ten Tips for New Trainers/Teachers. This hits home with me because because I've been doing a lot of training lately - and plan on doing a lot more in the future. I think she has a lot of great points, and I certainly plan on using her ideas as best I can. Luckily, I already use some of them - but I could certainly use some more, like group exercises and ditching slides in favor of more interactive sessions.

Here is a quick summary of this post:

Eleven Things to Know

  • Know the difference between "listening" and "learning".
  • Know how the brain makes decisions about what to pay attention to, and what to remember.
  • Know how to apply what you learned in #2. In other words, know how to get your learners to feel.
  • Know the wide variety of learning styles, and how to incorporate as many as possible into your learning experience.
  • Know the fundamentals of current learning theory!
  • Know why--and how--good advertising works.
  • Know why--and how--good stories work.
  • Know a little something about "the Socratic method". Know why it's far more important that you ask the good questions rather than supply all the answers.
  • Know why people often learn more from seeing the wrong thing than they do from seeing the right thing. Know why the brain spends far less time processing things that meet expectations, than it does on things that don't.
  • Know why it's just as important to study and keep up your teaching skills as it is to keep up your other professional skills. Yes there ARE professional organizations for trainers, with conferences, journals, and online discussions.
  • Know why using overhead slides to deliver a classroom learning experience can--sometimes (often)--be the worst thing you can do.
  • Know how -- and why -- good games can keep people involved and engaged for hours. Learn how to develop activities that lead to a Flow State.

Ten Tips for New Trainers

  • Keep lecture to the absolute minimum.
  • It is almost always far more important that your learners nail fewer subjects than be "exposed" to a wider range of subjects.
  • For classroom trainers, the greatest challenge you have is managing multiple skill and knowledge levels in the same classroom! Be prepared to deal with it.
  • Work hard to get everyone to complete the lab exercises, but NEVER give out the solutions in advance!
  • Do group exercises whenever possible, no matter what you've heard.
  • The best execises include an element of surprise and failure.
  • Leave your ego at the door. This is not about you.
  • Have a Quick Start and a Big Finish.
  • Try never to talk more than 10-15 minutes without doing something interactive. And saying, "Any questions?" does not count as interaction!
  • Don't assume that just because you said it, they got it. And don't assume that just because you said it five minutes ago, they remember it now.
  • If you're not passionate, don't expect any energy from your learners.

And most importantly: It's not about what YOU do... it's about how your learners feel about what THEY can do as a result of the learning experience you created and helped to deliver.

Good advice Kathy - and much appreciated. I'm doing a full week of training in San Francisco next week, followed by a tutorial on AppFuse (at OSCON) in early August - both should give me a nice stage to test these ideas.

As far as your classroom experiences - which ones have you enjoyed the most? What did the instructor do different? How have you been inspired by a training course?

Posted in Java at Jul 12 2005, 08:12:38 AM MDT 2 Comments

eXtremeTable - another table tag for sorting and paging

From the AppFuse mailing list and the Spring Forums, I learned about eXtremeTable. This JSP Tag looks similar to the Display Tag, except that it includes support for checkboxes and filtering columns out-of-the-box. If you've used this tag, please let me know how it's working for you.

eXtremeTable Demo

Posted in Java at Jul 11 2005, 07:33:47 AM MDT 26 Comments