Expand my Community achievements bar.

July 31st AEM Gems Webinar: Elevate your AEM development to master the integration of private GitHub repositories within AEM Cloud Manager.
SOLVED

Where is the XSSAPI defined? (Maven build issues for /libs/foundation components)

Avatar

Level 4

1) Where is the XSSAPI defined? I've included the <dependency> below from the depfinder# tool, and I still get the error, (shown below), when I attempt to run "mvn clean install" in the commons or content directory. 

       
com.adobe.granite.xss1.1.0com.day.cq.cq-xssprotection (107)

<dependency>

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

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

        <version>5.5.24</version>

        <scope>provided</scope>

</dependency>

 

Snippet from Maven log:

[ERROR] Compilation Failure org.apache.sling.scripting.jsp.jasper.JasperException: Unable to compile class for JSP: An error occurred at line: 3 in the jsp file: /libs/foundation/components/profile/form/formrowtext.jsp xssAPI cannot be resolved 1: <%@page session="false"%><div class="form_row"> 2:       <div class="form_leftcol"> 3:           <div class="form_leftcollabel"><label for="<%= xssAPI.encodeForHTMLAttr(path) %>"><%= xssAPI.encodeForHTML(title) %></label></div> 4:           <div class="form_leftcolmark <%= required ? "form_required" : ""%>"><%= required ? "*" : " " %></div> 5:       </div>a 6:       <div class="form_rightcol"><%

2) Is there an easier way to determine all of the dependencies needed to build everything off of /libs/foundation/components, without sitting there and working through each and every build error one by one, using the dependency finder tool and adding the <dependency> to the maven POM? There must be a way to do this more efficiently. Also, whenever we migrate to AEM 6.1, I imagine I'll have to update the versions for each dependency one by one, (unless the uber.jar enables maven to build without explicit dependencies being listed in the POM.xml).

1 Accepted Solution

Avatar

Correct answer by
Employee
10 Replies

Avatar

Level 10

In AEM 6 - you can use the Urber JAR to make it easier. See this older community thread for details:

Urber Jar

Hope this helps

Avatar

Level 4

smacdonald2008 wrote...

In AEM 6 - you can use the Urber JAR to make it easier. See this older community thread for details:

Urber Jar

Hope this helps

 

Thanks Scott, but at present, I still have to develop some components in 5.6.1, and this is where I'm encountering issues. At this time, I can not compile the components under /libs/foundation using maven. If you or anyoen else has information that will help resolve the dependency for XSSAPI, please let me know.

Avatar

Correct answer by
Employee

Avatar

Level 4

When you look at the code of the offending component, ( /libs/foundation/components/profile/form/formrowtext.jsp), you see there is NO explicit declaration for xssAPI before they start using it. In addition, I also don't see a declaration in init.jsp, or any of the sibling files to show where the declaration is made. This is why maven is failing. It's also unable to determine where xssAPI has been declared, (probably in some other file that's been included in the dependency chain).

Avatar

Level 4

Felike, this sounds like a great idea, (sort of like an Uberjar for 5.6.1???), but unfortunately, my compile still fails with the formrowtext.jsp component, (due to the xssAPI reference). I don't know if I did something wrong setting it up, but again, it doesn't work.

Let me ask a stupid question. When the instructions mention installing the cq5-archiva-servlet, is it talking about using package manager to upload and install the .zip, (or, installing it locally on the file system etc.)?

Avatar

Level 4

Can anyone tell me if the instructions to "Install the cq5-archiva-servlet" is referring to using the AEM package manager to install the .zip, (or are they talking about installing it on the file system)?

Avatar

Level 10

Did you follow the instructions in the KB that Feike pointed to. You should be able to pull in all libs from CQ. 

Avatar

Employee

If you open the zip you can see it is a standard package file that needs to be installed via package manager.

Are trying to precompile your jsp files?

Regards,

Opkar 

Avatar

Level 4

Yes, Scott, I'd followed all of the instructions, but what happens is, experienced experts such as you guys can read these types of instructions and fill in the gaps, whereas it's not as clear to inexperienced resources, (where things need to be spelled out step by step and broken down into detailed instructions). I was able to get it working yesterday, and I believe it wasn't working initially due to some warnings due to duplicate dependencies, versions in the child POM etc. I didn't know that there were warnings, but once I worked through those, it just started working. Also, when I went back into CRXDE lite, I saw that it had been installed under /apps.

Avatar

Level 4

Opkar, of course I opened the zip, but again, with my knowledge level I'm not able to recognize what a standard package file looks like. You can't take for granted that newbs asking these questions understand those types of things. I believe this is the first package that I've ever opened, and all I could do is download another package or two that was already loaded in the JCR, compare, and then make a reasonable assumption, (and in this case, I was right that it was a package that needed to be loaded via package manager). Fortunately, I got it working yesterday, but for all of the experienced guys, please provide explanations that assume only a beginners, to no prior level of knowledge of CQ/AEM. It'd really help the newbs learn.

Yes, I'm trying to pre-compile my JSP files, (i.e. everything under /libs/foundation too), but it keeps blowing up when it gets to /libs/foundation/components/profile/form/formrowtext.jsp, because it can't find where xssAPI is declared. I can't wait until I can move over and start doing all of my development in AEM 6.1 with the uberjar.jar. It's really going to help me learn being able to compile all of the OOTB components and step through them as needed. Thanks SO much to you and all of the experienced guys, and experts like Feike, Scott and others who take the time to help those of us struggling to get up to speed on this tool/platform.