Reference Project - Ant Build, GWT (1.4), Spring, Hibernate

27 views
Skip to first unread message

Jeremy Przasnyski

unread,
Jun 3, 2007, 9:06:45 PM6/3/07
to GWT, Spring and Hibernate Reference Web Application
My GWT / Spring / Hibernate / Ant / JUnit / Cobertura / H2 + MySQL
reference project is getting close to being stable.

Here's a list of features (from the readme.txt):
1) Ant build file (builds, localizes, deploys, runs unit tests,
generates coverage reports, genrates DDL, etc)
2) Eclipse pre-configured project (Googlipse integration currently
broken)
3) GWT support (with Spring IoC for server-side components using
GWT Server Library - http://gwt-widget.sourceforge.net )
4) Spring Inversion of Control for all components
5) Hibernate ORM (using JDK 1.5 annotations)
6) Dozer Bean Mapper (maps Server-side domain objects to client-side
beans)
7) JUnit unit tests (using JDK 1.5 annotated classes, DAO code tested
against H2 DB)
8) Cobertura unit test code coverage & reporting
9) Log4J Logging (plus a logging facade that makes dropping logging
statements into new classes easier -- at least I think so!)

Here's a link to the full readme:
http://gwt-spring-hibernate-reference.googlecode.com/svn/trunk/gwt-spring-hibernate-ant-reference/readme.txt

Please make use of this project. Feedback is welcome as well!

Jeremy

Bill

unread,
Jun 4, 2007, 12:09:34 PM6/4/07
to GWT, Spring and Hibernate Reference Web Application
Jeremy,

Just a quick note. I am running XpPro, the checkout from svn (within
Eclipse 3.3 rc2) was fine, the initial Eclipse build generated the
following errors:

Severity and Description Path Resource Location Creation Time Id
Project 'gwt-ant' is missing required library: 'build/test/gen' gwt-
ant Build path 1180971951750 47437
The project cannot be built until build path errors are resolved gwt-
ant Unknown 1180971951750 47439
Unbound classpath container: 'JRE System Library [JVM 1.5.0 (MacOS X
Default)]' in project 'gwt-ant' gwt-ant Build path 1180971951750
47438

I have yet to run the ant scrip (probably the first error) and I am
running Java 1.6 on windows (the second error)

I just dropped the JRE (MAC OS) reference and added a library
reference (I believe this is the preferred way in Eclipse 3.3) That
single change cleared both problems - I do not know why (but hve
ceased being surprised by software.)

I will not have much time to "play" with this now but will provide
feedback (if things go as I hope.)

Duh, I almost forgot the most important thing - thank you for sharing
this,

Bill

Jeremy Przasnyski

unread,
Jun 4, 2007, 12:16:25 PM6/4/07
to gwt-spring-hibe...@googlegroups.com
Thanks. I should probably try this out on XP and Linux and modify the readme accordingly. It appears as though this line from the .classpath file (below) is system dependent.

<classpathentry kind="con" path=" org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.launching.macosx.MacOSXType/JVM 1.5.0 (MacOS X Default)"/>

Thanks for the head's-up.

Jeremy

George Georgovassilis

unread,
Jun 7, 2007, 3:38:41 PM6/7/07
to GWT, Spring and Hibernate Reference Web Application
Hello Jeremy

You have done some amazing work! This is a parade display of all the
disciplines which
are required to structure and maintain a project properly: it is not
only about coding the
stuff right, but about structuring it, getting the configuration right
andpackaging it.
You thought through many of the things that a GWT developer stumbles
over again
and again. In this respect your projects shows the great value of IoC,
how one can plug
anything as heterogeneous together as two server-agnostic ORM
frameworks like Hibernate
and GWT over a (not-only-)web-framework such as Spring. And I'm glad
that in your massive
configuration the SL takes up only a handful of lines ;-)

Keep up the good work!
G.

Jeremy Przasnyski

unread,
Jun 7, 2007, 3:58:11 PM6/7/07
to gwt-spring-hibe...@googlegroups.com
George,
Thanks for the kind words. I've been a Java Developer for about 8 years now and been working with some of the best in the business. I attribute my success to good teachers and hard work.

