adobe / asset-share-commons

A modern, open-source asset share reference implementation built on Adobe Experience Manager (AEM)
https://opensource.adobe.com/asset-share-commons/
Apache License 2.0
89 stars 106 forks source link

Share functionality not working, when Day CQ Mail server setup (on ASC 1.0.2) #86

Closed daronson1 closed 6 years ago

daronson1 commented 6 years ago

With the Mail server setup (and successfully sharing an asset in the AEM interface), the share functionality of the Asset Share interface doesn't work.

Steps to reproduce:

  1. setup Day CQ mail service
  2. share asset in AEM interface, and confirm successful mail sent
  3. attempt to share asset in the Asset Share interface.
    Result: email not sent + following stack trace:
    java.lang.NullPointerException: null
    at com.adobe.aem.commons.assetshare.components.actions.share.impl.EmailShareServiceImpl.share(EmailShareServiceImpl.java:130)
    at com.adobe.aem.commons.assetshare.components.actions.share.impl.EmailShareServiceImpl.share(EmailShareServiceImpl.java:106)
    at com.adobe.aem.commons.assetshare.components.actions.share.impl.ShareServlet.share(ShareServlet.java:69)
    at com.adobe.aem.commons.assetshare.components.actions.share.impl.ShareServlet.doPost(ShareServlet.java:57)
    at org.apache.sling.api.servlets.SlingAllMethodsServlet.mayService(SlingAllMethodsServlet.java:149)
    at org.apache.sling.api.servlets.SlingSafeMethodsServlet.service(SlingSafeMethodsServlet.java:346)
    at org.apache.sling.api.servlets.SlingSafeMethodsServlet.service(SlingSafeMethodsServlet.java:378)
    at org.apache.sling.engine.impl.request.RequestData.service(RequestData.java:552)
    at org.apache.sling.engine.impl.filter.SlingComponentFilterChain.render(SlingComponentFilterChain.java:44)
    at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:77)
    at com.day.cq.wcm.core.impl.WCMDebugFilter.doFilterWithErrorHandling(WCMDebugFilter.java:192)
    at com.day.cq.wcm.core.impl.WCMDebugFilter.doFilter(WCMDebugFilter.java:159)
    at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
    at com.day.cq.wcm.core.impl.WCMComponentFilter.filterRootInclude(WCMComponentFilter.java:375)
    at com.day.cq.wcm.core.impl.WCMComponentFilter.doFilter(WCMComponentFilter.java:190)
    at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
    at com.day.cq.personalization.impl.TargetComponentFilter.doFilter(TargetComponentFilter.java:96)
    at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
    at org.apache.sling.engine.impl.SlingRequestProcessorImpl.processComponent(SlingRequestProcessorImpl.java:282)
    at org.apache.sling.engine.impl.filter.RequestSlingFilterChain.render(RequestSlingFilterChain.java:49)
    at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:71)
    at com.day.cq.dam.core.impl.assetlinkshare.AdhocAssetShareAuthHandler.doFilter(AdhocAssetShareAuthHandler.java:436)
    at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
    at com.day.cq.dam.core.impl.servlet.ActivityRecordHandler.doFilter(ActivityRecordHandler.java:154)
    at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
    at com.adobe.cq.social.ugcbase.security.impl.SaferSlingPostServlet.doFilter(SaferSlingPostServlet.java:126)
    at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
    at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:73)
    at com.adobe.granite.rest.impl.servlet.ApiResourceFilter.doFilter(ApiResourceFilter.java:70)
    at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
    at com.adobe.granite.requests.logging.impl.RequestLoggerImpl.doFilter(RequestLoggerImpl.java:126)
    at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
    at com.adobe.granite.rest.assets.impl.AssetContentDispositionFilter.doFilter(AssetContentDispositionFilter.java:96)
    at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
    at com.adobe.granite.csrf.impl.CSRFFilter.doFilter(CSRFFilter.java:217)
    at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
    at org.apache.sling.security.impl.ContentDispositionFilter.doFilter(ContentDispositionFilter.java:180)
    at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
    at com.day.cq.wcm.core.impl.AuthoringUIModeServiceImpl.doFilter(AuthoringUIModeServiceImpl.java:292)
    at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
    at com.day.cq.wcm.mobile.core.impl.redirect.RedirectFilter.doFilter(RedirectFilter.java:248)
    at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
    at au.com.auspost.camps.core.filters.LoggingFilter.doFilter(LoggingFilter.java:56)
    at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
    at org.apache.sling.engine.impl.debug.RequestProgressTrackerLogFilter.doFilter(RequestProgressTrackerLogFilter.java:107)
    at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
    at com.adobe.cq.social.commons.cors.CORSAuthenticationFilter.doFilter(CORSAuthenticationFilter.java:91)
    at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
    at com.day.cq.wcm.foundation.forms.FormsHandlingServletHelper.handleFilter(FormsHandlingServletHelper.java:221)
    at com.day.cq.wcm.foundation.forms.impl.FormsHandlingServlet.doFilter(FormsHandlingServlet.java:138)
    at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
    at com.adobe.granite.optout.impl.OptOutFilter.doFilter(OptOutFilter.java:76)
    at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
    at com.day.cq.wcm.foundation.forms.FormsHandlingServletHelper.handleFilter(FormsHandlingServletHelper.java:221)
    at com.adobe.cq.wcm.core.components.internal.servlets.CoreFormHandlingServlet.doFilter(CoreFormHandlingServlet.java:125)
    at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
    at com.day.cq.wcm.core.impl.WCMRequestFilter.doFilter(WCMRequestFilter.java:90)
    at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
    at com.adobe.cq.mcm.campaign.servlets.CampaignCopyTracker.doFilter(CampaignCopyTracker.java:100)
    at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
    at org.apache.sling.rewriter.impl.RewriterFilter.doFilter(RewriterFilter.java:83)
    at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
    at com.adobe.granite.httpcache.impl.InnerCacheFilter.doFilter(InnerCacheFilter.java:81)
    at com.adobe.granite.httpcache.impl.InnerCacheFilter.doFilter(InnerCacheFilter.java:60)
    at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
    at org.apache.sling.i18n.impl.I18NFilter.doFilter(I18NFilter.java:138)
    at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
    at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:73)
    at com.adobe.granite.resourceresolverhelper.impl.ResourceResolverHelperImpl.doFilter(ResourceResolverHelperImpl.java:83)
    at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
    at org.apache.sling.engine.impl.SlingRequestProcessorImpl.doProcessRequest(SlingRequestProcessorImpl.java:151)
    at org.apache.sling.engine.impl.SlingMainServlet.service(SlingMainServlet.java:219)
    at org.apache.felix.http.base.internal.handler.ServletHandler.handle(ServletHandler.java:85)
    at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:79)
    at org.apache.sling.security.impl.ReferrerFilter.doFilter(ReferrerFilter.java:295)
    at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:135)
    at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:74)
    at com.adobe.granite.license.impl.LicenseCheckFilter.doFilter(LicenseCheckFilter.java:308)
    at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:135)
    at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:74)
    at org.apache.felix.http.sslfilter.internal.SslFilter.doFilter(SslFilter.java:96)
    at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:135)
    at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:74)
    at org.apache.sling.i18n.impl.I18NFilter.doFilter(I18NFilter.java:138)
    at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:135)
    at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:74)
    at org.apache.sling.featureflags.impl.FeatureManager.doFilter(FeatureManager.java:116)
    at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:135)
    at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:74)
    at org.apache.sling.engine.impl.log.RequestLoggerFilter.doFilter(RequestLoggerFilter.java:72)
    at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:135)
    at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:74)
    at org.apache.felix.http.base.internal.dispatch.Dispatcher.dispatch(Dispatcher.java:128)
    at org.apache.felix.http.base.internal.dispatch.DispatcherServlet.service(DispatcherServlet.java:49)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
    at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:812)
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:587)
    at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:221)
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)
    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
    at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
    at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:215)
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
    at org.eclipse.jetty.server.Server.handle(Server.java:499)
    at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311)
    at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)
    at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:544)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)
    at java.lang.Thread.run(Thread.java:745)
