Adobe-Consulting-Services / acs-aem-commons

http://adobe-consulting-services.github.io/acs-aem-commons/
Apache License 2.0
454 stars 600 forks source link

Domain Sharding creating issue if multiple rewriter-configs are available. #2598

Open VasiRahman opened 3 years ago

VasiRahman commented 3 years ago

Required Information

Expected Behavior

Domain Sharding should work if multiple rewriter-configs are added in multiple project modules which are running in same instance.

Actual Behavior

Domain Sharding should work if multiple rewriter-configs are added in multiple project modules which are running in same instance.

I have a multi-module project where I have configured domain Sharding factory configurations in the commons module(Module A). In Module B I have added rewriter-config and specified the transformer name as "static-site-ref" In Module C I have added rewriter-config and specified the transformer name as "static-site-ref"

When we deploy the build from commons module (Module A) in process of deployment if any rewriter request comes from the other 2 modules (Module A and B) it throw below error and instances stop responding.

01.06.2021 17:34:30.218 ERROR [0:0:0:0:0:0:0:1 [1622549070188] GET /aem/start.html HTTP/1.1] org.apache.sling.engine.impl.SlingRequestProcessorImpl service: Uncaught SlingException java.io.IOException: Unable to get component of class 'interface org.apache.sling.rewriter.Transformer' with type 'site-static-refs'. at org.apache.sling.rewriter.impl.PipelineImpl.getPipelineComponent(PipelineImpl.java:161) [org.apache.sling.rewriter:1.2.2] at org.apache.sling.rewriter.impl.PipelineImpl.init(PipelineImpl.java:103) [org.apache.sling.rewriter:1.2.2] at org.apache.sling.rewriter.impl.ProcessorManagerImpl.getProcessor(ProcessorManagerImpl.java:480) [org.apache.sling.rewriter:1.2.2] at org.apache.sling.rewriter.impl.RewriterResponse.getProcessor(RewriterResponse.java:172) [org.apache.sling.rewriter:1.2.2] at org.apache.sling.rewriter.impl.RewriterResponse.getWriter(RewriterResponse.java:110) [org.apache.sling.rewriter:1.2.2] at org.apache.sling.scripting.core.impl.helper.OnDemandWriter.getWriter(OnDemandWriter.java:38) [org.apache.sling.scripting.core:2.0.54] at org.apache.sling.scripting.core.impl.helper.OnDemandWriter.write(OnDemandWriter.java:61) [org.apache.sling.scripting.core:2.0.54] at java.io.PrintWriter.write(PrintWriter.java:426) at org.apache.sling.scripting.jsp.jasper.runtime.JspWriterImpl.flushBuffer(JspWriterImpl.java:119) [org.apache.sling.scripting.jsp:2.2.7.B002] at org.apache.sling.scripting.jsp.jasper.runtime.JspWriterImpl.write(JspWriterImpl.java:273) [org.apache.sling.scripting.jsp:2.2.7.B002] at java.io.PrintWriter.write(PrintWriter.java:426) at org.apache.sling.scripting.core.impl.helper.OnDemandWriter.write(OnDemandWriter.java:61) [org.apache.sling.scripting.core:2.0.54] at java.io.PrintWriter.write(PrintWriter.java:426) at org.apache.sling.scripting.jsp.jasper.runtime.JspWriterImpl.write(JspWriterImpl.java:277) [org.apache.sling.scripting.jsp:2.2.7.B002] at java.io.PrintWriter.write(PrintWriter.java:426) at org.apache.sling.scripting.core.impl.helper.OnDemandWriter.write(OnDemandWriter.java:61) [org.apache.sling.scripting.core:2.0.54] at java.io.PrintWriter.write(PrintWriter.java:426) at org.apache.sling.scripting.jsp.jasper.runtime.JspWriterImpl.flushBuffer(JspWriterImpl.java:119) [org.apache.sling.scripting.jsp:2.2.7.B002] at org.apache.sling.scripting.jsp.jasper.runtime.JspWriterImpl.write(JspWriterImpl.java:289) [org.apache.sling.scripting.jsp:2.2.7.B002] at java.io.PrintWriter.write(PrintWriter.java:426) at org.apache.sling.scripting.core.impl.helper.OnDemandWriter.write(OnDemandWriter.java:61) [org.apache.sling.scripting.core:2.0.54] at java.io.PrintWriter.write(PrintWriter.java:426) at org.apache.sling.scripting.jsp.jasper.runtime.JspWriterImpl.flushBuffer(JspWriterImpl.java:119) [org.apache.sling.scripting.jsp:2.2.7.B002] at org.apache.sling.scripting.jsp.jasper.runtime.PageContextImpl.release(PageContextImpl.java:183) [org.apache.sling.scripting.jsp:2.2.7.B002] at org.apache.sling.scripting.jsp.jasper.runtime.JspFactoryImpl.internalReleasePageContext(JspFactoryImpl.java:99) [org.apache.sling.scripting.jsp:2.2.7.B002] at org.apache.sling.scripting.jsp.jasper.runtime.JspFactoryImpl.releasePageContext(JspFactoryImpl.java:71) [org.apache.sling.scripting.jsp:2.2.7.B002] at org.apache.sling.scripting.jsp.jasper.compiler.JspRuntimeContext$JspFactoryHandler.releasePageContext(JspRuntimeContext.java:112) [org.apache.sling.scripting.jsp:2.2.7.B002] at org.apache.jsp.libs.granite.ui.components.shell.globalnav.layouts.navigationtab.navigationtab_jsp._jspService(navigationtab_jsp.java:209) at org.apache.sling.scripting.jsp.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) [org.apache.sling.scripting.jsp:2.2.7.B002] at javax.servlet.http.HttpServlet.service(HttpServlet.java:725) [org.apache.felix.http.servlet-api:1.1.2] at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:502) [org.apache.sling.scripting.jsp:2.2.7.B002] at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:449) [org.apache.sling.scripting.jsp:2.2.7.B002] at org.apache.sling.scripting.jsp.JspScriptEngineFactory.callJsp(JspScriptEngineFactory.java:346) [org.apache.sling.scripting.jsp:2.2.7.B002] at org.apache.sling.scripting.jsp.JspScriptEngineFactory.access$100(JspScriptEngineFactory.java:101) [org.apache.sling.scripting.jsp:2.2.7.B002] at org.apache.sling.scripting.jsp.JspScriptEngineFactory$JspScriptEngine.eval(JspScriptEngineFactory.java:607) [org.apache.sling.scripting.jsp:2.2.7.B002] at org.apache.sling.scripting.core.impl.DefaultSlingScript.call(DefaultSlingScript.java:388) [org.apache.sling.scripting.core:2.0.54] at org.apache.sling.scripting.core.impl.DefaultSlingScript.eval(DefaultSlingScript.java:184) [org.apache.sling.scripting.core:2.0.54] at org.apache.sling.scripting.core.impl.DefaultSlingScript.service(DefaultSlingScript.java:491) [org.apache.sling.scripting.core:2.0.54] at org.apache.sling.engine.impl.request.RequestData.service(RequestData.java:552) [org.apache.sling.engine:2.6.16] at org.apache.sling.engine.impl.filter.SlingComponentFilterChain.render(SlingComponentFilterChain.java:44) [org.apache.sling.engine:2.6.16] at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:82) [org.apache.sling.engine:2.6.16] at com.day.cq.wcm.core.impl.WCMDeveloperModeFilter.doFilter(WCMDeveloperModeFilter.java:119) [com.day.cq.wcm.cq-wcm-core:5.11.276]

Steps to Reproduce

  1. Setup AEM 6.4 with SP 6.4.5
  2. ACS commons version 4.0.0
  3. Create 3 module project Module A (Commons), Module B and Module C
  4. In Module A keep TransformerFactory under run modes specific Configs XML file.
  5. In Module B and Module C keep rewriter-configs TransformerType = "static-site-refers"
  6. Try to deploy commons build.
muhammad-naveed commented 3 years ago

From the error logs, it seems like the rewriter pipeline is not able to find the OSGi component with pipeline.type="static-site-refers". It would be good to see if the component has the correct properties. You can look for StaticReferenceRewriteTransformerFactory in the Admin Console under path: /system/console/components

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.