Matt RaibleMatt Raible is a writer with a passion for software. 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 "java". 1,857 entries found.

You can also try this same search on Google.

Equinox: the name conflicts with an Eclipse project

I just received the following e-mail from an anonymous user via my contact page.

You might have already heard, but the Eclipse guys have started a new 
project also called Equinox, which is their implementation of the OSGi 
framework (which is my first choice for building modular enterprise apps 
these days).

http://www.eclipse.org/equinox

Not sure who had the name first, but I can see this getting more 
confusing as both products continue to gain mindshare and blog coverage.

First of all, I am aware of this thanks to Euxx. I don't know which project started first, but Google still seems to prefer mine over Eclipse's. Eclipse's Equinox project is #46 when searching for equinox, while mine is up to #9. ;-)

If I could think of a better name, I'd change. However, being #9 on Google makes it pretty tempting to keep the "Equinox" name.

Posted in Java at Nov 29 2005, 12:07:51 PM MST 5 Comments

Edit Java webapps Redux: Jetty Launcher and Equinox

A few weeks ago, I realized I was developing webapps the hard way, by re-deploying everytime I made a change. It's important to have a build process that can create a WAR and deploy, but it's also important to have a system where you can edit/save/view changes w/o ever deploying.

I spent some time this weekend working with Jetty Launcher, Eclipse 3.1 and the latest version of Equinox. Below are instructions on how to make the two work together. Once you've completed the steps below, you should be able to launch Jetty and edit/save Java files or JSP files in Equinox - and the changes will show up immediately in your webapp. No deployment or Ant/Maven interaction necessary.

I've tested this setup on Eclipse 3.1, using both OS X and Windows XP.

Step 1: Install Jetty and Launcher

Download and install Jetty. I tested 5.1.4 and 5.1.6 and both seem to work (6.0.0 Beta does not). In Eclipse, go to Help » Software Updates » Find and Install. Select Search for new features to install and click Next. Click on the New Remote Site button and enter "Jetty Launcher" for the name and "http://jettylauncher.sourceforge.net/updates" for the URL. Click OK, continue to download and restart your workspace.

Step 2: Install Equinox and create Eclipse project files

Download Equinox 1.5 beta 1 and extract to your workspace (I generally use c:\Source on Windows and /Users/${username}/dev on OS X). Download Maven 2.0, install it, and add $M2_HOME/bin to your $PATH. From the command line, cd into the equinox directory and type "mvn eclipse:eclipse". Get a cup of coffee or soda while you wait for Maven to download all the dependencies.

Once the project files have been created, open Eclipse and go to File » New » Project » Java Project. Click Next and type "equinox" in the Project name box. Click Finish to begin importing the project. You'll probably get an error like the following. Click OK to continue.

Eclipse Error

Click Next to continue (I had to click it a few times before it took me to the next screen). On the next screen (Define the Java build settings), select the web directory and click Configure inclusion and exclusion filters. Click the Add button for Exclusion patterns and enter "WEB-INF/classes/" (the trailing slash is important).

You're not done yet, now you need to define the M2_REPO variable that points to all the downloaded dependencies. Click the Libraries tab and then the "Add Variable" button as seen below.

Eclipse Error

Click the Configure Variables button and add a new one with a name of M2_REPO and Path of to your local Maven repository (/Users/${username}/.m2/repository on OS X and C:\Documents and Settings\${username}\.m2\repository on Windows). Click OK, Cancel and then Finish.

Step 3: Configure Jetty Launcher for Equinox

In Eclipse, go to Run » Debug and select Jetty Web in the Configurations panel. Click the New button. In the "Use Options" section, use "web" for the webapp root and (optionally) "/equinox" for the context name.

Jetty has issues running applications that use commons-logging, so you'll need to turn off all the INFO logging from the projects that Equinox uses. To do this, click on the Arguments tab and add the following to the list of VM arguments:

-DDEBUG -DDEBUG_PATTERNS=org.appfuse -DDEBUG_VERBOSE=-1

