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.

[ANN] AppFuse 1.6.1 Released

This release is primarily a bug fix release, but it also contains a slick "AppGen" tool for generating full CRUD (with sample data and tests) from a POJO. AppGen essentially automates everything you do in the tutorials. I still encourage users to read through and do the tutorials in order to learn the code that is being generated. This feature basically reduces the amount of files you need to create/alter for CRUD from 16 to 2. Better yet, rather than generating the DAO and Manager (as well as the tests), it just uses generic methods in the base implementations. This eliminates the need (and hopefully desire) to create so many DAOs and Managers. In most cases, you can simply use the "manager" bean in your Actions/Controllers and call its respective methods. Thanks to Hibernate for making generic CRUD possible with only a handful of methods. Now you should be able to simply concentrate on the web-tier and only modify/create backend classes when you need special behavior.

To upgrade your 1.6 based application, I recommend performing the following steps:

This is how I've always done my AppFuse upgrades for Struts-Resume. It takes a couple of hours, but it's a lot easier than me trying to create an upgrade package. ;-)

I'll be talking about AppFuse this weekend at Denver's NFJS Conference. Next Monday I'll be in Vegas at ApacheCon. I've never done two different talks back-to-back before, let alone at two different conferences. Should be fun.

Posted in Java at Nov 09 2004, 11:53:44 PM MST 24 Comments
Comments:

Hi Matt! Congrats for the new release. However I have noticed something that may lead to confusions: even if the download zips are different (coming also from different locations) they are named the same way. Maybe you can rename 'em. :the_mindstorm

Posted by the_mindstorm on November 10, 2004 at 04:05 AM MST #

Heh, I did this with 1.6, but forgot to do it with 1.6.1. Doh! I'll change the zip names that are up there right away.

Posted by Matt Raible on November 10, 2004 at 07:41 AM MST #

Thanks. Maybe you should change the build directly ;).

Posted by the_mindstorm on November 10, 2004 at 07:45 AM MST #

You might want to try WinMerge for diffing on windows. It's opensource, free and works very well.

Posted by Lee on November 10, 2004 at 11:31 AM MST #

Hi Matt, thanks for your answer of my question on Equinox. I just start using AppFuse and here are some of my feedback. 1. I got trouble to set it up using Oracle. If the ant new task can define db.type along with db.name, that will be very sweet. 2. No document mentions how to use and what's the relationship between * properties.xml * build.properties * database.properties The comments in those files about JDBC setting is conflicting and confusing. One says it's for Hibernate unit test, one says it will use it to create DB. Also, it could be better just have one place to do the setting. Override properties is sugar but hard to maintain. I feel it should be documented in the quick start at least. 3. There should be placeholders for most popular database server like Oracle/SQLServer/DB2... * in lib.properties * dbname-create.sql so just drop JDBC diver jar into the placeholders lib dir, then modify the setting, and ready to go. Just my 2 cent. Tony

Posted by tony he on November 11, 2004 at 07:30 PM MST #

Hi Matt, how can I change the DB username/password? Seems no matter what I change, the new database.properties generated by setup-db always has the test/test. -Tony

Posted by tony he on November 11, 2004 at 08:53 PM MST #

The default settings for your database should be in properties.xml. You can override these in build.properties. Change the following in properties.xml:

<property name="database.username" value="test"/>
<property name="database.password" value="test"/>

Or add them as properties to build.properties:

database.username=foo
database.password=bar

Or you can even override them from the command line:

ant setup -Ddatabase.username=foo -Ddatabase.password=bar

Ant has immutable properties, so once they're set, they can't be changed. You might want to subscribe to the user mailing list - then more folks can help you with any issues.

Posted by Matt Raible on November 11, 2004 at 09:15 PM MST #

Hi Matt, thanks for the quick reply. I got error when run db-load. But I couldn't find "Bugtable" in any file. Here is the message. Any clue?

db-load:
(connection.DriverManagerConnectionProvider 143 ) cleaning up connection pool:
jdbc:oracle:thin:@localhost:1521:IxTstMIG
[dbunit] Executing operation: CLEAN_INSERT
[dbunit] on file: C:\eclipse\workspace\bacardi\metadata\sql\sample-data.xml
[dbunit] with format: xml
BUILD FAILED: C:\eclipse\workspace\bacardi\build.xml:895: org.dbunit.database.AmbiguousTableNameException: Bugtable

Posted by tony he on November 11, 2004 at 10:46 PM MST #

For dbunit with Oracle, you need to specify a "schema" attribute.

http://raibledesigns.com/page/rd?anchor=dbunit_and_clean_insert

