Tag Archive 'hibernate'

Feb 12 2008

AppFuse – first impression

Published by under Java

Couple days ago I was looking for some starter kit for Java web applications based on Spring framework. After short investigation I have decide to try some of Maven2 archetypes. If you just type: mvn archetype:create you get list of standard archetypes. Take a look on positions 1-9 (AppFuse starter-kits).

For further investigation I chose appfuse-modular-struts which is a solution based on Hibernate, Spring and Struts2.

To kickoff application kickoffs there are just few simple steps:

  • Launch database. I was trying it with Derby and PostgreSQL.
  • Configure database settings in pom.xml in main directory by adding line true in ‘profiles’ section after ‘id’ of DB of your choice and setting proper user/pass and database name if applicable.
  • Kickoff Maven build and run application:
    mvn
    cd web
    mvn jetty:run-war
  • Navigate to http://localhost:8080 in you browser.

You will see simple application that allows to:

  • Log in (admin/admin).
  • List the users.
  • Edit user data.

Everything looks great. That is the moment when you are starting to look for sources of this application. To get the source you need to invoke another Maven target
mvn appfuse:full-source.

Now you can rebuild the application and do the changes you want.
There is also nice feature for adding standard code. You can generate all required class and configurations for domain objects. To do this add new domain object in your.application.model package in core module and annotate it properly. After that:
cd core
mvn appfuse:gen -Dentity=YourNewObject
cd ..
cd web
mvn appfuse:gen -Dentity=YourNewObject

All the classes, configurations and webpages should be ready for performing CRUD operations for this POJO!

Everything looks great, but there is one concern. Don’t use Java 1.6. Use Java 1.5. It took me several hours to figure out that this is the problem while tests fails (just HTTP 500 respond, no exceptions, no logs). Haven’t investigated yet what’s it the core of the problem with using it on Java 6.

AppFuse homepage: http://appfuse.org/display/APF/Home

No responses yet