This can be placed on the line below the -Djetty.home argument. For more information on logging in Jetty, see the Jetty logging and debugging tutorial.

Step 4: Start Jetty in debug mode and modify to your hearts content

Click Apply and then Debug, and watch Jetty startup. If you go to http://localhost:8080/equinox/users.html in your browser, you should see a log message like the following:

11:44:25.855 DEBUG  [SocketListener0-1] org.appfuse.web.UserController.handleRequest
(UserController.java:24) >29> entering 'handleRequest' method...

You should be able to click on "UserController.java:24" to navigate to the UserController.java class. In this class, modify the log.debug(...) message, save the file and hit refresh on your browser. The console should spit out your updated log message. If it didn't, go to Window » Preferences » Workspace and make sure Build automatically is checked.

As far as I can tell, edit/save/refresh will work for .java and .jsp files, but not for .xml files. For that, the Jetty Launcher adds a Stop/Restart Jetty icon to your Eclipse toolbar. This setup seems to work great, except for the fact that you can't see when Jetty is done starting up in the console.

NOTE: I tried to get a similar setup working with the Tomcat Eclipse Plugin (v3.1 beta) and the Eclipse Web Tools Project (v0.7.1). Neither worked as smoothly, and the WTP wouldn't even deploy to Tomcat.

Posted in Java at Nov 28 2005, 11:58:15 AM MST 8 Comments

RE: WebWork joins Struts

From the struts-dev mailing list:

Between the Clarity hubbub and the Java Web Alignment brouhaha, it came up that WebWork would like to merge with another framework. Ted and Don followed up with the two core WebWork developers, Patrick Lightbody and Jason Carreira. As it turns out, they are very interested in merging WebWork with Struts. An archive of our discussions is available as a Quick Topic thread.

As some of you know, the underlying idea behind Ti was to use WebWork as the core of Struts Action Framework 2.x. Conceptually, WebWork and Struts 1.x are very similar. We've often said, without embarrassment, that WebWork does many things better than Struts 1.x. Meanwhile, WebWork has the ability to provide a layer of almost full backwards-compatibility for Struts 1.x, and we have already demonstrated we can integrate Beehive's (very cool) Page Flow with WebWork.

Patrick Lightbody:

Yes, it's true. The WebWork development team (Jason and I) have been working with the Struts development team (Don Brown and Ted Husted) and have come to the conclusion that the best thing for Java community would be to merge WebWork in to Struts.

Read Ted's email here, but the gist of it is this: WebWork is a great technology, and Struts is a great community. It's a perfect match and bringing the two together will only be better for WebWork and Struts users alike. The only down side for me is that I'll be working less with OpenSymphony, but I believe that is a small price for all the great benefits that come from this merger.
...
With this renewed energy, larger development team, and larger community, the combined efforts of Struts and WebWork will surely make the Struts platform the easiest, fastest, and most powerful Java web framework available. We hope that all the WebWork users and developers are as excited about this as we are and are ready to take WebWork to the next level.

IMO, this is good for both Struts and WebWork. WebWork gets the additional marketing it needs, and Struts users get a kick-ass framework to develop with. If you're a Struts user and haven't tried WebWork, prepare to be impressed. I was and still am.

I plan to upgrade AppFuse and Equinox to WebWork 2.2 as soon as its released. Hopefully I'll be able to migrate both the Struts and WebWork versions to SAF 2.0 w/in a few months.

Posted in Java at Nov 27 2005, 04:18:55 PM MST 4 Comments

Equinox 1.5 Beta 1 Released

This release is mainly to test out dependency downloading using Maven 2's Ant tasks. In addition, a few bugs have been fixed, but there's quite a few more on the roadmap. I plan to fix all of these before releasing 1.5 in a couple weeks.

