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 "maven". 270 entries found.

You can also try this same search on Google.

Gig in Seattle

I don't normally post gigs on this site, but I do when they're good rates, and the person hiring is a friend of mine. Here's one in the Pacific Northwest (Seattle):

  • 5+ years of experience with Java and J2EE required including EJB, JMS, and JSP/Servlet, required.
  • 3+ years of experience with UML, SOAP, XML/XSL, SQL, Struts.
  • 1+ years experience working with external client on projects.
  • Experience applying design patterns and OO best practices required.
  • Experiencing writing use cases and producing design documentation required.
  • Experience developing on Unix platforms required, preferably RedHat Linux.
  • Required application experience: BEA Weblogic, Tomcat, Apache.
  • Desirable application experience: Maven, Struts, Spring, MySQL, Oracle.
  • Desirable methodology experience: Refactoring, Agile, Scrum.
  • Desirable additional skills: WML, WAP, XHTML, XSL, XML Schema, SSL, HTTP, Perl.

Let me know if you're interested and I'll forward you the full job description and contact person's information.

Posted in Java at Apr 25 2006, 03:21:07 PM MDT Add a Comment

How do you determine a good MaxPermSize?

I know I'll probably get beat up for not knowing my JVM Turning parameters. I admit that I should know them better than I do. Hopefully this post will help us all understand them a bit better.

Ever since I upgraded appfuse.org to AppFuse 1.9.1, it's been experiencing OOM issues. They've been so bad that the site is lucky if it stays up for more than an hour. I've done a fair amount of performance testing on a single AppFuse application (and gotten very good numbers), so I was pretty puzzled by the whole situation.

To reproduce the problem, I downloaded all 5 demos to my machine and began profiling with JProfiler. Nothing stood out, but I was able to reproduce the problem by clicking through all the different applications. While testing, I had my JAVA_OPTS set to -Xms256M -Xmx384M.

After staring at JProfiler for hours, I gave up and sent my findings to the AppFuse mailing list. After going back and forth with several ideas, Sanjiv came up with the winner.

Did you try increasing the max perm size (-XX:MaxPermSize=256m)? Max Perm size is running out of memory and not necessarily the main memory. Class metadata stuff is placed in the perm memory (google for more details) and since we're using Spring, Hibernate and Tapestry which all use a lot of reflection, proxying etc, it's not surprising that max perm size is running out of memory.

Based on his advice, I added -XX:MaxPermSize=256m to my JAVA_OPTS, fired up JProfiler/Tomcat and began hammering my local instance with WAPT. 15 minutes later, with 20 simultaneous users, the heap and memory were humming along nicely with no issues. I made the change on appfuse.org and it's been up every since.

This experience has motivated me to start adding "-XX:MaxPermSize=256m" to all my JAVA_OPTS. Is this a good idea? If so, is 256m a good value to use? If not, what's the best way to determine (or guess) the proper value for this setting?

Posted in Java at Apr 19 2006, 09:54:14 AM MDT 21 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

Jetty 6 Maven Plugin now works with SiteMesh (and Equinox)

The 1.6 version of Equinox contains commented-out settings for Maven 2 Jetty Plugin. The reason these are commented-out is because this plugin didn't work with SiteMesh at the time. I checked again today, and it looks like they got it fixed. See Brett's post titled Developing with Jetty: Where Have You Been All My Life? to see why this plugin is so cool.

Using this plugin (or the JettyLauncher in Eclipse) makes it pretty damn easy to do develop Java webapps. There's no longer a deploy cycle, just save and refresh your browser. IMO, it's almost as good as using a scripting language or developing with HTML/CSS/JavaScript.

I'd love to see someone develop a TomcatLauncher, a WinstoneLauncher and Maven 2 Plugins for both. AppFuse works with Winstone 0.8.1 (a wicked fast servlet container with a good story behind its name).

