tags:

views:

273

answers:

3

Hello Seam Users,

I'm having a couple problems with my Seam start up.

I did the ./seam generate to reverse my current postgres db, which contains 4 tables, first I though everything was okay, just a warning message, but when I imported the project into eclipse, I saw that none of my packages had any class.

This is the error that seam generate, got me.

[hibernate] Executing Hibernate Tool with a JDBC Configuration (for reverse engineering)
[hibernate] 1. task: hbm2java (Generates a set of .java files)
[hibernate] log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment).
[hibernate] log4j:WARN Please initialize the log4j system properly.
[javaformatter] Java formatting of 0 files completed. Skipped 0 file(s).

Any ideas?

The seam-gen was supposed to generate some entity classes, but its not. I suppose that error is causing the mis-behavior.

Regards

A: 

Did you run seam generate-entities or is that a typo?

Damo
generate or generate-entities work alike.. it still doesnt work.Im getting that log4j error.. its not generating anything
A: 

You're getting an error, and seam-gen is trying to tell you what it is but can't write it's logs because it's missing it's log4j configuration file. Once you put that on the classpath where you run seam-gen, it should tell you what's wrong.

Jim Barrows
A: 

I found a really stupid-simple fix for this; I would say this probably isn't the best way go around this, but it works.

Get a copy of the log4j.properties file from the Hibernate tutorial (download it with the Hibernate distribution). Zip it up (winzip or whatever) and drop it in the {seam.dir} directory.

Open the build.xml in {seam.dir}\seam-gen directory.

Right After the

<target name="init-generate">
  <path id="htools.classpath">

Add the following line:

<pathelement path="${seam.dir}/log4j.zip" />

That's it.

Richard Clayton