I also applaud the folks at Google for opening something like GWT up to the public. The UI aspect of web applications 'traditionally' has been a royal PITA because of the amalgamation of so many different languages into each page (JSP, HTML, CSS, JavaScript, Tag Library X, Tag Library Y, the internal scripting notation for Library X, the internal scripting notation for Library Y, getting Tag Library X to play nice with Tag Library Y, etc, etc). GWT solves all of this since you just write java code and sometimes call out to JavaScript. It is a HUGE relief to just work with one language & I think some very elegant and powerful applications are going to come out of GWT based projects.

I'll continue to hone the project as time permits. I've already made much progress on my GWT project at work & I'll roll anything I learn in refined form into the reference project in my spare time.

If anyone has any suggestions of things they'd like to see, please feel free to let me know & I'll see what I can do.

Jeremy

Jeremy Przasnyski

unread,
Jun 14, 2007, 4:21:33 PM6/14/07
to gwt-spring-hibe...@googlegroups.com
I can choose to accept your information (which I do), or not. There is no need to apologize for providing valuable feedback!

I've been working on a better UI in another project (based on the reference project) and will probably roll those UI changes into the reference project at some point. My UI is based on the kitchen sink GWT example. I need to take a look at the licensing of those files because I essentially just yanked the code from several classes and repackaged them.

BTW - I pulled this conversation back into the group as I feel it would be useful for people in the group to see.

Jeremy

On 6/14/07, magnus hansen <magh...@gmail.com> wrote:
i feel like i'm bossing you around. Sorry. I will send you the updated
file in a minute...