Please test out this release if you have a chance. One of the nice things about using Maven 2's Ant Tasks, is you can download Maven 2 and generate your Eclipse or IDEA (possibly even Netbeans) project files using "mvn eclipse:eclipse" or "mvn idea:idea". You can also use Maven 2 to build and test things if you like. The only thing that doesn't currently work with Maven is the web tests with Cargo. I can try to get those working if there's enough demand. For now, you'll have to use Ant if you want to test the UI.

The download is much smaller now - barely over 1MB vs. ~20MB for 1.4. Most of the size comes from the Maven 2 Ant Tasks - which is a 869KB JAR. Of course, I could've made the distribution even smaller and required you to download the JAR and put it in $ANT_HOME/lib, but I decided to make things easier by including it.

For more information about installing the various options, see the README.txt file. Currently, you can use the following persistence frameworks:

  • Hibernate
  • iBatis
  • JDO (JPOX
  • OJB
  • Spring JDBC

And a number of web frameworks too, as listed below with links to demos.

Update: I forget to mention that I owe a big thanks to Carlos Sanchez. He (and the other Maven developers) have been great in helping to resolve all the issues I found with transitive dependencies.

Posted in Java at Nov 26 2005, 04:51:48 PM MST 4 Comments

Upgraded to Roller 2.0, Tomcat 5.5.12 and using Acegi Security

After a failed upgrade yesterday, I was able to successfully upgrade to Roller 2.0 today. The Editor UI is definitely nicer, and you can get a taste of it if you like by logging into my test user account. The username is "test" and password is "roller". You can also check out my planet page.

In addition to upgrading Roller, I upgraded Tomcat from 5.0.28 to 5.5.12 and everything seems to be humming along smoothly. I'm also running the Acegi integration patch for Roller instead of container-managed authentication. Hopefully this will help us identify any issues. I really like the Acegi integration so far, especially b/c the Remember Me stuff is checked at the root-level and I never have to click "Login" anymore. Good stuff.

Let me know if you see any issues.

Posted in Java at Nov 26 2005, 04:22:39 PM MST Add a Comment

Are you doing client-side validation in your JSF applications?

Are you doing client-side validation in your JSF application? I am in Equinox and AppFuse, but it seems somewhat primitive. I'm using David Geary's corejsf-validator.jar from his Core JSF book. It hooks into Commons Validator, and while it does work - it has some issues. First of all, if you have it in your classpath when testing, it screws up Ant-style path matching in Spring (applicationContext*.xml doesn't work). Secondly, it puts all the JavaScript validation functions right in your page, rather than in an external file that can be cached by your browser.

In reality, I believe that JSF should include client-side validation as part of the spec. After all, all of the other popular Java web frameworks support it. Then again, Rails is growing in popularity and AFAIK, it doesn't support it. In addition, the popular Java webapps I've seen (JIRA, Confluence, Jive Forums) don't use it either. I'm not trying to advocate that we should all be using client-side validation in our apps, I'm merely saying it should be an option in the standard web framework for Java.

The only public (and open source) option I've found is the Commons Validator support in Shale. Will this work in a MyFaces application w/o Shale? Are there other client-validation frameworks for JSF I don't know about? Or is the best option "don't use client-side validation with JSF?"

Posted in Java at Nov 24 2005, 09:02:39 AM MST 6 Comments

Clustering OSCache

For the past few days, I've been tuning and configuring OSCache in a clustered (WebLogic) environment. While setting it up was fairly easy, there was some fundamental concepts that took me a bit to figure out.

First of all, I chose to use JavaGroups instead of JMS. The primary reason behind this was it was easier to configure, but I also discovered that if you use JMS - you have to have a unique "cache.cluster.jms.node.name" property in your oscache.properties file on each server. This means to use OSCache with JMS, you have to build two different EARs. At least that's my impression. If you've figured out a better way to do this, please let me know.

In the application I'm working on, there are 4 different caches: one for Hibernate, and several other ones we've created with OSCache and Spring. For the past week, I developed a feature where we cache a user's account information across the cluster. The feature is more like an HttpSession than a cache b/c it's designed to replicate an authentication token (similar to a session id) across all the master servers.

After much head pounding, I discovered that OSCache doesn't update other nodes in a cluster for inserts and updates. It only broadcasts flushes. After understanding how OSCache works, it was much easier for me to code the solution (sans OSCache). If you'd like to see OSCache support replicating a cache across a cluster, vote for CACHE-96.

Posted in Java at Nov 23 2005, 01:05:44 PM MST 9 Comments

Lots of Java activity in San Francisco

The last 24 hours here in San Francisco have been quite interesting. Yesterday, I had lunch with a group of AppFuse users. They work for a company a few blocks from my training class. Chipotle was on the way, so I grabbed a burrito on my route and had a great time talking with them about the various open source tools that AppFuse uses, as well as what's on the roadmap. Thanks for the cookies John!

After class yesterday, I had a Guinness with an AppFuse user that recently put a high-volume site into production. He said it's held up surprisingly well and AppFuse greatly simplified his ability to deliver the project on time. In fact, most of the features the client wanted were already built-in.

Last night was another hotbed for Java talk - from web frameworks to TSSS in Vegas. Matt Filios and I had dinner and drinks with Mike "wanna play poker" Cannon-Brookes, Crazy Bob, Patrick Linskey, Geoff Hendrey (I hope I got the name right) and a number of other guys whose names escape me. It was Mike's birthday, so I left early to avoid the chaos that Crazy Bob and Mike always seem to stir up.

To top it all off, this morning I ran into a couple of folks that read this blog. I was getting breakfast at a local bagel shop - when a guy came up to me and asked "Is your name Matt"? I answered yes, and we talked briefly about my trip out here. It was kinda wierd being recognized, but kinda cool at the same time. It was good to meet you Nadeem.

I'm heading home from this wonderfully warm place tonight, but I'm sure I'll be back in the near future.

Posted in Java at Nov 18 2005, 12:00:57 PM MST 5 Comments

RE: Is Ajax gonna kill the web frameworks?

James is asking "Is Ajax gonna kill the web frameworks?" From my personal experience, I can definitely say that Ajax is going to give web frameworks a run for their money. However, I doubt it's going to completely replace web frameworks. There's many companies out there that aren't willing to commit to developing a JavaScript-only UI - not even Google. GMail has a non-javascript version that's used when you disable JavaScript in your browser.

That being said, I'd much rather work on a project that embraces and uses Ajax over a web framework. However, even if you decide to use Ajax, doesn't the same framework proliferation problem still exist? DWR, Scriptaculous, Prototype, AjaxTags, AjaxAnywhere, Rico, Dojo, JSON-RPC - which Ajax frameworks are the best ones to use? If one of these projects joins Apache, will it become the de-facto Ajax framework like Struts did? ;-)

Posted in Java at Nov 16 2005, 11:16:57 AM MST 8 Comments

PowerBook won't boot after upgrading to 10.4.3

This morning, I began building a new user account for my demos tomorrow at NFJS. I'm doing this because the last time I did demos was a disaster. Since then, I've rebuilt my hard drive, and while things seem faster - a clean user account is the best way to get maximum efficiency. While building the new user, I was prompted by Software Update, and promptly installed Backup 3.0.1 and OS X 10.4.3.

After configuring a number of settings, I rebooted the machine. Now all I get is a gray screen with a dark gray apple on it. The damn thing won't boot. I rebuilt the disk with DiskWarrior, but no dice. Now I'm trying to repair permissions and all that jazz with Disk Utility.

Luckily, I can still boot off my iPod and I can always rebuild an external Firewire drive if I need to. However, I'd much rather get back to where I was this morning. There's nothing like hosing your machine the day before you really need it.

Update: I fixed the problem by reinstalling OS X with the "Archive and Reinstall" option. No data loss, time to backup.

Posted in Mac OS X at Nov 11 2005, 01:12:52 PM MST 6 Comments