I don't know if we had two hibernate.cfg.xml files. By the time I relayed your suggestion to my friend (I'm in Holland, he lives in France and I don't have remote access to his system) he had tried a couple of other things and got it to work. I asked him to mail me what he did just before a successful build.

He may have done "mvn appfuse:remove -Dentity=Objet" and subsequently replaced the project with the one I sent him earlier.

I had suggested this as http://appfuse.org/display/APF/AppFuse+Maven+Plugin says

"mvn appfuse:gen [...] After generating the code, the plugin will install it for you as well"

and

"To remove the installed artifacts, use: mvn appfuse:remove -Dentity=Name"

This, combined with the fact that "mvn clean; mvn compile" didn't trigger a recompile of Objet.java, led me to believe there must be a stale Objet class in the local maven repository.

But I'm a bit confused about the role of the repository in the build process, hence my question: mvn clean removes the entire target subtree in the project folder, right? So I'd expect to see a full build with mvn compile. Or do I need to explicitly clear project related artifacts from the local repository as well?

Ger-Jan

Are you saying you did have two hibernate.cfg.xml files in your
project? I don't understand your question.

Matt

On Sat, May 17, 2008 at 2:11 PM,  <[EMAIL PROTECTED]> wrote:
It's running now, thanks for your help.

Still wondering what would make the maven compile task skip a source file?
If mvn clean removes the entire target subtree, shouldn't I see a full build
with mvn compile (or mvn jetty:run-war)?

Ger-Jan

Quoting Matt Raible <[EMAIL PROTECTED]>:

You should make sure there aren't two versions of hibernate.cfg.xml
floating around in your project. This is usually the source of this
problem.

Matt

On Sat, May 17, 2008 at 10:25 AM, Ger-Jan te Dorsthorst  <[EMAIL PROTECTED]>
wrote:
Sorry, I mistyped the path. It's in
src/main/java/com/larchitecte/model/Objet.java, so the package in the
Hibernate config should fit.

The source of the problem remains a mystery...

Cheers,

Ger-Jan

Vincent Ramdhanie wrote:
I am not sure about this but the error message imply that the class is
in
a package named com.larrchitecte.model according to your Hibernate
config,
<mapping class="com.larchitecte.model.Objet"/> but the source is in
src/main/java/com/larchitecte
/archiimmo/model/Objet.java???

Notice the extra archiimmo folder just before model? Could that be the
problem?

Vincent


On Sat, May 17, 2008 at 6:57 AM, Ger-Jan te Dorsthorst <[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>> wrote:

  Hi,

  Is there a way to force mvn to rebuild everything from scratch?
  The reason I'm asking is mvn jetty:run-war being unable to locate
  some class, even though its source is verifiably available.

  If I try to do mvn clean; mvn jetty:run-war in a basic AppFuse
  Spring MVC project, and when working on my friend's Windows system
  (appfuse 2.0.1, maven 2.0.9, java 1.6.0), I run into this error:

  C:\dev\archiimmo>mvn clean
  ...
  [INFO] Deleting directory C:\dev\archiimmo\target
  [INFO]


 ------------------------------------------------------------------------
  [INFO] BUILD SUCCESSFUL
  ...

  C:\dev\archiimmo>mvn jetty:run-war -Djetty.port=18080
  ...
  [INFO] Configuration XML file loaded:
  C:\dev\archiimmo\src\main\resources\hibernate.cfg.xml
  [INFO]


 ------------------------------------------------------------------------
  [ERROR] FATAL ERROR
  [INFO]


 ------------------------------------------------------------------------
  [INFO] Unable to load class declared as <mapping
  class="com.larchitecte.model.Objet"/> in the configuration:
  [INFO]


 ------------------------------------------------------------------------
  [INFO] Trace
  org.hibernate.MappingException: Unable to load class declared as
  <mapping class="com.larchitecte.model.Objet"/> in the configuration:
  ...

  The odd thing is, when running these commands in the same project
  on my Linux box, I have no problems whatsoever.

  I started this project on the Windows system as no more than the
  basic Spring MVC and Hibernate example from the Tutorial, plus a
  single POJO (Objet) and appfuse:gen generated CRUD.

  I then moved the project source to my Linux system - without any
  trouble - and added a simple servlet plus some JSP pages. After
  establishing that things worked fine on my system, I did a mvn
  clean and sent the entire project as a tarball to my friend.

  He simply replaced his project file in d:\dev\archiimmo with the
  archive I sent him, but he's getting the above error message when
  he's trying to run mvn jetty:run-war.

  I'm guessing that mvn is confused by an obsolete, compiled version
  of a compiled Objet class file, as the mvn -X output shows that
  only the newly added servlet gets compiled. But where could this
  obsolete class be? By running mvn clean we removed the target
  folder from the project, right? Or is it in the maven repository?

  Then again, the error message suggests that mvn can't locate the
  Objet class at all. But why doesn't it just compile the source?
  (We have verified it is there; in
  src/main/java/com/larchitecte/archiimmo/model/Objet.java)

  So, I think we need to rebuild all, ignoring possibly cached
  classes. Is it possible to tell mvn to do just that?

  Thanks,

  Ger-Jan

  ---------------------------------------------------------------------
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  <mailto:[EMAIL PROTECTED]>
  For additional commands, e-mail: [EMAIL PROTECTED]
  <mailto:[EMAIL PROTECTED]>





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



--
"The only truly next-gen console out there is the Wii. Everything else is
just a
video card and processor upgrade."

A.J. McGee, http://www.computerandvideogames.com/article.php?id=144515


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to