8 Replies Latest reply on Sep 20, 2010 5:43 AM by scabanovich

    Resources folder is missing in a project root directory

    nimo22

      I use composite components and place resources-folder within the META-INF/resources.

       

      and declare it in facelets page:

       

      xmlns:comp="http://java.sun.com/jsf/composite/myComp"

       

      Jboss Tools says:

       

      Resources folder "/resources/myComp" is missing in a project root directory

       

       

      But it still exists! Hence, code completion does also not work when embeed composite components.

       

      My Maven-WAR-Structure consists of 3 Resources-Folders:

       

      scr/main/resources

      webapp/META-INF/resources/

      webapp/resources

       

      Where is the recommended place?

       

       

      I put it into webapp/resources and deploying works - the composite component can be found by the container. But Jboss Tools complains.

       

       

      Is this a bug?

       

      I use actual JBOSS TOOLS 3.2 M1 with Eclipse Helios.

        • 1. Re: Resources folder is missing in a project root directory
          mareshkau

          Hi Nimo,

          Yes, looks like a bug. Is JSF compapatibilities enabled for project?

          • 2. Re: Resources folder is missing in a project root directory
            scabanovich

            JBoss Tools takes into account only resources in folder %web root folder%/resources, and it can only find the web root folder if the project is a Dynamic Web Project. JBoss Tools have no way to determine which other folders contribute to resources of deployed project. If your project is not a Dynamic Web Project, please run action 'Configure -> Add JSF Capabilities'.

             

            If it does not help, for instance because validator still does not see resources from other folders and you would not move all resources under web root folder, then just disable 'JSF2 Components Validator' in Preferences -> Validation (or in properties of a specific project).

            • 3. Re: Resources folder is missing in a project root directory
              nimo22
              {quote}JSF compapatibilities enabled for project{quote}

               

              Yes, it is already enabled.

               

               

              {quote}Configure -> Add JSF Capabilities'{quote}

               

              Is already configured.

               

               

              {quote}JBoss Tools takes into account only resources in folder %web root folder%/resources{quote}

               

              I have my resource folder in webapp/META_INF/resources!

               

               

              Yet, Jboss Tools says:

               

              Resources folder "/resources/myComp" is missing in a project root directory

              • 4. Re: Resources folder is missing in a project root directory
                scabanovich
                I have my resource folder in webapp/META_INF/resources

                But JBoss Tools looks for it as webapp/resources. Resources must be under META-INF in jars, but in web root that is not required. Please let me know if I am not correct and we need to look for resources in both places.

                • 5. Re: Resources folder is missing in a project root directory
                  nimo22
                  {quote}JBoss Tools looks for it as webapp/resources{quote}

                   

                  I now put my resources-folder within three different places at the same time:

                   

                  - webapp/resources/myComp

                  - webapp/META-INF/resources/myComp

                  - src/main/resources/myComp

                   

                  and want to make use of the myComp:

                   

                  {code}<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                  ...
                      xmlns:comp="http://java.sun.com/jsf/composite/myComp">{code}

                   

                  Jboss Tools still says:

                   

                  Resources folder "/resources/myComp" is missing in a project root directory

                   

                  (However, deploying works.)

                   

                  So jboss tools also ignores "webapp/resources/myComp".

                   


                  • 6. Re: Resources folder is missing in a project root directory
                    scabanovich

                    Please, create an issue in JBoss Jira for Tools (JBoss Tools) project, and attach to it dot-resources of your project (.project, .classpath, content of .settings folder), and an example of composite component file from myComp folder.

                    • 7. Re: Resources folder is missing in a project root directory
                      nimo22

                      I have created a new project from the scratch and with that project the resource-folder is scanned properly. However, one thing I had overseen: When starting Eclipse (Helios), JBT asks me "to add JSF capabilities" to my project. I add it and sometimes when starting again it asks me again. So I guess: Resources folder "/resources/myComp" is missing in a project root directory is comming from that fact that JSF capilities was removed without notice it. However, now it seems to work.

                      • 8. Re: Resources folder is missing in a project root directory
                        scabanovich

                         

                        There was an issue  https://jira.jboss.org/browse/JBIDE-5974 'Add JSF Capabilities not preserved after restart'. In some cases, for example for projects which could not be converted to Web Dynamic projects, the wizard failed, but still project kept JSF model for the current session; on Eclipse restart, project configuration was resolved as invalid, and jsf nature was removed with a message to log about it 'Project ... has corrupted nature: org.jboss.tools.jsf.jsfnature'. If you have cases of JSF Capabilities 'unexpected' removal, please compare them to the discussion in JBIDE-5974 and report.