On 6/14/07, magnus hansen <magh...@gmail.com> wrote:
> that was fast ;)
>
> getHibernateTemplate also has convienience-methods for the other CRUD
> operations and a getlist(object) method..(and more i think)
> I think you should use the getHibernateTemplate in every method in
> customerDaoImpl because spring closes the session for you and propably
> does more behind the scene to make sure all happens correctly...
>
> For example: after it failed to save my object ( before the change )
> that error also kept me from deleting customers even though that one
> normally worked. I guess it was because the session wasn't closed
> right...
>
> Magnus
>
> PS: i write long mails... sorry about that ;)
>
> On 6/14/07, Jeremy Przasnyski < jerem...@gmail.com> wrote:
> > Fixed.
> >
> >
> > On 6/14/07, Jeremy Przasnyski <jerem...@gmail.com > wrote:
> > > Thanks. I'll drop that in right now. I was unaware of template/session
> > recommendation.
> > >
> > > Jeremy
> > >
> > >
> > >
> > > On 6/14/07, magnus hansen < magh...@gmail.com> wrote:
> > > > hello again... regarding the not being able to save problem. I fixed
> > it..
> > > > I changed a line in the "CustomerDaoImpl"..
> > > >
> > > > -- getSession().save(customer);
> > > > ++getHibernateTemplate().save(customer);
> > > >
> > > > I believe it is recommended to use getHibernateTemplate() instead of
> > > > getSeesion()
> > > >
> > > >
> > http://www.springframework.org/docs/api/org/springframework/orm/hibernate/support/HibernateDaoSupport.html
> > > >
> > > > Magnus
> > > >
> > > >
> > > > On 6/14/07, magnus hansen < magh...@gmail.com> wrote:
> > > > > hello. Jeremy
> > > > >
> > > > > I inserted customer data manually, and your system could display them
> > > > > fine and even delete them.. I'm thinking the spring-TX makes funny
> > > > > stuff..
> > > > > Or it could be that my change from mySQL to postgres was not done all
> > > > > the way...
> > > > > I would put my money on the latter option, because in the log i can
> > > > > see that hibernate calls nextval on the sequence but does not save the
> > > > > customer, so maybe dozer ( i am by the way not familiar with dozer),
> > > > > is not set op correctly or there is some other place in the program
> > > > > that doesn't realize how to save things with postgres... But not to
> > > > > worry, i'll get to the bottom this ;)
> > > > >
> > > > >
> > > > > Regarding the project:
> > > > > Of course if i find errors that needs to be fixed i will send you a
> > mail..
> > > > > But regarding the contributing ie. moving forward with your reference
> > > > > project I am not sure what needs to be done, i thought maybe you
> > > > > didn't want the project to get to big..
> > > > > So what i am saying is that you seem to be on top of things from my
> > > > > perspective...
> > > > >
> > > > > If you want a new thing added and you are to busy, send me a mail and
> > > > > i'll look in to it if I can...
> > > > >
> > > > > My plan regarding going forward is to add some spring-oriented things,
> > > > > and to make a more complicated database, utilizing hibernates
> > > > > inheritance scemes and so on..
> > > > > Last i will make a nice UI..
> > > > > The end result will be to complicated for people trying to learn.. But
> > > > > after they have learned, or for more experiensed users, my project
> > > > > could be used...
> > > > >
> > > > > After that i'll make some more specific adjustments for the company
> > > > > that has hired me, and it won't make sense to make that public here..
> > > > > It will only confuse...
> > > > >
> > > > > I hope we can make something nice for the people out there because I
> > > > > have looked around for some time now, and this group seems to be the
> > > > > only serious (public) attempt to do this..
> > > > >
> > > > > Magnus
> > > > >
> > > > > On 6/14/07, Jeremy Przasnyski < jerem...@gmail.com> wrote:
> > > > > > Did you create a DB with full permissions? If so, did the schema get
> > > > > > created? If so, when you add a customer to the DB manually, does it
> > appear
> > > > > > in the table?
> > > > > >
> > > > > > If you do end up with something to contribute, I'll look into how
> > you can
> > > > > > contribute. I'm assuming it will either be patches (only done that a
> > couple
> > > > > > times myself) or SVN checkins to a branch of the repository, in
> > which case
> > > > > > you will need to be given write permissions in the repo.
> > > > > >
> > > > > > If you move forward with my reference project, let me know what kind
> > of
> > > > > > additions you think will be useful additions.
> > > > > >
> > > > > > Jeremy
> > > > > >
> > > > > > On 6/13/07, magnus < magh...@gmail.com> wrote:
> > > > > > > Hello Jeremy...
> > > > > > > I have joined the group (my first group on google ;)
> > > > > > > The reason i have joined is that i am seriously considering using
> > your
> > > > > > > code as a skeleton or at least as a good beggining for my new
> > > > > > > project..
> > > > > > > Currently it is running more or less on my mac, with postgrsql as
> > the
> > > > > > > DB.. It won't save new customers though, but i'll figure it out..
> > > > > > >
> > > > > > > Soon I willl know enough to contribute, perhaps you have an idea
> > of
> > > > > > > how.
> > > > > > >
> > > > > > > Do write a mail, or a post in the group..
> > > > > > >
> > > > > > > regards Magnus Hansen ( all the way from Denmark )
> > > > > > >
> > > > > > >
> > > > > > > On Jun 7, 9:58 pm, "Jeremy Przasnyski" < jeremy....@gmail.com >
> > > > > > > > On 6/7/07, George Georgovassilis <g.georgovassi...@gmail.com >
> > > > > > > > --
> > > > > > > > Jeremy Przasnyski
> > > > > > > > AIM:jpskiii | Y!:jpskii | GTalk:jeremy.prz
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > Jeremy Przasnyski
> > > > > > AIM:jpskiii | Y!:jpskii | GTalk: jeremy.prz
> > > > >
> > > > >
> > > > > --
> > > > > Hilsen Magnus Hansen
> > > > >
> > > >
> > > >
> > > > --
> > > > Hilsen Magnus Hansen
> > > >
> > >
> > >
> > >
> > > --
> > >
> > > Jeremy Przasnyski
> > > AIM:jpskiii | Y!:jpskii | GTalk:jeremy.prz
> >
> >
> >
> > --
> >
> > Jeremy Przasnyski
> > AIM:jpskiii | Y!:jpskii | GTalk:jeremy.prz
>
>
> --
> Hilsen Magnus Hansen
>


--
Hilsen Magnus Hansen



--
Jeremy Przasnyski
AIM:jpskiii | Y!:jpskii | GTalk:jeremy.prz
Reply all
Reply to author
Forward
0 new messages