11 Replies Latest reply on Jun 24, 2013 4:41 PM by Ajit Dangal

    Setting Eclipse Environment: required jar file for <cq:defineTags>

    pvr_reddy Level 1

      Hi,

       

      I am setting up Eclipse development environment for CQ 5.4, and am facing an issue with finding the exact jar files that will parse the <cq:defineObjects>  tag. I have the followed the instructions under : http://wem.help.adobe.com/enterprise/en_US/10-0/wem/developing/developmenttools/developing _with_eclipse.html

       

      And I have included the  sling.scripting.jsp.taglib-2.0.6.jar  in my classpath. I get the following error : "The TagExtraInfo class for "cq:defineObjects" (com.day.cq.wcm.tags.DefineObjectsTEI) could not be instantiated".

       

      Do I need any other jars to included in the classpath?

       

      thanks,

      pvr

        • 1. Re: Setting Eclipse Environment: required jar file for <cq:defineTags>
          Pacoolsky Level 1

          I think you need also to include cq-wcm-taglib-5.4.0.jar which can be found at /libs/wcm/taglib/install

          • 2. Re: Setting Eclipse Environment: required jar file for <cq:defineTags>
            pvr_reddy Level 1

            I do have the cq-wcm-taglib-5.4.0.jar in my classpath.

            • 3. Re: Setting Eclipse Environment: required jar file for <cq:defineTags>
              4593029388218911

              I have found that these are the maven dependencies I need to make auto-complete and syntax highlighting work in JSPs in 5.4 (version numbers may vary based on what hotfixes you have applied. For 5.5 the version numbers significantly differnt, and you have to add the dependency on com.adobe.granite.xssprotection. 

               

                  <dependency>
                      <groupId>com.day.commons</groupId>
                      <artifactId>day-commons-jstl</artifactId>
                      <version>1.1.4</version>
                  </dependency>
                  <dependency>
                      <groupId>com.day.cq</groupId>
                      <artifactId>cq-commons</artifactId>
                      <version>5.4.6</version>
                  </dependency>
                  <dependency>
                      <groupId>com.day.cq.wcm</groupId>
                      <artifactId>cq-wcm-api</artifactId>
                      <version>5.4.0</version>
                  </dependency>
                  <dependency>
                      <groupId>com.day.cq.wcm</groupId>
                      <artifactId>cq-wcm-commons</artifactId>
                      <version>5.4.2</version>
                  </dependency>
                  <dependency>
                      <groupId>com.day.cq.wcm</groupId>
                      <artifactId>cq-wcm-taglib</artifactId>
                      <version>5.4.0</version>
                  </dependency>
                  <dependency>
                      <groupId>javax.jcr</groupId>
                      <artifactId>jcr</artifactId>
                      <version>5.4.0</version>
                  </dependency>
                  <dependency>
                      <groupId>org.apache.commons</groupId>
                      <artifactId>commons-lang</artifactId>
                      <version>2.4</version>
                  </dependency>
                   <dependency>
                      <groupId>org.apache.sling</groupId>
                      <artifactId>org.apache.sling.api</artifactId>
                      <version>2.2.0</version>
                  </dependency>
                  <dependency>
                      <groupId>org.apache.sling</groupId>
                      <artifactId>org.apache.sling.scripting.jsp.taglib</artifactId>
                      <version>2.1.0</version>       
                  </dependency>
                  <dependency>
                      <groupId>org.slf4j</groupId>
                      <artifactId>slf4j-api</artifactId>
                      <version>1.5.3</version>
                  </dependency>
              • 4. Re: Setting Eclipse Environment: required jar file for <cq:defineTags>
                bryan,hunwardsen

                I am trying to get this very thing working in 5.6.

                 

                Using the below pom dependencies I was able to remove all of the dependency based errors from a local copy of global.jsp, however the very first tag errors out:

                 

                <cq:defineObjects />

                 

                DescriptionResourcePathLocationType
                The TagExtraInfo class for "cq:defineObjects" (com.day.cq.wcm.tags.DefineObjectsTEI) could not be instantiatedSimpleComponent.jsp/simplevault/bin/src/main/content/jcr_root/apps/simplevault/components/SimpleComponentline 1JSP Problem

                 

                BTW this is w/ JDK 1.7 on Latest eclipse Juno using Dynamic Web Module 3.0 facet.

                 

                Any help appreciated.

                 

                 

                included dependencies (possibly conflicting or insufficient???)

                 

                 



                <dependency>



                <groupId>org.apache.sling</groupId>



                <artifactId>org.apache.sling.api</artifactId>



                <version>2.3.0</version>



                <scope>provided</scope>


                </dependency>


                <dependency>



                <groupId>org.apache.sling</groupId>



                <artifactId>org.apache.sling.jcr.jcr-wrapper</artifactId>



                <version>2.0.0</version>



                <scope>provided</scope>


                </dependency>


                <dependency>



                <groupId>org.apache.sling</groupId>



                <artifactId>org.apache.sling.scripting.jsp.taglib</artifactId>



                <version>2.1.8</version>



                <scope>provided</scope>


                </dependency>


                <dependency>



                <groupId>javax.servlet</groupId>



                <artifactId>jsp-api</artifactId>



                <version>2.0</version>



                <scope>provided</scope>


                </dependency>


                <dependency>



                <groupId>javax.servlet</groupId>



                <artifactId>servlet-api</artifactId>



                <version>2.5</version>



                <scope>provided</scope>


                </dependency>



                <dependency>



                <groupId>com.day.cq</groupId>



                <artifactId>cq-commons</artifactId>



                <version>5.6.2</version>



                <scope>provided</scope>


                </dependency>


                <dependency>



                <groupId>com.day.cq.wcm</groupId>



                <artifactId>cq-wcm-api</artifactId>



                <version>5.6.4</version>



                <scope>provided</scope>


                </dependency>


                <dependency>



                <groupId>com.day.cq.wcm</groupId>



                <artifactId>cq-wcm-commons</artifactId>



                <version>5.6.2</version>



                <scope>provided</scope>


                </dependency>


                <dependency>



                <groupId>com.day.commons</groupId>



                <artifactId>day-commons-jstl</artifactId>



                <version>1.1.4</version>



                <scope>provided</scope>


                </dependency>


                <dependency>



                <groupId>com.day.cq.wcm</groupId>



                <artifactId>cq-wcm-taglib</artifactId>



                <version>5.6.2</version>



                <scope>provided</scope>


                </dependency>


                <dependency>



                <groupId>commons-lang</groupId>



                <artifactId>commons-lang</artifactId>



                <version>2.5</version>



                <scope>provided</scope>


                </dependency>


                <dependency>



                <groupId>com.adobe.granite</groupId>



                <artifactId>com.adobe.granite.xssprotection</artifactId>



                <version>5.5.22</version>



                <scope>provided</scope>


                </dependency>


                <dependency>



                <groupId>org.slf4j</groupId>



                <artifactId>slf4j-api</artifactId>



                <scope>provided</scope>


                </dependency>
                • 5. Re: Setting Eclipse Environment: required jar file for <cq:defineTags>
                  Ajit Dangal

                  Do you have local enviornment setup with maven plugin? then try to copy jar files in user cache (as below). (POM.xml gives project build error if it cant find these files - are you getting build errors?)

                   

                  If the dependencies are not stored in the local Maven repository, compiler errors appear in the pom.xml file.

                  1. Deploy the CQ5 specific artifacts as defined in the pom.xml (cq-wcm-api, cq-commons and org.apache.sling.api) to the local Maven repository:
                    1. In your file system, copy the the file cq-wcm-api-{version}.jar located at cq5libs/wcm (you have created those folders before) into <your-user-dir>/.m2/repository/com/day/cq/wcm/cq-wcm-api/{version} (create the folders if they don't exist).
                    2. In your file system, copy the the file cq-commons-{version}.jar located at cq5libs/cq (you have created those folders before) into <your-user-dir>/.m2/repository/com/day/cq/cq-commons/{version} (create the folders if they don't exist).
                    3. In your file system, copy the the file org.apache.sling.api-{version}.jar located at cq5libs/sling (you have created those folders before) into<your-user-dir>/.m2/repository/org/apache/sling/org.apache.sling.api/{version} (create the folders if they don't exist).
                    You don't need to perform this step if the three CQ5 artifacts are globally deployed for the project on a Maven repository (e.g. using Apache Archiva).
                  • 6. Re: Setting Eclipse Environment: required jar file for <cq:defineTags>
                    bryan,hunwardsen Level 1

                    Thanks Ajit,

                     

                    As is in my preious post, I have all those you have listed as pom dependencies, my eclipse/maven environment has d/l'd them into .m2 and they are available. If I create a java file in the same dir as global.jsp, all of the api's are available in that class.

                     

                    I have no pom or jsp dependency errors, just stuck on the tags not resolving as in my previous post.

                     

                    Any future help appreciated. thx

                    • 7. Re: Setting Eclipse Environment: required jar file for <cq:defineTags>
                      Ajit Dangal Level 1

                      Hey Bryan,

                       

                      Not sure if this can help you however just verify the snapshot jar has correct pom.xml in META-INF and has entry for wcm tag lib

                       

                      <artifactId>cq-wcm-taglib</artifactId>

                       

                      Can you also please check the error log and paste here.

                       

                      Thanks,

                      Ajit

                      • 8. Re: Setting Eclipse Environment: required jar file for <cq:defineTags>
                        bryan,hunwardsen Level 1

                        Hi Ajit, I really appreciate your continued support!!!

                         

                        Can u please be more specific regarding the snapshot jar/pom in meta-inf, my project pom has the dependencies listed above, which once included in the pom and saved, eclipse d/l's the dependency into .m2 and rebuilds the workspace where they are then vivsble to the project. As I am not deploying anything, Im not sure what error log you are referring to.

                         

                        To reiterate, I am addind the Dynamic Web Module v3.0 facet to my AEM 5.6 vault project in eclipse, my expectation is to be able to have JSP syntax highlighting/auto-completion/error reporting inside eclipse.

                         

                        Thanks

                        Bryan

                        • 9. Re: Setting Eclipse Environment: required jar file for <cq:defineTags>
                          Ajit Dangal Level 1

                          I have juno with Java 1.6 , dont have facets so cant really replicate issue.

                           

                          Well you can check some threads below (could be old but can give some hint to resolve dependency)

                           

                          https://issues.sonatype.org/browse/MNGECLIPSE-1978

                          • 10. Re: Setting Eclipse Environment: required jar file for <cq:defineTags>
                            bryan,hunwardsen Level 1

                            I got it working, Eclipse is just really finicky. All you need is the above dependencies in the pom and apply the facet.

                            All my other issues where just from eclipse drooling all over itself.

                            Thx for the help

                            • 11. Re: Setting Eclipse Environment: required jar file for <cq:defineTags>
                              Ajit Dangal Level 1

                              Hi Bryan,

                               

                              Thats great you cracked it !!

                               

                              Please list details steps so that it will help in the future.

                               

                              Thx,

                              Ajit