8 Replies Latest reply on Feb 2, 2010 2:33 PM by akazakov

    Code assist does not work in dvdstore example

    asookazian

      using Eclipse Galileo SR1, JBT 3.1.0.CR1

       

      I installed the Seam dvdstore application (4 projects in total generated in my workspace) via the Eclipse Help --> Project Examples.

       

      I corrected the server runtimes as they were pointed by default to EAP (which I don't have).  All errors in the problems view are now gone.

       

      The code completion in the xhtml files does not work (pop-up works but the values I'm expecting to be there for selection are not there).

       

      Exception stack trace when I try to modify the xhtml file:

       

      java.lang.ArrayStoreException
      at java.lang.System.arraycopy(Native Method)
      at java.util.ArrayList.toArray(ArrayList.java:306)
      at org.jboss.tools.jst.web.kb.internal.JspContextImpl.getVars(JspContextImpl.java:87)
      at org.jboss.tools.jst.web.kb.el.AbstractELCompletionEngine.resolve(AbstractELCompletionEngine.java:98)
      at org.jboss.tools.jsf.web.validation.ELValidator.validateElOperand(ELValidator.java:410)
      at org.jboss.tools.jsf.web.validation.ELValidator.validateELExpression(ELValidator.java:376)
      at org.jboss.tools.jsf.web.validation.ELValidator.validateEL(ELValidator.java:283)
      at org.jboss.tools.jsf.web.validation.ELValidator.validateDom(ELValidator.java:325)
      at org.jboss.tools.jsf.web.validation.ELValidator.validateFile(ELValidator.java:276)
      at org.jboss.tools.jsf.web.validation.ELValidator.validate(ELValidator.java:159)
      at org.jboss.tools.jst.web.kb.internal.validation.ValidatorManager.validate(ValidatorManager.java:92)
      at org.jboss.tools.jst.web.kb.internal.validation.ValidatorManager.validateInJob(ValidatorManager.java:75)
      at org.eclipse.wst.validation.internal.operations.ValidatorJob.run(ValidatorJob.java:78)
      at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

       

      session data:

       

      eclipse.buildId=M20090917-0800

       

      from Eclipse error log view.

       

      Here is the .projects file contents:

       

      <?xml version="1.0" encoding="UTF-8"?>
      <projectDescription>
          <name>dvdstore</name>
          <comment></comment>
          <projects>
          </projects>
          <buildSpec>
              <buildCommand>
                  <name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
                  <arguments>
                  </arguments>
              </buildCommand>
              <buildCommand>
                  <name>org.eclipse.jdt.core.javabuilder</name>
                  <arguments>
                  </arguments>
              </buildCommand>
              <buildCommand>
                  <name>org.eclipse.wst.common.project.facet.core.builder</name>
                  <arguments>
                  </arguments>
              </buildCommand>
              <buildCommand>
                  <name>org.eclipse.wst.validation.validationbuilder</name>
                  <arguments>
                  </arguments>
              </buildCommand>
              <buildCommand>
                  <name>org.jboss.tools.common.verification.verifybuilder</name>
                  <arguments>
                  </arguments>
              </buildCommand>
              <buildCommand>
                  <name>org.jboss.tools.seam.core.seambuilder</name>
                  <arguments>
                  </arguments>
              </buildCommand>
              <buildCommand>
                  <name>org.hibernate.eclipse.console.hibernateBuilder</name>
                  <arguments>
                  </arguments>
              </buildCommand>
              <buildCommand>
                   <name>org.jboss.tools.jst.web.kb.kbbuilder</name>
                   <arguments>
                   </arguments>
               </buildCommand>
          </buildSpec>
          <natures>
              <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
              <nature>org.eclipse.jdt.core.javanature</nature>
              <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
              <nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
              <nature>org.eclipse.wst.jsdt.core.jsNature</nature>
              <nature>org.jboss.tools.jsf.jsfnature</nature>
              <nature>org.jboss.tools.seam.core.seamnature</nature>
              <nature>org.hibernate.eclipse.console.hibernateNature</nature>
               <nature>org.jboss.tools.jst.web.kb.kbnature</nature>
          </natures>
      </projectDescription>

        • 1. Re: Code assist does not work in dvdstore example
          asookazian

          Well, I just tried typing a new JSF component in an existing xhtml file and the code assist does work!

           

          <h:inputText value="#{cart.cart.}"/>

           

          In fact, it's showing selections for tags as well as API assist and javadocs.

           

          It works when modifying the existing EL expressions as well.

           

          I did re-start Eclipse so not sure if that solved the problem or what.

           

          But it still doesn't work in this particular case in browse.xhtml:

           

          <f:param name="id" value="#{item.productId}"/>

           

          When I type #{item.} I don't see productId in the assist window popup.

          • 2. Re: Code assist does not work in dvdstore example
            asookazian

            What I just noticed is that if you create a Dynamic Web project you get a WebContent folder inside your project.  If you create a Java project you get a WEB-ROOT folder instead.

             

            As long as I create a Dynamic Web project and add JSF capability, the content assist seems to work.

             

            Is this a requirement then to ensure CA works?  You must have a Dynamic web project?

            • 3. Re: Code assist does not work in dvdstore example
              akazakov

              This java.lang.ArrayStoreException has been fixed for JBT 3.1.0 CR2.

              Is this a requirement then to ensure CA works?  You must have a Dynamic web project?

              Some kinds of CA need a Dynamic web projects. But CA for Seam EL needs Seam support to be enabled only. It will work even in a plain java project.

              1 of 1 people found this helpful
              • 4. Re: Code assist does not work in dvdstore example
                asookazian

                I have several projects for my Seam app.  The build is managed/processed by Maven 2.  If I add Seam support, I see a dialog which is asking for directories that don't necessarily apply to my projects.  This is not a seam-gen'd project.

                 

                For example, the domain layer is in its own project, the xhtml files are in its own project, the Seam backing beans are in its own project, etc.

                 

                So what files exactly are modified (I know at least .project) when I add Seam support via project properties?

                 

                I need to know if any "damage" will be done when I add the Seam support to my web project with the xhtml files in case I need to undo it...

                • 5. Re: Code assist does not work in dvdstore example
                  asookazian

                  I just tried adding the seamnature in the .project file and the CA does not work in the xhtml for the Seam backing bean:

                   

                  <h:outputText value="#{cardBillingAndSettlementEditorUI.}" />

                   

                  I don't see any usable values popup when I hit ".".

                   

                  .project file:

                   

                  <natures>
                          <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
                          <nature>org.eclipse.jdt.core.javanature</nature>
                          <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
                          <nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
                          <nature>com.atlassw.tools.eclipse.checkstyle.CheckstyleNature</nature>
                          <nature>org.jboss.tools.jsf.jsfnature</nature>
                          <nature>org.jboss.tools.jst.web.kb.kbnature</nature>
                          <nature>org.jboss.tools.seam.core.seamnature</nature>
                      </natures>

                   

                  Looks like there is a Seam facet as well in project facets.

                   

                  I just tried Help --> Project examples in Eclipse and got 3 booking projects.  The CA works very well in book.xhtml I just tried.  So it's a matter of proper config and understanding how to do it with a Maven project.

                  • 6. Re: Code assist does not work in dvdstore example
                    asookazian

                    I have added JSF capability to my web project.

                     

                    I have added the appropriate seamnature config in .project file.

                     

                    I am seeing the following in the project nature:

                     

                    "Dynamic web module 2.4 cannot be uninstalled."

                     

                    I have checked Seam for project facet (2.1).

                     

                    I also selected Dynamic web project with Seam 2.1 in the drop-down.

                     

                    So how can I manually add Seam facet to my project?

                     

                    I have the following selected in project facet:

                     

                    Dynamic web module 2.5

                    Java 5.0

                    JSF 1.2

                    Seam 2.1

                     

                    only revert or cancel buttons are enabled.

                    • 7. Re: Code assist does not work in dvdstore example
                      asookazian

                      Ok, CA works for my xhtmls now in my Mavenized project.

                       

                      I had to remove JSF capabilities, add JSF capabilities, add Seam support, add Seam facet.

                       

                      Is this the correct steps?

                      • 8. Re: Code assist does not work in dvdstore example
                        akazakov

                        If you enalbe seam support by UI (Project Properties->Seam Settings) it's much safer then trying editing .project and other settings file manually.

                        Adding Seam nature to .project file is not enough. Our tools configure a lot of things in .project (Seam nature and builder + KB nature and builder) and in .settings/ folder.