11 Replies Latest reply on Feb 23, 2010 10:35 AM by daxxy

    Content assist not working in .xhtml files

    daxxy

      FTR I am having this problem with JBDS 3.X and with Galileo eclipse, but Max A. asked me to post it here so I'm doing so.  I had downloaded JBDS 3.0 hoping the problem would be "fixed", but it's not.

       

      I'm using Seam EAP5.0 and generated my project with seam-gen.

       

      I get no content assistance in xhtml files beyond basic html.  Here is the head of one of my xhtml files in case it helps:

       

      <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <ui:composition xmlns="http://www.w3.org/1999/xhtml"
        xmlns:s="http://jboss.com/products/seam/taglib"
        xmlns:ui="http://java.sun.com/jsf/facelets"
        xmlns:f="http://java.sun.com/jsf/core"
        xmlns:h="http://java.sun.com/jsf/html"
        xmlns:a4j="http://richfaces.org/a4j"
        xmlns:rich="http://richfaces.org/rich"
        template="layout/template.xhtml">

       

       

      I do get content assistance for tag completion, but not tag initiation/insertion.


      I tried enabling JSF Capabilities because Max suggested that in an email, but when I try to do that I get this error message:

       

      Web descriptor file is corrupted : Editor model does not support child element persistence-unit-ref of web-app:0:0.

       

      I should note that while this current project is in the process of development, I keep a pristine command line seam-genned version of it handy for reference.  I observe exactly the same behavior on that project.

       

      Just for grins, I am trying to generate a seam project from within JBDS and so far it's stuck on "Validation at 14%"

       

      TDR

        • 1. Re: Content assist not working in .xhtml files
          akazakov

          I reproduced the bug and added it to JIRA. See https://jira.jboss.org/jira/browse/JBIDE-5712

          As workaround you can comment <persistence-unit-ref> element in web.xml then add JSF capabilities and then uncomment persistence-unit-ref again.

          Please let us know it content assist will work after that.

          • 2. Re: Content assist not working in .xhtml files
            daxxy

            When adding JSF Capabilities the default in the Project Folders dialog box is to leave the "Lib folder" blank and "Add Libraries" unchecked.

             

            It seems odd that adding JSF capabilities does not involve adding libraries. Is this correct?

            • 3. Re: Content assist not working in .xhtml files
              akazakov

              Your project already has JSF-libs. They are placed in <poject>/lib folder. Some of them are added to the project classpath and avaliable for Eclipse/WTP/JBT and some of them will be used when you deploy the application to a Server (via generated ant script).

              But if you prefer to use JBoss Tools Server Adapter instead of ant script for deploying (see Server View) then I recomend you to generate project via New Web Seam Project wizard. This wizard will configure everithing you need for Eclipse/WTP/JBT.

              • 4. Re: Content assist not working in .xhtml files
                daxxy

                I tried generating a new project via the wizard.

                It was too painful to continue and I don't have time to try it again and report on exactly what occurred.

                 

                Then what does it mean to add JSF Capabilities?

                 

                Anyhow, I added them and there is no difference in this behavior.

                 

                Thanks,

                TDR

                • 5. Re: Content assist not working in .xhtml files
                  akazakov

                  If you use JBoss Developer Studio (not just JBoss Tools) and use the bundled application server (it's important to have Server and Seam runtime configured automaticly) then creating a seam project via the wizard is supposed to be a very simple. Just type a name of the project and press Finish. That's it! If it is not so then it seems to be a bug.

                  Adding JSF-Capabilities is to be a feature which do three things:

                  1. If needed we configure a plain Java project for Eclipse Web Tools (we extend it). There we add some settings for it.

                  2. If needed we configure the project for JBoss Tools. We add some settings for it.

                  3. If needed we add some specific JSF settings/resources for the project to make it a real JSF project.

                  In your case step 3 is not imortant because a seam-gened project already has all needed JSF settings (in faces-config.xml, web.xml, etc).

                   

                  What kind of code assist still doesn't work in your project?

                  • 6. Re: Content assist not working in .xhtml files
                    daxxy

                    OK, I did get my seam project to build from the JBDS wizard and content assist *does* work in that project. Yay.

                     

                     

                    There's a lot I still don't get about the project created via the wizard.  I'd like to understand it better.

                     

                    Should I just contact support and open a new case for that?

                    • 7. Re: Content assist not working in .xhtml files
                      maxandersen

                      Tanya,

                       

                      What are the problems you have with the wizard ? It is basically just a wrapper for what seam-gen does.


                      p.s. about adding JSF Capabilities then we trying to move away from polluting with outofdate libraries and instead let you use

                      the actual runtimes libraries or something like maven. Thus adding jsf capabilities is more about configuration and enabling the proper

                      features in the IDE.

                       

                      p.s. you can open cases with support if you prefer that, but that is mostly for the GA releases. For the release candidates it will go faster here.

                      -max

                      • 8. Re: Content assist not working in .xhtml files
                        daxxy

                        It's just confusing to someone who is used to command-line seam-gen.  There are now four projects where there used to be one.  Further confusion for someone who is fairly new to the whole J2EE model.  I'm starting to "get" the delineation between ejb, ear, and web.  And I'm used to deploying my app using  ant either from eclipse or from the command-line.

                         

                        I'm NOT used to seeing apps listed under the server in the server view and this concept of adding and removing projects from the server confuses me.  I dont' really understand what publishing and synchronising means.  I'm used to simply deploying, exploding, and restarting.

                         

                        Further confusion caused by my creating 2 projects with the wizard, removing one from the server, and subsequently not finding that one in my browser because I thought I was looking at the other one. :-)

                         

                        At the moment, the only problem I'm having is that the entities created

                         

                        I'm currently having this problem described here: https://forum.hibernate.org/viewtopic.php?p=2393404. I'll figure out how to work around that.

                         

                        And one other problem -- that is when I try to browse data in my seam-gen generated <Entity>List.seam, I get the same error on each one:

                         

                        07:59:10,377 INFO  [STDOUT] Hibernate:
                            select
                                offices0_.office_id as office1_40_,
                                offices0_.addr1 as addr2_40_,
                                offices0_.addr2 as addr3_40_,
                                offices0_.building as building40_,
                                offices0_.city as city40_,
                                offices0_.contact_name as contact6_40_,
                                offices0_.contact_phone as contact7_40_,
                                offices0_.dds_software as dds8_40_,
                                offices0_.lan as lan40_,
                                offices0_.last_update as last10_40_,
                                offices0_.pstn_phone as pstn11_40_,
                                offices0_.rocc as rocc40_,
                                offices0_.state as state40_,
                                offices0_.video_units as video14_40_,
                                offices0_.voip as voip40_,
                                offices0_.workstation_count as worksta16_40_,
                                offices0_.zip as zip40_
                            from
                                new_ond.new_ond.offices offices0_ limit ?
                        07:59:10,378 WARN  [JDBCExceptionReporter] SQL Error: 1064, SQLState: 42000
                        07:59:10,378 ERROR [JDBCExceptionReporter] You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.offices offices0_ limit 26' at line 1
                        07:59:10,379 SEVERE [viewhandler] Error Rendering View[/OfficesList.xhtml]

                        <huge stack trace deleted>

                         

                        this: new_ond.new_ond.offices offices0_ limit ?

                        should be this: new_ond.offices offices0_ limit ?


                        I can probably figure out where the extra new_ond is coming from and anyway if this turns out to be a problem I'll open a new discussion.

                         

                        I'm going to port the work I've already done in my app to the wizard-generated app and see how that goes.  Content Assist does work in that one!!

                         

                        Thanks for your help and interest,

                        TDR

                        • 9. Re: Content assist not working in .xhtml files

                          Hi,

                           

                          I have the same problem with the SQL statement. Did you solve it?

                           

                          Thanks,

                          Rani.

                          • 10. Re: Content assist not working in .xhtml files

                            Hi,

                             

                            I think I found a solution to my problem. It is related to the problem described in: http://community.jboss.org/message/525587#525587

                             

                            Thanks,

                            Rani.

                            • 11. Re: Content assist not working in .xhtml files
                              daxxy

                              Yes, I solved the sql problem.  You should not specify your db name in both your connect string AND in default_catalog.

                              One or the other.  Mine was defined in both places and hence it showed up twice in the query.