In other Jetty news, Jan Bartel posted a nice tutorial today titled How To Use JOTM as the XA Transaction Manager in Jetty6.

Posted in Java at Mar 10 2006, 12:08:31 PM MST 4 Comments

Struts is (far and away) most popular web framework deployed on JBoss

From this month's JBoss Newsletter:

Here are the results of last month's poll that asked: What web application framework(s) do you use for your applications deployed on JBoss? (Multiple answers allowed)

  • Apache Struts - 59%
  • JavaServer Faces- 34%
  • Spring - 26%
  • Other - 13%
  • Tapestry - 6%
  • WebWork - 5%
  • Wicket - 1%

These results are certainly interesting. My guess is most "Other" frameworks are ones developed in-house.

Does this means I shouldn't ditch Struts 1.x support in AppFuse 2.0? Possibly, but since AppFuse works best for starting new applications - it makes sense to say "use the good stuff or you're on your own." ;-)

Posted in Java at Mar 10 2006, 07:02:29 AM MST 9 Comments

DbUnit Tip: Turn off foreign key constraints when importing into MySQL

One of the issues I've had with using DbUnit is getting tables to load in the proper order from XML. The XML datasets I use to load table data are flat and don't really have any notion of foreign keys and such. Therefore, when you get into a situation where tables have a circular reference, using DbUnit can be a real bitch. I ran into this situation yesterday.

Luckily, I was able to figure out a solution thanks to the help of Mark Matthews. Just add "sessionVariables=FOREIGN_KEY_CHECKS=0" to your JDBC URL. Here's how the "db-load" target in AppFuse looks with this in place:

    <target name="db-load" depends="prepare"
        description="Loads the database with sample data">
        <property name="operation" value="CLEAN_INSERT"/>
        <property name="file" value="metadata/sql/sample-data.xml"/>
        <dbunit driver="${database.driver_class}"
            supportBatchStatement="false" 
            url="${database.url}&amp;sessionVariables=FOREIGN_KEY_CHECKS=0"
            userid="${database.username}" password="${database.password}">
            <operation type="${operation}" src="${file}" format="xml" transaction="true"/>
        </dbunit>

    </target>

Does your preferred database have a similar mechanism for turning off foreign key checks using the connection URL?

Posted in Java at Mar 01 2006, 04:16:48 PM MST 25 Comments

OpenLaszlo Tutorial and AppFuse with DWR

A few web development nuggets:

I also noticed a recently updated howto on the AppFuse wiki: Spring Rich Client with AppFuse by Radim Burget. The amount of documentation being produced by the AppFuse community is truly awesome. Thanks everyone!

Update: XFire is crazy fast. If you like, you can see for yourself in AppFuse using OpenLaszlo as a client. Hopefully we can include XFire in a coming release, along with Maven 2 integration.

Posted in Java at Feb 25 2006, 03:52:23 PM MST 4 Comments

[ANN] Equinox 1.6 Released

For a good story of how Equinox helps, see Wayland Chan's Equinox to the rescue blog post.

This release's major new features are Tapestry 4.0 and WebWork 2.2.1 upgrades. In addition, I changed to use Maven's Standard Directory Layout. It makes IDE and using Maven plugins much easier, so it's a natural progression.

This release does not contain Maven support for running the integration tests with Cargo. This is because Cargo still seems a lot more complicated with Maven than with Ant. Hopefully I'll be able to figure out an easy way to get test-all functionality with Maven and Cargo in the next release.

All of the frameworks used in Equinox, as well as its build/test system is explained in Spring Live. A summary of the changes are below (detailed release notes can be found in JIRA):

  • Added custom exception page for Tapestry, as well as tapestry-flash.
  • Changed birthday date input to use WebWork's DatePicker component.
  • Added support for pre-compiling JSPs when building with Maven (on by default).
  • Added createDatabaseIfNotExist=true to jdbc.properties.mysql to auto-create the database when using MySQL.
  • Changed classes that extend *SpringContextTests to use AUTOWIRE_BY_NAME so more than one instance of an interface is supported.
  • Dependent packages upgraded:
    • Cargo 0.7
    • DisplayTag 1.1
    • Hibernate 3.1.2
    • Scriptaculous 1.5.2
    • Tapestry 4.0
    • WebTest build 1168
    • WebWork 2.2.1

