Results 1 to 10 of 12

Thread: Auto Hibernate metamodel generation

Hybrid View

  1. #1

    Default Auto Hibernate metamodel generation

    I am trying to configure STS to auto-generate Hibernate metamodel classes. I go to the project properties then to Java Compiler then Annotation Processing and enable annotation processing with "target/model" as the generated source directory. Then I went to the Factory Path tab and entered the jars hibernate-jpamodelgen-1.1.1.Final.jar and hibernate-jpa-2.0-api-1.0.0.Final jar. When I hit O.K. the STS prompted me to rebuild the project to which I responded yes. The folder target/metamodel appeared, but it was empty. There were no error messages on the build.
    I am using STS 3.1.0. Am I missing a step?

    Thank you

  2. #2
    Join Date
    Sep 2008
    Location
    Hamburg, Germany
    Posts
    1,637

    Default

    Hey!

    Sorry for the delay... Do you still have this problem or did you solve it in the meantime? I never did this metamodel class generation myself, so I am afraid I cannot help you here directly, but I would take a look at the Hibernate support forums, there seem to be some topics around this metamodel generation. Sorry for not being more helpful here...

    -Martin
    Martin Lippert
    SpringSource, a division of VMware
    SpringSource Tools Team
    http://www.springsource.com
    http://twitter.com/martinlippert

  3. #3

    Default Auto Hibernate metamodel generation

    Quote Originally Posted by Martin Lippert View Post
    Hey!

    Sorry for the delay... Do you still have this problem or did you solve it in the meantime? I never did this metamodel class generation myself, so I am afraid I cannot help you here directly, but I would take a look at the Hibernate support forums, there seem to be some topics around this metamodel generation. Sorry for not being more helpful here...

    -Martin
    Thanks for replying Martin. Unfortunately, my pc did a Bios upgrade and now won't boot up. Thanks Toshiba. I have to send it in for repair. There was a code update to the chapter on GitHub, but I have not had a chance to try it since my machine is dead. Luckily, I used Acronis for nightly backups, so as soon as I get it back, I should be able to restore it fairly quickly! Then I'll give it another try. You may have notice the other problem I was having with STS was that generation of a Spring MVC template project would not work. Once generated, you should be able to run it on the VMware tc server and see a hello world page. You get a 404 although all the required files are generated. You also get a lot of server errors, though the server does start. I downloaded Eclipse, then installed STS and Maven and tried it within Eclipse and it worked fine.

    Mike

  4. #4
    Join Date
    Sep 2008
    Location
    Hamburg, Germany
    Posts
    1,637

    Default

    Hey Mike!

    Sorry to hear about your pc issues and hope you get your machine back soon.

    Regarding the issue with the template project: do I understand that correctly that is doesn't work when you use the STS 3.1.0 distribution, but it works when you use Eclipse and install STS and Maven tooling as an add-on?

    -Martin
    Martin Lippert
    SpringSource, a division of VMware
    SpringSource Tools Team
    http://www.springsource.com
    http://twitter.com/martinlippert

  5. #5

    Default STS MV template project

    Quote Originally Posted by Martin Lippert View Post
    Hey Mike!

    Sorry to hear about your pc issues and hope you get your machine back soon.

    Regarding the issue with the template project: do I understand that correctly that is doesn't work when you use the STS 3.1.0 distribution, but it works when you use Eclipse and install STS and Maven tooling as an add-on?

    -Martin
    Than is correct. I used Eclipse Juno,then went to the Eclipse Store, downloaded STS (don't recall what version it offers, but I picked the default offering), Then Maven tooling (also the version offered by default). I also had to add in tButhe VMware vFabric tc server v 2.7. But I got the Hello. World page when I ran it on the server instead of error 404. And I didn't get all the VMware startup errors with Eclipse that I got with the distribution. Although I think in the distribution, the VMware still did start up.

    All you need to do is Create a Spring Template Project, then pick Spring MVC project. Give it a name, and a base package, say com.martin.example, then create the project. At that point you should be able to select Run->run on server in both the STS distribution and Eclipse, though at that point in Eclipse you'll have to add the server. The STS distribution adds it for you.

    Thanks
    Mike

  6. #6
    Join Date
    Sep 2008
    Location
    Hamburg, Germany
    Posts
    1,637

    Default

    Hey Mike!

    I tried your steps again (although this is a setting that we test all the time) and it still works on my environment. I have an STS distribution (3.1.0.RELEASE for Eclips 3.8), created a MVC project from that template, selected "Run on server", selected the tc server instance, and the project starts up just fine.

    However, sometimes when you create a project from the MVC template, there are some errors showing up in the Markers view for that project. Those go away if you trigger an additional clean build of the project. Did you try that? Otherwise I am running out of ideas why that scenario fails in your case...

    -Martin
    Martin Lippert
    SpringSource, a division of VMware
    SpringSource Tools Team
    http://www.springsource.com
    http://twitter.com/martinlippert

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •