Announcement Announcement Module
Collapse
No announcement yet.
Auto Hibernate metamodel generation Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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

    Comment


    • #3
      Auto Hibernate metamodel generation

      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

      Comment


      • #4
        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

        Comment


        • #5
          STS MV template project

          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

          Comment


          • #6
            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

            Comment


            • #7
              Spring MV project

              Originally posted by Martin Lippert View Post
              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
              You are doing this in STS only correct? not Via Eclipse? I did do a maven clean. Until my computer is repaired I can't try anything else.

              I'll let you know when I get my computer back and restore it in a couple weeks.

              Thanks much
              Mike

              Comment


              • #8
                Hey Mike!

                Yes, I did everything in STS only and nothing on the Maven command line or in an Eclipse instance.
                Let me know when your computer is back and you hit the problem again.

                Cheers,
                -Martin

                Comment


                • #9
                  Hi all.
                  I have the absolutely equal problem as the first post of MikeT.
                  Using STS:
                  Version: 3.2.0.RELEASE
                  with installed sofware:
                  APT M2E Connector 0.0.1.3
                  Clay Mark II
                  m2e - Maven Integration for Eclipse
                  m2e - slf4j over logback logging
                  m2e connector for build-helper-maven-plugin
                  m2e connector for mavenarchiver pom properties
                  m2e-wtp - Maven Integration for WTP (Incubation)
                  Maven Integration for AJDT
                  SpringSource UAA Integration (optional)

                  OS: win 7

                  use jars for generation metamodel:
                  hibernate-jpa-2.0-api-1.0.1.Final.jar
                  hibernate-jpamodelgen-1.2.0.Final.jar

                  Can anybody help to resolve a problem ?

                  Comment


                  • #10
                    I wish I could help you pashalost. Assuming you are referring to auto Hibernate metamodel autogeneration. I never did get this to work, I just generated the files by hand (kind of cumbersome!) and moved on. Hopefully someone else can help us!

                    Mike

                    Comment


                    • #11
                      Find a solution at link: https://forum.hibernate.org/viewtopi...004784&start=0
                      Still using STS at it works at last.

                      Comment


                      • #12
                        Thanks, I'm going to convert a test website I wrote to use JPA (already using Hibernate). I'll check this out when I come to it.

                        Comment

                        Working...
                        X