Databinder 1.1 beta3

Get help using Databinder, suggest new features, report bugs, and save the princess.

Databinder 1.1 beta3

Postby Nathan on Sat Nov 10, 2007 4:11 pm

Wicket is out with a solid RC, so it's time for another Databinder 1.1 beta (Maven repo version: 1.3-beta3). The most exciting new thing is probably the easy access to Xavier Hanin's QueryPanel component, which allows you to run HQL against the app's default session factory and renders the output in a DataTable. In this beta, Databinder wraps the component in a Data Browser page that lists mapped entities above the query panel itself. DataApplication mounts this page by default under the path /dbrowse when in development mode, and prevents it from rendering outside of development.

The other big thing is DataServer, a wrapper for embedding Jetty. This allows you to serve a web application in Maven, Buildr, Eclipse (or any IDE) without a plug-in, and even run in production without a container. I just threw this in a few weeks ago and am already serving with it on four different sites. It rules.

Authorization also got some attention, in the form of localizable/customizable strings for its various pages and panels, and tokens for cookie authorization that are bound to the IP address that requested them. (You wake up your computer on a different network, you have to sign in again.) The new UserBase class provides useful hash functionality without intruding on your OR mapping.

Updated examples are available for download. (See the parent pom.xml for how to invoke the embedded DataServer.) Also, the long promised replacement for archetypes has materialized, "templates." A template is just a very basic project you can download and start working with, the same as templates for a word processor and some IDEs. There is no generation; you just expand the archive and rename things however you want. (It should still be a fair bit more convenient than starting from an example, after you know what you're doing.) So far there's just one: basic. In a first for Databinder, the basic template starts up with an HSQLDB in memory database (with a MySQL config commented out) configured in hibernate.properties.

Please let me know here if you find any bugs or general weirdness. Also if I've forgotten any features I promised anyone, now's the time to ask again before Databinder goes into 1.1 release-or-bust mode.

Nathan
Nathan
Site Admin
 
Posts: 422
Joined: Thu Mar 30, 2006 12:58 am
Location: New York

Submitting new recipe

Postby kebax on Tue Dec 18, 2007 6:58 am

Hi there! First of all, I think this is really cool toolkit for combining wicket & hibernate transparently.

I decided to study this beta but entered into problems straight away.
When I tried to push button "Save Recipe" I got this exception dump:

Code: Select all
WicketMessage: Null object setting value: Irish Coffee with expression: name
Root cause:
org.apache.wicket.WicketRuntimeException: Null object setting value: Irish Coffee with expression: name  at org.apache.wicket.util.lang.PropertyResolver.setValue(PropertyResolver.java:119)
...


Any ideas on this?

Edit:

This will happen when one decides to add new recipe right after signup.
When you look at existing recipes and after that add new recipe, the exception will not raise.
May there is some problem establishing the pristine recipe entity?
But how existing recipe instance can influence on this?
kebax
 
Posts: 2
Joined: Sat Dec 15, 2007 5:57 am
Location: Finland

Postby Nathan on Thu Dec 20, 2007 4:10 pm

Hi, sorry it's taken me a few days to look into this. You've found a bug in the example! I rewrote it a few months back and must not have ever checked that scenario, creating before looking at anything. You can fix it by changing line 96 of RecipeBook.java to:

Code: Select all
recipeModel = new HibernateObjectModel(Recipe.class);


But now that I'm testing that example, it seem that some changes in Wicket 1.3.0 RC2 make it fail in worse ways. So you might want to hold off on upgrading to that (if you were thinking about it) until the next Databinder beta & examples. (Usually it's okay to upgrade Wicket minor releases independently.)

Nathan
Nathan
Site Admin
 
Posts: 422
Joined: Thu Mar 30, 2006 12:58 am
Location: New York

Postby kebax on Sat Dec 22, 2007 9:43 pm

Alright, that seemed to hit the spot. Thanks.
Reason for this behaviour seems to be obvious as you pointed it out.
Learning with wicketdriven databinder continues.

Merry Chrismas. :)
kebax
 
Posts: 2
Joined: Sat Dec 15, 2007 5:57 am
Location: Finland

Postby ZedroS on Tue Dec 25, 2007 2:51 pm

Hi

I've been playing with Wicket for a short while and I would like to use DataBinder to integrate it with Hibernate... However I would like to use Wicket 1.3. Is it a big hurdle ?

I was planning to upgrade the wicket jar and update the imports of the databinder quickstart project, but I fear it won't be enough... If never you need a beta tester for the new Databinder... ^^

Merci encore !

++
ZedroS
ZedroS
 
Posts: 6
Joined: Thu Dec 20, 2007 4:51 pm

Postby Nathan on Tue Dec 25, 2007 11:17 pm

ZedroS, you can certainly use the Databinder beta that is compatible with Wicket 1.3. Just download the basic template app linked in the first post in this thread. It includes a pom.xml that points to the beta libraries.

Nathan
Nathan
Site Admin
 
Posts: 422
Joined: Thu Mar 30, 2006 12:58 am
Location: New York

Postby ZedroS on Sat Dec 29, 2007 12:19 pm

Thanks Nathan, I did it as you said but up to now it's not successful.

To do it, I first did a mvn archetype:create, changed the pom to look for databinder version 1.1-beta3, set up eclipse and then mvn jetty:run

Then I encountered the following issues :
- the eclipse project was missing the servlet-api-2.5.jar
- the sample application is for wicket 1.2 and thus required a few changes (in MyDataPage the imports are broken as well as the AbstractReadOnlyModel's inheritance, the web.xml looks for wicket.protocol.http.WicketServlet instead of org.apache.wicket.protocol.http.WicketServlet) -> the project compiles now properly
- jetty doesn't display the home page (error 404). I see some "class not found exception" in the stack trace but I need to dig deeper and I don't have the time right now.

I'll play with it deeper later, so I can't tell more for now.

++
ZedroS
ZedroS
 
Posts: 6
Joined: Thu Dec 20, 2007 4:51 pm

Postby ZedroS on Sun Dec 30, 2007 7:09 am

Hi

I had the time to look further.

In fact, the following jar were missing :
- M2_REPO/org/slf4j/slf4j-log4j12/1.0.1/slf4j-log4j12-1.0.1.jar
- M2_REPO/log4j/log4j/1.2.14/log4j-1.2.14.jar

Now the basic page displays properly. However, I've the following error, so I'm not sure everyting is fine :
Exception in thread "ModificationWatcher Task" java.lang.AbstractMethodError: org.slf4j.impl.Log4jLoggerAdapter.isTraceEnabled()Z
at org.apache.wicket.util.thread.Task$1.run(Task.java:105)
at java.lang.Thread.run(Unknown Source)

We shall see later on ;)

++
ZedroS
ZedroS
 
Posts: 6
Joined: Thu Dec 20, 2007 4:51 pm

Postby Nathan on Wed Jan 02, 2008 5:59 pm

Try running it with "mvn compile exec:java". That starts up with the embedded server. You might get an error from hsql at that point; if so comment out the line in hibernate.properties that specifies the username. (I've just updated the template archive to fix that.)

As for the slf4j stuff, in the pom.xml I have it set to use jdk logging rather than log4j, just for simplicity's sake. It should really just come right up if you run it exactly as downloaded; I just tried it again myself. The only hangup I usually see is getting the jta jar, but you probably have that already.

Nathan
Nathan
Site Admin
 
Posts: 422
Joined: Thu Mar 30, 2006 12:58 am
Location: New York


Return to Databinder Questions

Who is online

Users browsing this forum: Google [Bot] and 0 guests

cron