14 Replies Latest reply on Aug 18, 2006 2:44 PM by Stepan Polyak

    Is there a workable version of JBossSEAM?

    Stepan Polyak Newbie

      Well... Downloaded suggested JBossSEAM and one of the nightly builds jboss-seam-CVS.20060809.
      Followed short guide. Got 2 *.ear files with different sizes. After deployment both shows ERRORs.

      20:34:30,343 ERROR [LocaleUtils] Locale name null or empty, ignoring
      20:34:30,859 INFO [StartupServletContextListener] ServletContext 'C:\Program Fi
      les\jboss-4.0.4.GA\server\default\.\tmp\deploy\tmp40635jboss-seam-booking.ear-co
      ntents\jboss-seam-booking-exp.war\' initialized.
      20:34:30,890 INFO [EARDeployer] Started J2EE application: file:/C:/Program File
      s/jboss-4.0.4.GA/server/default/deploy/jboss-seam-booking.ear
      20:34:30,906 INFO [EARDeployer] Init J2EE application: file:/C:/Program Files/j
      boss-4.0.4.GA/server/default/deploy/sample.ear
      20:34:30,937 ERROR [MainDeployer] Could not create deployment: file:/C:/Program
      Files/jboss-4.0.4.GA/server/default/tmp/deploy/tmp40636sample.ear-contents/sampl
      eEJB.jar
      org.jboss.deployment.DeploymentException: expected one enterprise-beans tag
      at org.jboss.metadata.MetaData.getUniqueChild(MetaData.java:113)

      And at the end.....

      --- Incompletely deployed packages ---
      org.jboss.deployment.DeploymentInfo@d6d6ec0b { url=file:/C:/Program Files/jboss-
      4.0.4.GA/server/default/deploy/sample.ear }
      deployer: org.jboss.deployment.EARDeployer@bf053f
      status: Deployment FAILED reason: expected one enterprise-beans tag
      state: FAILED
      watch: file:/C:/Program Files/jboss-4.0.4.GA/server/default/deploy/sample.ear
      altDD: null
      lastDeployed: 1155774870921
      lastModified: 1155774870890
      mbeans:

      OK. So I decided to follow JBossSeamGettingStartedGuide.
      In step #4 I noticed that I am creating progect "simple" although on the picture there is also a progect "jboss-seam-1.0.1GA. How to create that one using downloaded files? Is that progect important at all?
      In step #5 after I typed "seam scaffold-wtp-project sample" I got this:
      "BUILD FAILED
      C:\jboss\seam\seam-gen\build.xml:71: C:\jboss\seam\seam-gen\src not found."

      Also tried to follow JBossSEAMReverseEngineerGuide.
      When I generated a skeleton Seam application(from Oracle 9, 1 table only) I got:
      import javax.ejb.Interceptors;
      Had to change it to:
      import javax.interceptor.Interceptors;
      after this change I was able to deploy *.ear but it failed during deployment as:

      21:24:07,921 ERROR [SchemaExport] invalid schema name: GCORK in statement [creat
      e table GCORK.HAZARD_INDEX]

      21:24:08,468 INFO [Component] Component: org.jboss.seam.core.init, scope: APPLI
      CATION, type: JAVA_BEAN, class: org.jboss.seam.core.Init
      21:24:08,468 ERROR [[/seamapp]] Exception sending context initialized event to l
      istener instance of class org.jboss.seam.servlet.SeamListener
      java.lang.IllegalArgumentException: no property for configuration setting: org.j
      boss.seam.core.init.managedPersistenceContexts
      at org.jboss.seam.Component.initInitializers(Component.java:311)

      later I got:

      21:24:08,953 INFO [FacesConfigurator] Reading config /WEB-INF/faces-config.xml
      21:24:09,046 ERROR [LocaleUtils] Locale name null or empty, ignoring
      21:24:09,296 INFO [StartupServletContextListener] ServletContext 'C:\Program Fi
      les\jboss-4.0.4.GA\server\default\.\tmp\deploy\tmp35721seamapp.ear-contents\seam
      app-exp.war\' initialized.
      21:24:09,296 ERROR [StandardContext] Error listenerStart
      21:24:09,296 ERROR [StandardContext] Context [/seamapp] startup failed due to pr
      evious errors
      21:24:09,296 WARN [ServiceController] Problem starting service jboss.web.deploy
      ment:war=seamapp.war,id=-1894308984
      org.jboss.deployment.DeploymentException: URL file:/C:/Program Files/jboss-4.0.4
      .GA/server/default/tmp/deploy/tmp35721seamapp.ear-contents/seamapp-exp.war/ depl
      oyment failed

      Later:

      21:24:09,296 ERROR [MainDeployer] Could not start deployment: file:/C:/Program F
      iles/jboss-4.0.4.GA/server/default/tmp/deploy/tmp35721seamapp.ear-contents/seama
      pp.war

      and at the end I got:

      --- Incompletely deployed packages ---
      org.jboss.deployment.DeploymentInfo@751eba08 { url=file:/C:/Program Files/jboss-
      4.0.4.GA/server/default/deploy/seamapp.ear }
      deployer: org.jboss.deployment.EARDeployer@bf053f
      status: Deployment FAILED reason: URL file:/C:/Program Files/jboss-4.0.4.GA/se
      rver/default/tmp/deploy/tmp35721seamapp.ear-contents/seamapp-exp.war/ deployment
      failed
      state: FAILED
      watch: file:/C:/Program Files/jboss-4.0.4.GA/server/default/deploy/seamapp.ear

      altDD: null
      lastDeployed: 1155777846484
      lastModified: 1155777845937
      mbeans:
      persistence.units:ear=seamapp.ear,jar=seamapp.ejb3.jar,unitName=entityManage
      r state: Started
      jboss.j2ee:ear=seamapp.ear,jar=seamapp.ejb3,name=HazardIndexEditorBean,servi
      ce=EJB3 state: Started
      jboss.j2ee:ear=seamapp.ear,jar=seamapp.ejb3,name=HazardIndexFinderBean,servi
      ce=EJB3 state: Started
      jboss.j2ee:ear=seamapp.ear,jar=seamapp.ejb3,name=DefaultHazardIndexSelector,
      service=EJB3 state: Started

      --- MBeans waiting for other MBeans ---
      ObjectName: jboss.web.deployment:war=seamapp.war,id=-1894308984
      State: FAILED
      Reason: org.jboss.deployment.DeploymentException: URL file:/C:/Program Files/j
      boss-4.0.4.GA/server/default/tmp/deploy/tmp35721seamapp.ear-contents/seamapp-exp
      .war/ deployment failed

      --- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
      ObjectName: jboss.web.deployment:war=seamapp.war,id=-1894308984
      State: FAILED
      Reason: org.jboss.deployment.DeploymentException: URL file:/C:/Program Files/j
      boss-4.0.4.GA/server/default/tmp/deploy/tmp35721seamapp.ear-contents/seamapp-exp
      .war/ deployment failed


      Anyway... I killed a couple of days to get these results while I expected to get some working code. So here is a question:
      Can anyone point me to the right direction on how to make it work or where to get workable versions which are working as it is described in Guides?
      All responses are highly appreciated. Thank you very much.




        • 1. Re: Is there a workable version of JBossSEAM?
          None None Master

          Make sure you're using the right version of JBoss!

          JBoss 4.04 GA does not work with Seam apparently.

          You need to get:

          http://sourceforge.net/project/showfiles.php?group_id=22866&package_id=193295&release_id=424215

          Try that and see if it helps.

          • 2. Re: Is there a workable version of JBossSEAM?
            Chuck Adams Novice

            Make sure you use the JEMS installer and the ejb3 profile, as is mentioned in the docs. Edit jboss.home in build.properties in the root of the seam distribution. Then you can build examples. I recommend the booking example, since it comes with a bunch of "help" files you can view while using it that demonstrate seam's features.

            I've never gotten seam to work with eclipse WTP, nor does seam-gen work for me. I continue to vent my spleen about this fact on the forums, but I did have success with netbeans by following this guide: http://weblogs.java.net/blog/bleonard/archive/2006/05/trying_out_jbos.html

            As a bonus, the aforementioned blog entry shows you exactly how seam components replace JSF backing beans, which as a newbie to JSF, I found fairly educational.

            Some people have reported success with java studio creator and its spiffy wysiwyg jsp and page flow editors. Personally I'd like to use drools and jBPM, so I will have to stick with eclipse, but eclipse and seam are both fighting me every step of the way there. Somewhat ironic considering JBoss's close relationship with eclipse.

            • 3. Re: Is there a workable version of JBossSEAM?
              Maurice Zeijen Master

              I got Seam to work with MyEclipse 5.0 in combination with Exadel Studio. Works perfect for me. I used the JBoss 4.04 GA jems installer and used the portal setting. I added the EJB3 libraries myself. I did this to also be able to test the integration with a portal.

              • 4. Re: Is there a workable version of JBossSEAM?
                Thomas Heute Master

                People are reporting that seam-gen is working fine for them in Eclipse, chuckadams, did you succeed now ? what's wrong otherwise ?

                In the meantime we are working on a Eclipse plugin, any volunteer to help ?

                • 5. Re: Is there a workable version of JBossSEAM?
                  Stepan Polyak Newbie

                  Thanks a lot for all your suggestion. I'll spend this day to check all of them. My gole is actually to produce a working code. How it will be done is more or less does not matter.
                  I'll come back with results.
                  I really appreciate all your inputs.

                  • 6. Re: Is there a workable version of JBossSEAM?
                    Stepan Polyak Newbie

                    OK something happening here. Tried combination of JBoss from
                    http://sourceforge.net/project/showfiles.php?group_id=22866&package_id=193295&release_id=424215
                    (thanks SmokingAPipe) and jboss-seam-1.0.1.GA(jboss-seam-1.0.0.CR3 did not work properly) and it works... Good.
                    Will try seam-gen in a minute. I saw that chuckadams had the same problems as I did yesterday. (BTW. Thanks to chuckadams for the info)
                    Let you know as soon as I have something.

                    • 7. Re: Is there a workable version of JBossSEAM?
                      Chuck Adams Novice

                      seam-gen is working for me now, I just had to create the empty bin/ directory (cvs probably pruned it) and make sure I had it installed under the seam distribution. I look forward to getting it running on my work machine today

                      • 8. seam-gen does not work
                        Stepan Polyak Newbie

                        Wasted another day, just to make sure that seam-gen is not working.

                        In JBossSeamGettingStartedGuideStep4
                        After creating a projects... in project sampleEJB... error:
                        Severity and Description Path Resource Location Creation Time Id
                        An EJB module must contain one or more enterprise beans. sampleEJB/ejbModule/META-INF ejb-jar.xml line 2 1155840718987 0

                        In JBossSeamGettingStartedGuideStep5
                        seam-gen...
                        When command seam set-properties...
                        Is this an expected behavior:
                        [java] Aug 17, 2006 3:09:24 PM org.jboss.seam.tool.AbstractSeamGen
                        [java] SEVERE: build.properties (The system cannot find the file specified)

                        [java] Aug 17, 2006 3:09:24 PM org.jboss.seam.tool.BuildPropertiesGenerator
                        generate
                        [java] INFO: Generating a new build.properties file
                        [java] Aug 17, 2006 3:09:24 PM org.jboss.seam.tool.AbstractSeamGen generate
                        File
                        [java] INFO: New File Generated by Seam Gen using: build-properties.ftl

                        So is it expected or no?

                        Next.
                        After issuing "seam scaffold-wtp-project sample" it looks for "src" directory under C:\seam-workspace\jboss-seam-1.0.1.GA\seam-gen
                        and if it is missing build fails. Well I made it happy when I add empty "src" dir there. It did not use it, so why is that directory required?

                        Next difference I notice when I tried to follow the guide to change build path and library dependencies.
                        On the picture I saw "JBOSS 4.0" library... which is missing in my project. Should I add J2EE 1.4 library(JBOSS-IDE)?

                        Besides, When I click on "Add JARs..." I got "JAR selection" window which has red cross and "No entries available".
                        Besides, I looked in "sample" directory and it does not contain "lib" directory.

                        I do not see how it can be worked out from this point on.
                        Of course, your suggestions are welcome

                        • 9. JBossSEAMReverseEngineerGuide is incorrect or software is no
                          Stepan Polyak Newbie

                          Yes... This day is completely waisted. (Still have one more to go till management will kill this idea)

                          Was not able to locate necessary jars at the recommended places, so, got them from:
                          # jboss-annotations-ejb3.jar : $JBOSS_HOME\server\default\deploy\ejb3.deployer
                          # jboss-ejb3x.jar - can be found at: $JBOSS_HOME\server\default\deploy\ejb3.deployer
                          # hibernate-annotations.jar : $JBOSS_HOME\server\default\lib
                          # ejb3-persistence.jar : $JBOSS_HOME\server\default\lib
                          # myfaces-api.jar : $JBOSS_HOME\server\default\deploy\jbossweb-tomcat55.sar\jsf-libs
                          # jboss-seam.jar : $JBOSS_SEAM_1.0.1GA_HOME

                          Needed to change:
                          import javax.ejb.Interceptors;
                          into:
                          import javax.interceptor.Interceptors;

                          Also, in persistance.xml I changed:

                          into:



                          Errors during deploy:

                          13:45:21,154 INFO [SchemaUpdate] Running hbm2ddl schema update
                          13:45:21,154 INFO [SchemaUpdate] fetching database metadata
                          13:45:21,154 INFO [SchemaUpdate] updating schema
                          13:45:21,170 INFO [DatabaseMetadata] table not found: HAZARD_INDEX
                          13:45:21,170 INFO [DatabaseMetadata] table not found: HAZARD_INDEX
                          13:45:21,170 ERROR [SchemaUpdate] Unsuccessful: create table GCORK.HAZARD_INDEX
                          (HAZARD_INDEX_ID bigint not null, HAZARD_INDEX_NAME varchar(30) not null, primar
                          y key (HAZARD_INDEX_ID))
                          13:45:21,170 ERROR [SchemaUpdate] invalid schema name: GCORK in statement [creat
                          e table GCORK.HAZARD_INDEX]
                          13:45:21,170 INFO [SchemaUpdate] schema update complete

                          What happened here(in the log above)? Can you explain?

                          Next error:

                          13:45:21,717 INFO [FacesConfigurator] Reading standard config org/apache/myface
                          s/resource/standard-faces-config.xml
                          13:45:21,983 INFO [FacesConfigurator] Reading config jar:file:/C:/Program Files
                          /jboss-4.0.4.GA/server/default/tmp/deploy/tmp49883seamapp.ear-contents/seamapp.e
                          jb3-contents/jboss-seam.jar!/META-INF/faces-config.xml
                          13:45:21,983 INFO [FacesConfigurator] Reading config /WEB-INF/faces-config.xml
                          13:45:22,014 ERROR [LocaleUtils] Locale name null or empty, ignoring
                          13:45:22,139 INFO [StartupServletContextListener] ServletContext 'C:\Program Fi
                          les\jboss-4.0.4.GA\server\default\.\tmp\deploy\tmp49883seamapp.ear-contents\seam
                          app-exp.war\' initialized.
                          13:45:22,139 ERROR [StandardContext] Error listenerStart
                          13:45:22,139 ERROR [StandardContext] Context [/seamapp] startup failed due to pr
                          evious errors
                          13:45:22,155 WARN [ServiceController] Problem starting service jboss.web.deploy
                          ment:war=seamapp.war,id=1157802242
                          org.jboss.deployment.DeploymentException: URL file:/C:/Program Files/jboss-4.0.4
                          .GA/server/default/tmp/deploy/tmp49883seamapp.ear-contents/seamapp-exp.war/ depl
                          oyment failed

                          What caused this one?

                          Is there any guide following which I will be able to generate the code(using correct version of Eclipse(I'm using 3.2, with JBoss Eclipse IDE 1.6.0 GA, HibernateTools 3.1.0.beta5, with JBoss installation recommended by chuckadams), than please let me know. As I still have one day to burn...

                          Thanks a lot.

                          • 10. Re: Is there a workable version of JBossSEAM?
                            Chuck Adams Novice

                             


                            • When you create a new project, you will always get the "must contain one or more enterprise beans" error. seam-gen will add beans for you and that error will go away. If it doesn't, close the project and reopen it. Eclipse's validators sometimes just get stuck.

                            • The SEVERE warning about the missing build.properties file is normal -- you'll notice it creates it immediately afterward. Ant is just too verbose for its own good.

                            • Create the src directory then run scaffold-wtp-project. If you don't have it first, it won't complete.


                            • 11. Re: Is there a workable version of JBossSEAM?
                              Stepan Polyak Newbie

                               

                              "chuckadams" wrote:


                              • Create the src directory then run scaffold-wtp-project. If you don't have it first, it won't complete.

                              That is what I did. And compilation was "SUCCESSFULL"

                              But this is what was wrong after that:
                              "VotTak" wrote:

                              Next.
                              After issuing "seam scaffold-wtp-project sample" it looks for "src" directory under C:\seam-workspace\jboss-seam-1.0.1.GA\seam-gen
                              and if it is missing build fails. Well I made it happy when I add empty "src" dir there. It did not use it, so why is that directory required?

                              Next difference I notice when I tried to follow the guide to change build path and library dependencies.
                              On the picture I saw "JBOSS 4.0" library... which is missing in my project. Should I add J2EE 1.4 library(JBOSS-IDE)?

                              Besides, When I click on "Add JARs..." I got "JAR selection" window which has red cross and "No entries available".
                              Besides, I looked in "sample" directory and it does not contain "lib" directory.


                              • 12. Re: Is there a workable version of JBossSEAM?
                                Chuck Adams Novice

                                All the lib/ subdirectory is is a copy of ../lib. The lack of a lib directory suggests that either scaffold-wtp-project didn't complete, the project name wasn't provided, or seamgen wasn't installed and run from a subdirectory of a complete seam installation.

                                You should probably paste in the text of your whole session with seam-gen, from set-properties to scaffold-wtp-project. Try it with a new eclipse project, since this one doesn't seem to have been generated right. I recommend creating the server connection first (New->Other->Server. JBoss 4.0 will appear under two menus, it doesn't matter which you use). Then when you create your new enterprise archive project, pick the server you configured, and it should add the correct libs for you.

                                • 13. Re: Is there a workable version of JBossSEAM?
                                  Thomas Heute Master



                                  This:

                                  Needed to change:
                                  import javax.ejb.Interceptors;
                                  into:
                                  import javax.interceptor.Interceptors;


                                  clearly shows that you are not running a good seam/jboss AS combination.

                                  The starting guide states that you need JBoss 1.0.1.GA with the EJB3 profile of JBoss Jems installer

                                  The "necessary Jars" are shipped (for compilation) with JBoss Seam (under the name jboss-ejb3-all.jar)


                                  Finally it seems that you are now running your own example created with the Hibernate tools, you could show us the Java source file so we can help you



                                  • 14. Re: Is there a workable version of JBossSEAM?
                                    Stepan Polyak Newbie

                                     

                                    "chuckadams" wrote:
                                    All the lib/ subdirectory is is a copy of ../lib. The lack of a lib directory suggests that either scaffold-wtp-project didn't complete, the project name wasn't provided, or seamgen wasn't installed and run from a subdirectory of a complete seam installation.

                                    You should probably paste in the text of your whole session with seam-gen, from set-properties to scaffold-wtp-project. Try it with a new eclipse project, since this one doesn't seem to have been generated right. I recommend creating the server connection first (New->Other->Server. JBoss 4.0 will appear under two menus, it doesn't matter which you use). Then when you create your new enterprise archive project, pick the server you configured, and it should add the correct libs for you.



                                    Well... You made me to try it again... I did... and seam-gen generated the code and I was able to get to the end of guide.

                                    Still have some questions.
                                    When I "publish"(using Eclipse 3.2) sample.ear is being moved to $JBOSS_HOME/jboss-4.0.4.GA/server/default,all,minimal/deploy ... And when I start JBoss from $JBOSS_HOME/bin than the example is working(looks like).
                                    If I try to start JBoss from Eclipse than I got error in console "java.lang.NoClassDefFoundError: Files/jboss-4/0/4/GA/bin////lib/endorsed"
                                    and error window (Java Virtual Machine Lancher) "Could not find the main class. Program will exit".
                                    Looks like configuration of JBoss in Eclipse is a bit off, or I miss something.
                                    Any idea?
                                    Thanks