13 Replies Latest reply on Jan 15, 2010 11:00 AM by akazakov

    Some JBoss Tools features doesn't work with seam-gen project

    piotr.sobczyk

      Hello, we are already using 3.1.0-M4 of JBoss Tools, however we had the same problem before we did update to this release. We are working on  two Seam projects, one is generated by seam-gen and another by JBoss Tools wizard. As far as I'm concerned JBoss Tools should work equally good with both seam-gen and JBoss Tools generated project however features such that:

      • Content Assist in xhtml files for rich,a,f,h namespaces doesn't work in seamgen project and work perfectly in JBoss Tools project (even if I explicitly point these namespaces along with URIs in Visual/Source -> Page design options -> Included Tag Libs)
      • The same for content assist that helps developer to select path inside project (for example /templates/template.xhtml etc.)
      • Clicking on path for example <ui:include src="/components/productCard.xhtml"> with ctrl pressed doesn't change active file for the file pointed by link

       

      Possibly there is more of it. I listed these about just a fast examination. Is there any way to enable these features while working with seam-gen project. They are all extremely useful. Thanks in advance.

        • 1. Re: Some JBoss Tools features doesn't work with seam-gen project
          maxandersen
          Did you enable Seam and JSF on the seam-gen generated project when you imported it into JBoss Tools ?
          • 2. Re: Some JBoss Tools features doesn't work with seam-gen project
            piotr.sobczyk
            Thanks for reply, Max. Can you be a little more specific about "enabling project as JSF and Seam Project"? With no doubt the project is recognized by JBoss Tools as Seam project because I have many of advanced options avialbe and working like Seam Refracotor and all editors from JBoss Tools. How can I explicitly specify that it's JSF and Seam project?
            • 3. Re: Some JBoss Tools features doesn't work with seam-gen project
              maxandersen

              Im M4 and before: Right click on the project and look in Project Properties for a Seam preference page. It should have Seam enabled.

               

              Post-M4: Right click project and use the Configure menu.

              • 4. Re: Some JBoss Tools features doesn't work with seam-gen project
                piotr.sobczyk
                Max, I'm on 3.1.0-M4 and have "Seam support" selected in Seam settings and Seam runtime pointed if that matters. In configure options I don't yet have conversion to Seam project. Generally my project behaves like Seam project but with excerpt of features I pointed out at first post :-(.
                • 5. Re: Some JBoss Tools features doesn't work with seam-gen project
                  akazakov
                  Can you show .project file from your seam-gen project? You can find it in the root folder of the project.
                  • 6. Re: Some JBoss Tools features doesn't work with seam-gen project
                    piotr.sobczyk

                    Sure I can, here is my .project file:

                     

                    <?xml version="1.0" encoding="UTF-8"?>
                    <projectDescription>
                        <name>Shopping</name>
                        <comment></comment>
                        <projects>
                        </projects>
                        <buildSpec>
                            <buildCommand>
                                <name>org.eclipse.jdt.core.javabuilder</name>
                                <arguments>
                                </arguments>
                            </buildCommand>
                            <buildCommand>
                                <name>org.eclipse.ui.externaltools.ExternalToolBuilder</name>
                                <triggers>auto,full,incremental,</triggers>
                                <arguments>
                                    <dictionary>
                                        <key>LaunchConfigHandle</key>
                                        <value>&lt;project&gt;/explode.launch</value>
                                    </dictionary>
                                </arguments>
                            </buildCommand>
                            <buildCommand>
                                <name>org.eclipse.ui.externaltools.ExternalToolBuilder</name>
                                <triggers>auto,full,incremental,</triggers>
                                <arguments>
                                    <dictionary>
                                        <key>LaunchConfigHandle</key>
                                        <value>&lt;project&gt;/.externalToolBuilders/restart.launch</value>
                                    </dictionary>
                                </arguments>
                            </buildCommand>
                            <buildCommand>
                                <name>org.jboss.tools.seam.core.seambuilder</name>
                                <arguments>
                                </arguments>
                            </buildCommand>
                            <buildCommand>
                                <name>org.jboss.tools.jst.web.kb.kbbuilder</name>
                                <arguments>
                                </arguments>
                            </buildCommand>
                        </buildSpec>
                        <natures>
                            <nature>org.eclipse.jdt.groovy.core.groovyNature</nature>
                            <nature>org.eclipse.jdt.core.javanature</nature>
                            <nature>org.hibernate.eclipse.console.hibernateNature</nature>
                            <nature>org.jboss.tools.seam.core.seamnature</nature>
                            <nature>org.jboss.tools.jst.web.kb.kbnature</nature>
                        </natures>
                    </projectDescription>

                    • 7. Re: Some JBoss Tools features doesn't work with seam-gen project
                      piotr.sobczyk
                      One more thing I forgot to say: in seamgen project I'm using Seam 2.2.0 GA and in JBoss Tools project I'm using Seamn 2.1.2 GA, however in a one of recent topics you said that JBoss Tools supports Seam 2.2.0.
                      • 8. Re: Some JBoss Tools features doesn't work with seam-gen project
                        akazakov

                        Ok. I reproduced the issues.

                         

                        There are not the libs with TLDs/Facelet libs for Richfaces and JSF Core/HTML components in classpath in seam-gen projects.

                        So JBT can't find corresponding libs for http://java.sun.com/jsf/core, http://java.sun.com/jsf/html, ... namespaces.

                         

                        How you can fix this issue:

                        1. Add all needed libs to the project classpath (For example h, f TLDs are here <jboss.home>\<server.name>\default\deploy\jbossweb.sar\jsf-libs\jsf-impl.jar). See Project Properties->Java build path->Libraries->Add external jars.

                        Or

                        2. Migrate your seam-gen project to JBT project structure. Just move all sources and pages to new created Seam project created via JBT Seam Wizard. This wizard creates projects which have all needed libs in classpath.

                         

                        BTW 2nd way will fix the second issue (code assist for <ui:include src="" ) too.

                        seam-gen project is not a dynamic web project (it's Eclipse WTP project structure which we extend) and it means we don't know where is WebRoot folder in the project. So we don't provide CA for plain Java Projects (which is not a web dynamic project) for anything that needs to know where WebRoot is.

                        Ideally we could handle it for Seam projects because there is "view folder" property in Seam settings page but this CA feature (code assist for <ui:include src="" ) is not Seam specific but JSF/Facelet specific.

                        And again New Seam Web Project wizards creates Dynamic Web project which works fine.

                        • 9. Re: Some JBoss Tools features doesn't work with seam-gen project
                          maxandersen

                          akazakov wrote:

                           

                          Ok. I reproduced the issues.

                           

                          There are not the libs with TLDs/Facelet libs for Richfaces and JSF Core/HTML components in classpath in seam-gen projects.

                          So JBT can't find corresponding libs for http://java.sun.com/jsf/core, http://java.sun.com/jsf/html, ... namespaces.

                           

                          How you can fix this issue:

                          1. Add all needed libs to the project classpath (For example h, f TLDs are here <jboss.home>\<server.name>\default\deploy\jbossweb.sar\jsf-libs\jsf-impl.jar). See Project Properties->Java build path->Libraries->Add external jars.

                          Or

                          2. Migrate your seam-gen project to JBT project structure. Just move all sources and pages to new created Seam project created via JBT Seam Wizard. This wizard creates projects which have all needed libs in classpath.

                           

                          hmm....I guess it just picks it up from the runtime classpath from the server, right ?

                           

                          This is tricky - by making our codecompletion more complete and correct we lose the ability to work on projects which don't really include the libraries.

                           

                          Don't really got a good answer for this one...

                          • 10. Re: Some JBoss Tools features doesn't work with seam-gen project
                            maxandersen
                            I've opened https://jira.jboss.org/jira/browse/JBIDE-5650 to track this issue.
                            • 11. Re: Some JBoss Tools features doesn't work with seam-gen project
                              akazakov
                              The issue has been fixed for JBT 3.1.0 CR2
                              • 12. Re: Some JBoss Tools features doesn't work with seam-gen project
                                maxandersen

                                Nice!

                                 

                                The jira talks about using xcatalog for TLD for common libraries - does this mean that if a user can do the same for other libraries ? i.e. he can add tld to xcatalog for his own library as long as the namespaces in the file and catalog matches ?

                                 

                                And what about other resources ? Wasn't there other resources than TLD that a user could be missing on the classpath if he haven't included the runtime ?

                                • 13. Re: Some JBoss Tools features doesn't work with seam-gen project
                                  akazakov

                                  Yes, user can add his own TLD/Facelet lib to the XML Catalog and it will be picked up by CA.

                                  See http://screencast.com/t/ZjdkODBiZmEt