davidjgonzalez commented 6 years ago

Hi - share functionality requires acs aem commons — do you have that installed? If so what version?

daronson1 commented 6 years ago

Hi David,

ACS Commons 3.11.0 is installed and active

davidjgonzalez commented 6 years ago

Also are you version 1.0.2 of asset share commons? (This should’ve been resolved in that)

With acs commons 3.11.0 bundle Active, can you restart the asset share commons bundle? You shouldn’t have to do this but I’m curious if that resolved anything.

daronson1 commented 6 years ago

Same result (error) with 1.0.1, 1.0.2, and 1.0.3-snapshot (master branch) I also tried stopping and starting the bundle (to no avail...)

The issue appears to relate to the referenced email service - I have seen issues in the past resolved by manually creating the implied "bind" function... not sure if this will help, but that is an alternative...

godanny86 commented 6 years ago

@daronson1 does reinstalling Asset Share Commons after having ACS commons already installed fix it?

daronson1 commented 6 years ago

Uninstalling and re-installing the Asset Share Commons has no effect on the issue...

davidjgonzalez commented 6 years ago

@daronson1 and asking the obvious; is the acs aem commons EmailServicr osgi component active or satisfied? And what is the state of the ASC emailshareserviceimpl osgi component in Felix?

kaushalmall commented 6 years ago

@davidjgonzalez sounds like we are running into the same issue. @arpithaar do you have details? Following the comments here, doesn't seem like there's a fix yet or it was fixed in 1.0.2. We are using 1.0.3-SNAPSHOT, so we should have the fix.

godanny86 commented 6 years ago

I'm proposing simply copying the email service from ACS Commons into an Asset Share email service and then we can get rid of the ACS dependency completely. Its not great to have a duplication of a service, but the dependency on ACS is heavy for just a small service and would avoid these issues. Might be possible to make the Asset Share email service private so that people don't get confused between ACS and ASC ;) .

wdyt @davidjgonzalez, @kaushalmall ?

davidjgonzalez commented 6 years ago

i moved the ACS EmailServiceImpl over last night but realized i had to make a service user, mapper config, and acls - so i took the for the dog for a walk instead.

TBH I dont like this approach, but im at the end of spending my evenings trying to figure out how to make these dependencies play nice.

Its just so confounding since i dont see what were doing that is so special compared to how every other project use the ACS Commons email service.

kaushalmall commented 6 years ago

@davidjgonzalez @godanny86 @arpitaar not sure if any of this is related, but, there might be dependency issues with ACS Commons as well. @justinedelson recently helped me debug an issue which he then fixed in ACS Commons as well [0] . For us, we had to update the pom file like below.

 <dependency>
            <groupId>com.adobe.acs</groupId>
            <artifactId>acs-aem-commons-bundle</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.apache.sling</groupId>
                    <artifactId>org.apache.sling.models.api</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

[0]https://github.com/Adobe-Consulting-Services/acs-aem-commons/pull/1217