11 Replies Latest reply on Mar 18, 2009 7:03 PM by maxandersen

    seam-gen IDE vs Console

      Hi,

      i'm running into problems using seam-gen on the console and importing the project into eclipse afterwards (eclipse ganymede with jboss tools 2.1GA and seam 2.1) - it simply does not compile properly.

      What i do is run seam-gen from console:

      seam setup -> create-project -> generate

      No problems until here - just a few warnings regarding to not existing unique keys within two tables. In case i deploy from console everything is fine.

      Afterwards i import the project within eclipse, which works fine.

      Deploying fails with the following error messages:

      
      16:58:49,937 ERROR [AbstractKernelController] Error installing to Start: name=persistence.unit:unitName=#seamingo state=Create
      javax.persistence.PersistenceException: [PersistenceUnit: seamingo] Unable to build EntityManagerFactory
       at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:677)
       at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:132)
       at org.jboss.jpa.deployment.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:311)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:597)
       at org.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:59)
       at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:150)
       at org.jboss.joinpoint.plugins.BasicMethodJoinPoint.dispatch(BasicMethodJoinPoint.java:66)
       at org.jboss.kernel.plugins.dependency.KernelControllerContextAction$JoinpointDispatchWrapper.execute(KernelControllerContextAction.java:241)
       at org.jboss.kernel.plugins.dependency.ExecutionWrapper.execute(ExecutionWrapper.java:47)
       at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchExecutionWrapper(KernelControllerContextAction.java:109)
       at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchJoinPoint(KernelControllerContextAction.java:70)
       at org.jboss.kernel.plugins.dependency.LifecycleAction.installActionInternal(LifecycleAction.java:221)
       at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:54)
       at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:42)
       at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
       at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
       at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
       at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
       at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1598)
       at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1062)
       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
       at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:774)
       at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:540)
       at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:121)
       at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:51)
       at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62)
       at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
       at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1178)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)
       at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
       at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1598)
       at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1062)
       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
       at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
       at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)
       at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:545)
       at org.jboss.system.server.profileservice.ProfileServiceBootstrap.loadProfile(ProfileServiceBootstrap.java:304)
       at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:205)
       at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:405)
       at org.jboss.Main.boot(Main.java:209)
       at org.jboss.Main$1.run(Main.java:547)
       at java.lang.Thread.run(Thread.java:619)
      Caused by: org.hibernate.HibernateException: Wrong column type in appserver.bibl for column bib_art. Found: char, expected: varchar(2)
       at org.hibernate.mapping.Table.validateColumns(Table.java:284)
       at org.hibernate.cfg.Configuration.validateSchema(Configuration.java:1116)
       at org.hibernate.tool.hbm2ddl.SchemaValidator.validate(SchemaValidator.java:139)
       at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:349)
       at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1327)
       at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:867)
       at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:669)
       ... 50 more
      



      Any ideas?

      thx a lot

        • 1. Re: seam-gen IDE vs Console
          maxandersen

          the schema validator find something wrong - disable it in your persistence.xml and you should be able to start.

          • 2. Re: seam-gen IDE vs Console

            Hi,

            and thx for your reply - but it didn't help.
            However, i got it going now - i do still don't know why, but maybe i'll find out in near future.

            • 3. Re: seam-gen IDE vs Console
              maxandersen

              if it didn't work it means you didn't disable the schema validator since the stacktrace will only happen if it is enabled.

              If it just started working it is probably because you adjusted some properties..

              • 4. Re: seam-gen IDE vs Console

                Is there documentation for creating a Seam project in the Eclipse Bundle (JBoss Developer Studio)? The first-time user experience has to be nothing short of bewildering because the documentation is specific to a given tools version, Seam version, seam-gen version. As usual, this will give ammo to those looking to shoot it down.

                As far as building projects, what has worked marvelously for many years (from J2EE through Java EE) has been a custom ant script whose tasks we fired off seamlessly (NPI) from the Ant view. The script grows with the project, and both the command-line and Eclipse are oblivious to what it does.

                Enter seam-gen. So, we'd like to use seam-gen rather than evolve our build script from scratch, and use it for command-line builds (e.g., nightly build) or server with no Eclipse installed. We also want to use the same script from the IDE via the Ant view, just like the good 'ol days.

                If experienced Eclipse and JBoss developers find this whole documentation situation messy, imagine the terror experienced by an adventuresome Ruby addled developer looking to break out of their gilded cage?



                • 5. Re: seam-gen IDE vs Console
                  maxandersen

                  eh - where is it tied to a specific version ?

                  We support Seam 1.2, Seam 2.0 and Seam 2.1 - of course various bugs have been fixed in these but the tooling works with all three.

                  If you want to use Ant then fine, do that - but what do you want me to document besides what is already listed in Seam docs about how to use seam-gen ?

                  Repeating what is in seam about seam-gen would just make sure our docs is even more tied to a specific version, right ?

                  • 6. Re: seam-gen IDE vs Console

                     

                    "max.andersen@jboss.com" wrote:
                    if it didn't work it means you didn't disable the schema validator since the stacktrace will only happen if it is enabled.

                    If it just started working it is probably because you adjusted some properties..


                    Well, what i really did is the following:
                    Create CRUD with seam-gen.
                    Import as existing Java project into JEE Eclipse (Ganymede)
                    Customize Ant-Scripts
                    Voila!

                    As i wasn't quite sure which flag needs to be (un-)set for the schema validator (auto, false, etc. (btw: i am assuning the hibernate schema validator was meant)) i only tried it once (setting to false) and it didn't work.

                    My comments to documentation: i think Seam documentation is quite good - compared to former JBoss releases and e.g. SAP Products ;)


                    • 7. Re: seam-gen IDE vs Console

                      Just to give one example, is this really required?

                      http://seamframework.org/Documentation/UsingICEFacesWithJBossToolsGeneratedProjects

                      I want to install the IDE, run a wizard, pick the options, compile, deploy and run out of the box. Every JBoss IDE has been a dud since 1.0 in my personal experience.

                      Having said that, installing JBoss and Eclipse separately, adding plug-ins as you go, and fleshing out your build script is pretty easy, and you know what you have, precisely. So I am doing that but using seam-gen as a kick-start.

                      On a possibly related note, Dan Allen of Seam in Action fame seems to have punted on even trying to give JBoss Tools a good treatment due to constant changes. Just anecdotal, of course.

                      • 8. Re: seam-gen IDE vs Console
                        maxandersen

                        You are mixing up a couple of things here ;)

                        1) ICEFaces support - tell me who you know who will maintain and QA this and it will be done. Right now icefaces is totally separate config and setup from Richfaces and similar Seam-gen projects does not comply with WTP projects or maven or anything else for that matter - meaning we need to choose which things to focus on since all the combinations are not possible.

                        2) I don't know what problems you have had with JBossIDE and JBoss Tools but I can Install JBoss Developer Studio, run the seam wizard, pick options, compile, deploy and it runs out of the box (similar things I can do for JBoss tools but I have to bring my own eclipse, appserver and seam download) so for me to help you, you need to be more specific about what the problems are. Are you expecting we have configuration options for all JSF library out there ? Did something error during deploy ? compile ? the wizard ? More details please :)

                        3) Dan Allen, Pete Muir and I are trying to find a good way of marrying seam-gen and the rest of the world without having to maintain N x N integration points. Any input is welcome!

                        4) About the link then you could also just use seam-gen, select richfaces and things would work too if you go right click the project and enable seam (automatic deploy wont work though since seam-gen is ant driven and not WTP driven so you could use project archives for that)

                        • 9. Re: seam-gen IDE vs Console
                          bdlink

                          I think there are several issues here, but I am reinstalling everything at the moment and trying a Linux 64 stack so I am not sure of the situation since 3.0.GA (have been using the nightlies). When I was driving to work today, I was thinking that JBT/seam-gen integration was a big remaining issue, so was surprised to find a related topic already posted :-) Before I get started, congratulations to the JBT team on their 3.0 GA release! That is quite a milestone.

                          1. Last I looked, seam-gen had a few more features than JBT version (such as allowing generating the model separately from the UI CRUD) so it would be nice to take a seam-gen project, import it into JBT and run it from there. Seam-gen tells you to import the project (they do create an eclipse project) into eclipse as a general project. Doing that and adding the seam runtime in the properties file did not (last checked) allow using the JBoss tool to deploy the project to the server or use JBT tools to add new entities, etc. Without autodeploy you are slowed down a lot!

                          2. We have had issues with eclipse autobuild messing things up when using seam to deploy (since seam will also build things).

                          3. As I understand Dan Allen's blogs there are inherent differences between the way Eclipse builds a project (not using ant) and seam-gen (using ant). It would be nice to resolve this so it is not an issue.

                          4. seam-gen ear does not generate the multiple projects which have been the eclipse style for ear projects (and which JBT converted to a while ago). This is a seam issue that would be nice to "fix" (or a nice feature to add on the seam side).

                          As I read max.anderson's post, he does not seem to say that starting with a command-line seam-gen project, importing it into JBT and continuing with JBT works. He seems to be saying that starting with JBT and continuing with JBT works (I should hope so). Starting with seam-gen command line and staying with that also works.

                          I think the biggest confusion at the moment, is how plain seam and JBT can work together (if they can). If not, clarify that a seam-gen project can be imported into Eclipse but only if JBT is not installed. At the moment it looks like you have to stay with what you start from, JBT or seam-gen command line. After the huge effort to move to eclipse 3.4.2 (which is greatly appreciated), maybe more effort on JBT/seam-gen integration. I admit I do not understand the issues around ant versus WTP driven build/deploy and how hard that is to bridge. I am speaking as a user here.

                          Note that Dan Allen, in "Seam in Action" "Choosing an IDE" says "I find NetBeans easier to get into if you are a new user" I would hope this opinion can change, since NetBeans does not have the functionality that JBT has!

                          • 10. Re: seam-gen IDE vs Console

                            I can't complain with vague statements about stuff not compiling or running, and have moved on to JBoss AS 5.X plus stand-alone Eclipse. So probably I won't have any more feed back on JBoss-Tools for a while.

                            • 11. Re: seam-gen IDE vs Console
                              maxandersen

                               

                              "bdlink" wrote:
                              Before I get started, congratulations to the JBT team on their 3.0 GA release! That is quite a milestone.


                              Thanks! :)


                              1. Last I looked, seam-gen had a few more features than JBT version (such as allowing generating the model separately from the UI CRUD)


                              JBT have Hibernate tools code generation which gives the exact same features (and more).

                              For the Generate Entities wizard we added the option of Generating UI from the model (being able to skip the ui generation step) - I guess we should also add in a "Generate Model only" option. We missed that this time around but it is trivial to add so please - Open a jira and vote for it!


                              so it would be nice to take a seam-gen project, import it into JBT and run it from there. Seam-gen tells you to import the project (they do create an eclipse project) into eclipse as a general project.


                              Yup and that usecase is supported by us now (we added it in JBoss Tools 2.1 i believe)


                              Doing that and adding the seam runtime in the properties file did not (last checked) allow using the JBoss tool to deploy the project to the server or use JBT tools to add new entities, etc. Without autodeploy you are slowed down a lot!


                              seam-gen projects are not automatic deployable since they depend on what I normally call "Ant voodoo magic" - such as renaming files, doing property replacement and not having any standard locations for its files.

                              BUT you can use project archives to get very close to autodeploy assuming you call the "ant voodoo magic" before hand - which is doable. Dan Allen talked about adding project archives support for plain seam-gen projects out of the box.


                              2. We have had issues with eclipse autobuild messing things up when using seam to deploy (since seam will also build things).


                              Yes, see "ant voodoo magic" from above ;)


                              3. As I understand Dan Allen's blogs there are inherent differences between the way Eclipse builds a project (not using ant) and seam-gen (using ant). It would be nice to resolve this so it is not an issue.


                              Yes, but how would you resolve it ?

                              Remove Ant -> no command line build

                              Use only Ant -> Loose all the intelligence that Eclipse can provides via its incremental system.


                              4. seam-gen ear does not generate the multiple projects which have been the eclipse style for ear projects (and which JBT converted to a while ago). This is a seam issue that would be nice to "fix" (or a nice feature to add on the seam side).


                              Yes, I believe both options should be in seam-gen since that is actually doable.


                              As I read max.anderson's post, he does not seem to say that starting with a command-line seam-gen project, importing it into JBT and continuing with JBT works.


                              No, I actually tried to say that you can use all the features of our Seam tooling with seam-gen'ed projects *except* the WTP based deploy functionallity.

                              All wizards, editors and actions we have done what we could to make possible to run/use independent of project structure or even WTP.


                              He seems to be saying that starting with JBT and continuing with JBT works (I should hope so). Starting with seam-gen command line and staying with that also works.


                              That both works :)


                              I think the biggest confusion at the moment, is how plain seam and JBT can work together (if they can). If not, clarify that a seam-gen project can be imported into Eclipse but only if JBT is not installed. At the moment it looks like you have to stay with what you start from, JBT or seam-gen command line. After the huge effort to move to eclipse 3.4.2 (which is greatly appreciated), maybe more effort on JBT/seam-gen integration.


                              We would love contributions in this area!


                              I admit I do not understand the issues around ant versus WTP driven build/deploy and how hard that is to bridge. I am speaking as a user here.


                              Ant is basically Random from the perspective of an IDE.

                              We could limit what the build.xml in seam-gen does and implement the same logic done by the ant scripts in JBoss Tools BUT as soon as seam-gen changes just the slightest we would be screwed (or rather our users would be). That is why we currently are syncing on what we can sync on - i.e. the templates. The library dependencies are next (i.e. mavenized).


                              Note that Dan Allen, in "Seam in Action" "Choosing an IDE" says "I find NetBeans easier to get into if you are a new user" I would hope this opinion can change, since NetBeans does not have the functionality that JBT has!


                              I'm doing what I can to let Dan Allen contribute to make JBT/JBDS his favorite choice :)