Download. For more information about installing the various options, see the README.txt file.

Demos:

Known Issues: The Tapestry-Flash JAR was built with JDK 1.5 - so you'll need JDK 5 to run the Tapestry version. Howard Lewis Ship said he'd fix this tonight or tomorrow. Also, if you're on Unix, you'll need to run "ant fixcrlf" before you install anything. Finally, downloading dependencies might not work the first time. Running the "ant" or "mvn" command multiple times usually solves the problem.

See the roadmap for what's coming in the next release.

Posted in Java at Feb 21 2006, 04:35:08 PM MST 8 Comments

What do we need to do to make WebWork/Action 2 the best framework for *everything*?

From Ted Husted on the Struts mailing list:

Seriously, hype aside, engineer to engineer, if we can use the new standalone Tiles with WebWork, and use Ajax to store the state of UI controls, what else do we need to do to make WebWork/Action 2 the best framework for *everything*?

My reply:

The tag documentation (and documentation in general) for WebWork is difficult to navigate. Struts' documentation has generally made it easier to find stuff.

I think the hardest part of WebWork/Action 2 is providing the path for migration. If Struts 1.x applications can run in Struts Action 2.x, and users can create new Actions following WW's APIs - that will be truly awesome.

Another that would be cool is smart defaults. For example, having Actions that end with "Action" be available at the "everythingbeforeAction" URL. Spring has something similar coming in 2.0 - and it's mainly just done by extending a certain class.

http://jroller.com/page/raible?anchor=an_example_of_smart_defaults

So if I have UserAction, it's automatically available at /users, /user/edit, /user/save, etc. Default CRUD in a sense. No xwork.xml required by default. But users can override. Default everything w/o requiring annotations, but allow overriding. Or maybe there's different default schemas - a CRUD one, store front, etc.

Ajax stuff that I think WW already has: in-page updates, sortable/pageable lists with something like the displaytag - but with Ajax. There's a lot of these components already available for this stuff, so it might just be a matter of documenting how to integrate them.

Promoting Maven 2 for building might be an easy way of promoting inclusion of 3rd party libraries. Add 3 lines of XML, use this code in your JSP/template, boom - you're good to go. Those that don't like Maven can use the Ant tasks and pom.xml.

Archetypes could be pretty big too - create starter applications that users can use. Even better, provide a means to upgrade the archetypes. Of course, that might be a Maven thing - and editing pom.xml to change versions really isn't that hard.

Above all else - to become the best MVC framework for Java - documentation and easy migration are essential.

Just my $0.02 of course. ;-)

What's your opinion?

Posted in Java at Feb 21 2006, 02:19:17 PM MST 3 Comments

DisplayTag 1.1 Released!

Read the release notes, change log, migration instructions and download. Don't forget to check out the live demo too. If you're using Maven 2, you simply need to add a new repository:

  <repositories>
    <repository>
      <id>displaytag</id>
      <url>http://displaytag.sourceforge.net/m2repo</url>
    </repository>
  </repositories>
  ...
    <dependency>
      <groupId>displaytag</groupId>
      <artifactId>displaytag</artifactId>
      <version>1.1</version>
      <scope>runtime</scope>
    </dependency>

This release is pretty huge IMO. You can now do external sorting and paging, which should eliminate any performance concerns with using this library. Another nice feature is portlet support. Nice work Fabrizio!

Update: This release is now at ibiblio, so you don't need to add the custom repository to your pom.xml anymore.

Posted in Java at Feb 12 2006, 12:26:15 PM MST 10 Comments