6 Replies Latest reply on Jan 14, 2008 5:44 PM by maxandersen

    Step away from the tool and nobody gets hurt

    bostroff

      I guess I'm working too hard to make this work...

      I have successfully created a seam project in the past (say a month ago) from an existing database schema using seam-gen from the command line. Pretty much just ran the tool, built it (as an ear), deployed it in JBoss, and CRUD just worked. I was using seam 2.0 with JBoss AS 4.2.2.

      Now, I'm trying to get effectively the same thing working using the seam tools in Eclipse (Europa 3.3.1.1) and I ran into a number of problems:

      1. Missing serialVersionUID everywhere - added it.
      2. The loginout.xhtml apparently missing the ui:composition tag - modified it
      3. Some generated xhtml pages not recognizing the messages bundle - added bundle to faces-config.xml - doesn't seem to help - warnings still exist.
      4. Try a deploy anyway - complains about missing MethodBinding among others.

      So, did I answer some of the wizard questions incorrectly (like should I have NOT picked seam 2.0 technology preview)? Is there a blindingly simple tutorial where I could create a small seam 2.0 application from scratch inside Eclipse (Europa) and have it successfully deploy and execute?

      Gosh, this se(a)ms a lot harder than it should be...

        • 1. Re: Step away from the tool and nobody gets hurt
          maxandersen

           

          "bostroff" wrote:
          I guess I'm working too hard to make this work...

          I have successfully created a seam project in the past (say a month ago) from an existing database schema using seam-gen from the command line. Pretty much just ran the tool, built it (as an ear), deployed it in JBoss, and CRUD just worked. I was using seam 2.0 with JBoss AS 4.2.2.

          Now, I'm trying to get effectively the same thing working using the seam tools in Eclipse (Europa 3.3.1.1) and I ran into a number of problems:


          ok.
          so using the seam-gen command line tool give you different results than running it via the tooling ?



          1. Missing serialVersionUID everywhere - added it.


          That is not a bug, that is fully intentional. See http://opensource.atlassian.com/projects/hibernate/browse/HBX-964


          2. The loginout.xhtml apparently missing the ui:composition tag - modified it


          not sure what you are referring to...things works for me...please more details.


          3. Some generated xhtml pages not recognizing the messages bundle - added bundle to faces-config.xml - doesn't seem to help - warnings still exist.


          this is a limitaiton of the validations of the tools. Is anything actually failing when you run the app?


          4. Try a deploy anyway - complains about missing MethodBinding among others.


          details please...War and Ear works for me out of box so need more details to reproduce.


          So, did I answer some of the wizard questions incorrectly (like should I have NOT picked seam 2.0 technology preview)? Is there a blindingly simple tutorial where I could create a small seam 2.0 application from scratch inside Eclipse (Europa) and have it successfully deploy and execute?


          Yes, its in the Getting Started Guide.

          The only explanation I can come up with is that you have something specfic in your db that creates bad seamgen output....just weird you are not seeing that when using seamgen commandline.

          /max

          • 2. Re: Step away from the tool and nobody gets hurt
            bostroff

             

            "max.andersen@jboss.com" wrote:
            "bostroff" wrote:
            I guess I'm working too hard to make this work...

            I have successfully created a seam project in the past (say a month ago) from an existing database schema using seam-gen from the command line. Pretty much just ran the tool, built it (as an ear), deployed it in JBoss, and CRUD just worked. I was using seam 2.0 with JBoss AS 4.2.2.

            Now, I'm trying to get effectively the same thing working using the seam tools in Eclipse (Europa 3.3.1.1) and I ran into a number of problems:


            ok.
            so using the seam-gen command line tool give you different results than running it via the tooling ?



            1. Missing serialVersionUID everywhere - added it.


            That is not a bug, that is fully intentional. See http://opensource.atlassian.com/projects/hibernate/browse/HBX-964


            2. The loginout.xhtml apparently missing the ui:composition tag - modified it


            not sure what you are referring to...things works for me...please more details.


            So, the loginout.xhtml file was generated as:

            
            <div class="loginout"
             xmlns="..."
            ...
            >
            ...
            </div>
            


            Eclipse whined about the xmlns attribute and I assumed that maybe it should read:

            <ui:composition
             xmlns="..."
            ...
            >
            <div class="loginout">
            ...
            </div>
            </ui:composition>
            



            "max.andersen@jboss.com" wrote:
            "bostroff" wrote:

            3. Some generated xhtml pages not recognizing the messages bundle - added bundle to faces-config.xml - doesn't seem to help - warnings still exist.


            this is a limitaiton of the validations of the tools. Is anything actually failing when you run the app?


            4. Try a deploy anyway - complains about missing MethodBinding among others.


            details please...War and Ear works for me out of box so need more details to reproduce.


            So, the log reveals a number of these:

            11:30:08,495 INFO [Initialization] two components with same name, higher precedence wins: org.jboss.seam.core.locale
            11:30:08,499 INFO [Initialization] two components with same name, higher precedence wins: org.jboss.seam.core.manager
            


            followed later by this warning:
            11:30:08,549 WARN [Initialization] Did not install PojoCache due to NoClassDefFoundError: org/jgroups/MembershipListener
            


            and ultimately by this:

            11:30:09,625 ERROR [StandardContext] Error listenerStart
            11:30:09,625 ERROR [StandardContext] Context [/cehc] startup failed due to previous errors
            11:30:09,720 WARN [ServiceController] Problem starting service jboss.web.deployment:war=cehc.war,id=558207986
            org.jboss.deployment.DeploymentException: URL file:/Users/bostroff/Downloads/jboss-4.2.2.GA/server/default/deploy/cehc.ear/cehc.war/ deployment failed
            


            It almost looks like I have two different versions of the seam jar on the runtime classpath?

            "max.andersen@jboss.com" wrote:
            "bostroff" wrote:

            So, did I answer some of the wizard questions incorrectly (like should I have NOT picked seam 2.0 technology preview)? Is there a blindingly simple tutorial where I could create a small seam 2.0 application from scratch inside Eclipse (Europa) and have it successfully deploy and execute?


            Yes, its in the Getting Started Guide.

            The only explanation I can come up with is that you have something specfic in your db that creates bad seamgen output....just weird you are not seeing that when using seamgen commandline.



            Also, now I DO vaguely remember having to drop a jar into my JBoss server default lib directory. This allowed the command line generated version to work (this was done on the vague advice gleaned from another thread somewhere on the net) .

            "max.andersen@jboss.com" wrote:


            /max


            • 3. Re: Step away from the tool and nobody gets hurt
              maxandersen

               

              "bostroff" wrote:
              "max.andersen@jboss.com" wrote:
              "bostroff" wrote:
              I guess I'm working too hard to make this work...

              I have successfully created a seam project in the past (say a month ago) from an existing database schema using seam-gen from the command line. Pretty much just ran the tool, built it (as an ear), deployed it in JBoss, and CRUD just worked. I was using seam 2.0 with JBoss AS 4.2.2.

              Now, I'm trying to get effectively the same thing working using the seam tools in Eclipse (Europa 3.3.1.1) and I ran into a number of problems:


              ok.
              so using the seam-gen command line tool give you different results than running it via the tooling ?



              1. Missing serialVersionUID everywhere - added it.


              That is not a bug, that is fully intentional. See http://opensource.atlassian.com/projects/hibernate/browse/HBX-964


              2. The loginout.xhtml apparently missing the ui:composition tag - modified it


              not sure what you are referring to...things works for me...please more details.


              So, the loginout.xhtml file was generated as:

              
              <div class="loginout"
               xmlns="..."
              ...
              >
              ...
              </div>
              


              Eclipse whined about the xmlns attribute and I assumed that maybe it should read:

              <ui:composition
               xmlns="..."
              ...
              >
              <div class="loginout">
              ...
              </div>
              </ui:composition>
              



              "max.andersen@jboss.com" wrote:
              "bostroff" wrote:

              3. Some generated xhtml pages not recognizing the messages bundle - added bundle to faces-config.xml - doesn't seem to help - warnings still exist.


              this is a limitaiton of the validations of the tools. Is anything actually failing when you run the app?


              4. Try a deploy anyway - complains about missing MethodBinding among others.


              details please...War and Ear works for me out of box so need more details to reproduce.


              So, the log reveals a number of these:

              11:30:08,495 INFO [Initialization] two components with same name, higher precedence wins: org.jboss.seam.core.locale
              11:30:08,499 INFO [Initialization] two components with same name, higher precedence wins: org.jboss.seam.core.manager
              


              followed later by this warning:
              11:30:08,549 WARN [Initialization] Did not install PojoCache due to NoClassDefFoundError: org/jgroups/MembershipListener
              


              and ultimately by this:

              11:30:09,625 ERROR [StandardContext] Error listenerStart
              11:30:09,625 ERROR [StandardContext] Context [/cehc] startup failed due to previous errors
              11:30:09,720 WARN [ServiceController] Problem starting service jboss.web.deployment:war=cehc.war,id=558207986
              org.jboss.deployment.DeploymentException: URL file:/Users/bostroff/Downloads/jboss-4.2.2.GA/server/default/deploy/cehc.ear/cehc.war/ deployment failed
              


              It almost looks like I have two different versions of the seam jar on the runtime classpath?

              "max.andersen@jboss.com" wrote:
              "bostroff" wrote:

              So, did I answer some of the wizard questions incorrectly (like should I have NOT picked seam 2.0 technology preview)? Is there a blindingly simple tutorial where I could create a small seam 2.0 application from scratch inside Eclipse (Europa) and have it successfully deploy and execute?


              Yes, its in the Getting Started Guide.

              The only explanation I can come up with is that you have something specfic in your db that creates bad seamgen output....just weird you are not seeing that when using seamgen commandline.



              Also, now I DO vaguely remember having to drop a jar into my JBoss server default lib directory. This allowed the command line generated version to work (this was done on the vague advice gleaned from another thread somewhere on the net) .

              "max.andersen@jboss.com" wrote:


              /max


              • 4. Re: Step away from the tool and nobody gets hurt
                bostroff

                I have recreated the JBoss AS deployment directory (by moving aside my old version and unzipping the 4.2.2 download again).

                Now, I get:

                15:05:38,710 INFO [Scanner] scanning: /Users/bostroff/Downloads/jboss-4.2.2.GA/server/default/./deploy/cehc.war/WEB-INF/dev
                15:05:38,717 ERROR [[/cehc]] Exception sending context initialized event to listener instance of class org.jboss.seam.servlet.SeamListener
                java.lang.UnsupportedClassVersionError: Bad version number in .class file
                


                Some googling around suggests that this typically happens when you have some a jar compiled with JDK 1.6 and are running an earlier version of the JDK.

                I am (unfortunately?) running Leopard on a Mac and can only run JDK 1.5. Might this be my current problem (or the root of many of my problems)?


                • 5. Re: Step away from the tool and nobody gets hurt
                  rob.stryker

                  You'll need to recompile your web application making sure to link to your current jboss runtime environment during compilation. (keep the new environment on the classpath during compilation). Otherwise, it's compiled against a different set of classes than you're trying to get it to run with.

                  I'm not sure about the rest of your problems, but what I've just said is the solution to this one.

                  • 6. Re: Step away from the tool and nobody gets hurt
                    maxandersen

                    Bad version number can be any combination of trying to run an older VM with newer classes. e.g. Running Seam on a JDK 1.4 would give this or if you have compiled your classes with JDK 6 compability and run it on JDK 5 it will give problems.

                    in any case, when you get deployment errors it should show you higher up in the stack/log what is the root cause.