Posted by Matt Raible on November 11, 2004 at 10:52 PM MST #

Why not try to use Tapestry :) As you said, component-based frameworks will be the wave of the future.

Posted by Unnamedplayer on November 12, 2004 at 01:15 AM MST #

I <em>will</em> use Tapestry. In fact, it's on the roadmap.

Posted by Matt Raible on November 12, 2004 at 01:19 AM MST #

After I have run "ant new -Dapp.name=myapp -Ddb.name ?myapp", and enter myapp to run "ant setup" there is an error as follow: BUILD FAILED Error reading project file: Invalid byte 1 of 1-byte UTF-8 sequence. Can anyone help me? Thanks in advance

Posted by shanqy on November 12, 2004 at 02:42 AM MST #

This might help. Via Google.

Posted by Matt Raible on November 12, 2004 at 02:46 AM MST #

Hint: With MySQL Server 4.1.7 I had to set default-character-set=utf8 in my.ini to get appfuse running. Otherwise I get an error: "Illegal mix of collations"

Posted by Torsten Crull on November 12, 2004 at 11:50 AM MST #

Reply to -- For dbunit with Oracle, you need to specify a "schema" attribute.
Please note the Oracle schema must be UPPER case. This might help others. -Tony

Posted by tony he on November 12, 2004 at 02:43 PM MST #

re: "Illegal mix of collations" and MySQL 4.1.x I should add: set default-character-set=utf8 in my.ini before initializing the database, or re-initialize your database after you've changed the setting. A SQL like <code>show full columns from app_user</code> should show you if you need to do this: the collation column will show something like <code>latin1_swedish_ci</code>.

Posted by Kelvin Tan on November 19, 2004 at 02:21 PM MST #

After I run ant setup, I get the following error:

BUILD FAILED
C:\dev\tools\YOURAPPNAME\build.xml:904: org.dbunit.dataset.NoSuchTableException:user_role

On having a look at the output from running the ant setup I can see

[schemaexport] (hbm2ddl.SchemaExport                154 ) Unsuccessful: create table user_role (username varchar(20) not null, role_name varchar(20) not null, primary key (username, role_name)).

This is repeated for all the tables, none are created sucessfully.

Posted by Sudeep sahdeva on April 22, 2005 at 08:10 AM MDT #

I get the exact build failure as Sudeep. NoSuchTablException: user_role. I'm using Oracle, and have provided the schema name to dbunit. All table creations are successful though. Probably a bug in dbunit ??

Posted by Jimmy Soho on November 16, 2005 at 03:15 PM MST #

same problem here...

Posted by mark haller on November 29, 2005 at 12:06 PM MST #

Sudeep, Jimmy and Mark - you'll get a lot better support if you use AppFuse's mailing lists. Are you all using Oracle? If so, it might be an issue with "role" being a keyword in Oracle. You also might want to look at the following wiki page.

http://raibledesigns.com/wiki/Wiki.jsp?page=RunningOnOracle

Posted by Matt Raible on November 29, 2005 at 12:17 PM MST #

I am using oracle and it works like a charm, i usually specify

property name="database.schema" value="SEARCHANA"

in properties.xml
then this

dbunit driver="${database.driver_class}"
supportBatchStatement="false"
url="${database.url}"
userid="${database.username}"
password="${database.password}"
schema="${database.schema}"

in build.xml
hope this helps.

Posted by Ameer Ahmed on December 21, 2005 at 10:57 AM MST #

I was also running into the org.dbunit.dataset.NoSuchTableException on Oracle. It went away when I changed the value of the schema property from lowercase to uppercase.

Posted by Jonathan Kroeker on December 21, 2005 at 01:58 PM MST #

Just specify the schema was not enough in my case. I had also to specify useQualifiedTableNames="enabled" in the build.xml (target db-load) :

    <target name="db-load" depends="prepare"
        description="Loads the database with sample data">
        <echo level="info">driver="${database.driver_class}"</echo>
        <echo level="info">url="${database.url}"</echo>
        <echo level="info">schema="${database.schema}"</echo>
        <echo level="info">userid="${database.username}"</echo>
        <echo level="info">password="${database.password}"</echo>
        <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}"
            userid="${database.username}" password="${database.password}"
            schema="${database.schema}" useQualifiedTableNames="enabled">
            <operation type="${operation}" src="${file}" format="xml"/>
        </dbunit>
    </target>

Posted by Danny Nedved on April 07, 2006 at 03:25 AM MDT #

thanks Jonathon. That helped a lot.

Posted by Gervase on January 13, 2009 at 10:01 AM MST #

Post a Comment:
  • HTML Syntax: Allowed