Wednesday, May 8, 2019

How to integrate Adobe Experience Manager(AEM) with Magento ecommerce platform - part2

How to integrate Adobe Experience Manager(AEM) with Magento ecommerce platform - part2

This video explains the AEM configuration details required to integrate Adobe Experience Manager(AEM) with Magento ecommerce platform





How to integrate Adobe Experience Manager(AEM) with Magento ecommerce platform - part1

How to integrate Adobe Experience Manager(AEM) with Magento ecommerce platform - part1

This video explains the AEM configuration details required to integrate Adobe Experience Manager(AEM) with Magento ecommerce platform




Tuesday, May 7, 2019

nmEnroll/nmConnect commands fails on windows server- Weblogic 12.2.1

nmEnroll and nmConnect  command fails on windows server - Weblogic 12.2.1


The enroll of a domain with node manager and connecting to a node manager was failing in windows server for Weblogic 12.2.1

Steps followed to Enroll the domain:


Execute the following commands in command prompt

C:\Albin\SW\Weblogic\oracle\wlserver\common\bin\wlst.cmd

connect('weblogic','Albin123!','t3://localhost:7001')

nmEnroll('C:\Albin\SW\Weblogic\oracle\user_projects\domains\base_domain','C:\Albin\SW\Weblogic\oracle\user_projects\domains\base_domain\nodemanager')

nmConnect('weblogic', 'Albin123!', 'localhost', '5556', 'base_domain' ,'C:\Albin\SW\Weblogic\oracle\user_projects\domains\base_domain','ssl')

Error:


wls:/base_domain/serverConfig/> nmEnroll('C:\Albin\SW\Weblogic\oracle\user_projects\domains\base_domain','C:\Albin\SW\Weblogic\oracle\user_projects\domains\base_domain\nodemanager')
Enrolling this machine with the domain directory at C:\Albin\SW\Weblogic\oracle\user_projects\domainase_domain ...
Traceback (innermost last):
  File "<console>", line 1, in ?
  File "<iostream>", line 1661, in nmEnroll
  File "<iostream>", line 553, in raiseWLSTException
WLSTException: Error occurred while performing nmEnroll : Problem enrolling the machine. : C:\Albin\SW\Weblogic\oracle\user_projects\domainase_domain\security\SerializedSystemIni.dat (The filename, directory name, or volume label syntax is incorrect)
Use dumpStack() to view the full stacktrace :


The_filename_directory_name,_volume_label_syntax_incorrect

wls:/base_domain/serverConfig/> nmConnect('weblogic', 'Albin123!', 'localhost', '5556', 'base_domain' ,'C:\Albin\SW\Weblogic\oracle\user_projects\domains\base_domain','ssl')
Connecting to Node Manager ...
<May 7, 2019 9:35:58 PM CDT> <Info> <Security> <BEA-090905> <Disabling the CryptoJ JCE Provider self-integrity check for better startup performance. To enable this check, specify -Dweblogic.security.allowCryptoJDefaultJCEVerification=true.>
<May 7, 2019 9:35:58 PM CDT> <Info> <Security> <BEA-090906> <Changing the default Random Number Generator in RSA CryptoJ from ECDRBG128 to HMACDRBG. To disable this change, specify -Dweblogic.security.allowCryptoJDefaultPRNG=true.>
<May 7, 2019 9:35:58 PM CDT> <Info> <Security> <BEA-090909> <Using the configured custom SSL Hostname Verifier implementation: weblogic.security.utils.SSLWLSHostnameVerifier$NullHostnameVerifier.>
Traceback (innermost last):
  File "<console>", line 1, in ?
  File "<iostream>", line 111, in nmConnect
  File "<iostream>", line 553, in raiseWLSTException
WLSTException: Error occurred while performing nmConnect : Cannot connect to Node Manager. : Received error message from Node Manager Server: [Processing for domain 'base_domain' failed due to I/O error: [The filename, directory name, or volume label syntax is incorrect]]. Please check Node Manager log for details.
Use dumpStack() to view the full stacktrace :
wls:/base_domain/serverConfig/>

The_filename_directory_name,_volume_label_syntax_incorrect

The domain path on Windows must use double backslash '\\' as the path separator.

The domain was successfully enrolled after executing the below command

nmEnroll('C:\\Albin\\SW\\Weblogic\\oracle\\user_projects\\domains\\base_domain','C:\\Albin\\SW\Weblogic\\oracle\\user_projects\\domains\\base_domain\\nodemanager')

The_filename_directory_name,_volume_label_syntax_incorrect

nmConnect('weblogic', 'Albin123!', 'localhost', '5556', 'base_domain' ,'C:\\Albin\\SW\\Weblogic\\oracle\\user_projects\\domains\\base_domain','ssl')

The_filename_directory_name,_volume_label_syntax_incorrect



Friday, April 12, 2019

Not Found (404) - The requested URL /siteadmin resulted in an error in org.apache.sling.servlets.get.DefaultGetServlet.

Not Found (404) - The requested URL /siteadmin resulted in an error in org.apache.sling.servlets.get.DefaultGetServlet.


In one of our AEM(Adobe Experience Manager) environment recently we were facing 404 issue for all standard URL's like siteadmin, useradmin, welcome.html etc and for the custom content URLs.

The below message has been displayed in the browser while accessing the pages.

Not Found (404)
The requested URL /siteadmin resulted in an error in org.apache.sling.servlets.get.DefaultGetServlet.

Request Progress:
      0 TIMER_START{Request Processing}
      0 COMMENT timer_end format is {<elapsed microseconds>,<timer name>} <optional message>
      3 LOG Method=GET, PathInfo=null
      4 TIMER_START{handleSecurity}
   3166 TIMER_END{3160,handleSecurity} authenticator org.apache.sling.auth.core.impl.SlingAuthenticator@1444cb1f returns true
   3344 TIMER_START{ResourceResolution}
   3438 TIMER_END{93,ResourceResolution} URI=/siteadmin resolves to Resource=JcrNodeResource, type=cq/ui/components/widget, superType=null, path=/apps/wcm/core/content/siteadmin
   3443 LOG Resource Path Info: SlingRequestPathInfo: path='/apps/wcm/core/content/siteadmin', selectorString='null', extension='html', suffix='null'
   3443 TIMER_START{ServletResolution}
   3446 TIMER_START{resolveServlet(/apps/wcm/core/content/siteadmin)}
   3455 TIMER_END{8,resolveServlet(/apps/wcm/core/content/siteadmin)} Using servlet org.apache.sling.servlets.get.DefaultGetServlet
   3457 TIMER_END{14,ServletResolution} URI=/siteadmin handled by Servlet=org.apache.sling.servlets.get.DefaultGetServlet
   3459 LOG Applying Requestfilters
   3463 LOG Calling filter: com.adobe.granite.resourceresolverhelper.impl.ResourceResolverHelperImpl
   3469 LOG Calling filter: org.apache.sling.security.impl.ContentDispositionFilter
   3472 LOG Calling filter: org.apache.sling.i18n.impl.I18NFilter
   3476 LOG Calling filter: com.adobe.granite.httpcache.impl.InnerCacheFilter
   3481 LOG Calling filter: org.apache.sling.rewriter.impl.RewriterFilter
   3484 LOG Calling filter: com.adobe.cq.mcm.campaign.servlets.CampaignCopyTracker
   3486 LOG Calling filter: com.day.cq.wcm.core.impl.WCMRequestFilter
   3489 LOG Calling filter: com.adobe.cq.wcm.core.components.internal.servlets.CoreFormHandlingServlet
   3491 LOG Calling filter: com.adobe.granite.optout.impl.OptOutFilter
   3496 LOG Calling filter: com.day.cq.wcm.foundation.forms.impl.FormsHandlingServlet
   3498 LOG Calling filter: com.adobe.cq.social.commons.cors.CORSAuthenticationFilter
   3500 LOG Calling filter: org.apache.sling.engine.impl.debug.RequestProgressTrackerLogFilter
   3513 LOG Calling filter: com.day.cq.wcm.mobile.core.impl.redirect.RedirectFilter
   3515 LOG Calling filter: com.day.cq.wcm.core.impl.AuthoringUIModeServiceImpl
   3518 LOG Calling filter: com.adobe.granite.csrf.impl.CSRFFilter
   3522 LOG Calling filter: com.adobe.granite.rest.assets.impl.AssetContentDispositionFilter
   3525 LOG Calling filter: com.adobe.granite.requests.logging.impl.RequestLoggerImpl
   3528 LOG Calling filter: com.adobe.granite.rest.impl.servlet.ApiResourceFilter
   3822 LOG Calling filter: com.adobe.cq.social.ugcbase.security.impl.SaferSlingPostServlet
   3826 LOG Calling filter: com.day.cq.dam.core.impl.assetlinkshare.AdhocAssetShareAuthHandler
   3831 LOG Calling filter: com.day.cq.dam.core.impl.servlet.ActivityRecordHandler
   3839 LOG Applying Componentfilters
   3841 LOG Calling filter: com.day.cq.personalization.impl.TargetComponentFilter
   3844 LOG Calling filter: com.day.cq.wcm.core.impl.PageLockFilter
   3846 LOG Calling filter: com.day.cq.wcm.core.impl.WCMComponentFilter
   3958 LOG Calling filter: com.day.cq.wcm.core.impl.WCMDebugFilter
   3962 TIMER_START{org.apache.sling.servlets.get.DefaultGetServlet#0}
   3966 LOG No renderer for extension html
   3970 LOG Applying Error filters
   3970 LOG Calling filter: org.apache.sling.i18n.impl.I18NFilter
   3971 LOG Calling filter: org.apache.sling.rewriter.impl.RewriterFilter
   3973 TIMER_START{handleError:status=404}
   4138 TIMER_END{163,handleError:status=404} Using handler org.apache.sling.servlets.resolver.internal.defaults.DefaultErrorHandlerServlet
   5244 LOG Found processor for post processing ProcessorConfiguration: {contentTypes=[text/html], order=-1, active=true, valid=true, processErrorResponse=true, pipeline=(generator=Config(type=htmlparser, config={}), transformers=(Config(type=linkchecker, config={}), Config(type=mobile, config=JcrPropertyMap [node=Node[NodeDelegate{tree=/libs/cq/config/rewriter/default/transformer-mobile: { jcr:primaryType = nt:unstructured, component-optional = true}}], values={jcr:primaryType=nt:unstructured, component-optional=true}]), Config(type=mobiledebug, config=JcrPropertyMap [node=Node[NodeDelegate{tree=/libs/cq/config/rewriter/default/transformer-mobiledebug: { jcr:primaryType = nt:unstructured, component-optional = true}}], values={jcr:primaryType=nt:unstructured, component-optional=true}]), Config(type=contentsync, config=JcrPropertyMap [node=Node[NodeDelegate{tree=/libs/cq/config/rewriter/default/transformer-contentsync: { jcr:primaryType = nt:unstructured, component-optional = true}}], values={jcr:primaryType=nt:unstructured, component-optional=true}]), serializer=Config(type=htmlwriter, config={}))}
   5340 TIMER_END{5339,Request Processing} Dumping SlingRequestProgressTracker Entries
 
The trace says org.apache.sling.servlets.get.DefaultGetServlet is used to render the response instead of specific one in this case it should heave been /libs/cq/ui/components/widget/html.jsp - this was the case for all the pages, default servlet were used for rendering the response.

  3455 TIMER_END{8,resolveServlet(/apps/wcm/core/content/siteadmin)} Using servlet org.apache.sling.servlets.get.DefaultGetServlet

  Based on the analysis

  •   All the bundles were active
  •   CRXDE and system console were accessible with out any issue
  •   There was no recent configuration changes or code deployment
  •   All the standard configurations were looking fine  

  Unfortunately we were not able to identify the root cause, it looks to be the server was not started completely last time.  The issue got resolved after restarting the server.


Tuesday, April 9, 2019

How to use the Request Processing Analyzer to analyze the recent requests in Adobe Experience Manager(AEM)

How to use the Request Processing Analyzer to analyze the recent requests in Adobe Experience Manager(AEM)


The “Recent Requests” is a very useful feature on the OSGi Felix Console to know what going on at each request, how is Sling resolving the resources and the time taken to load the sub resources.

This will help as to debug the resource resolution issues and also to capture the time taken to process the resources.

By default 20 recent request are captured in to the recent request console - http://localhost:4502/system/console/requests

Apache_Sling_Request_Processing_Analyzer

Apache_Sling_Request_Processing_Analyzer

The value "Number of Requests to Record" can be changed in the Apache Sling Main Servlet through OSGI console - http://localhost:4502/system/console/configMgr/org.apache.sling.engine.impl.SlingMainServlet

Also the "Recorded Request Path Patterns" can be specified in Apache Sling Main Servlet configuration to only capture the paths that matches the pattern - e.g capture only the json requests.

Apache_Sling_Request_Processing_Analyzer

Apache_Sling_Request_Processing_Analyzer

Unfortunately this will not help us to trace millions of request through console and also only the recent values will be shown based on the configuration.

Sometimes we may need to analyse huge requests during the load testing to identify the time taken by individual request and to identify the requests that taking more time to process.

Sling Request Processing Analyzer help to achieve the above scenario.

Sling Request Processing Analyzer logs each request in a special file - ${sling.home}/logs/requesttracker.txt with a header line providing core information on the request:

  • Start time stamp in ms since the Epoch
  • Request processing time in ms
  • Request Method
  • Request URL
  • Response content type (plus character encoding if available)
  • Response Status
After that first line the complete data from the requests RequestProgressTracker is dumped.

Configuring Request Processing Analyzer:

  • Download the Request Processing Analyzer bundle from https://github.com/apache/sling-org-apache-sling-reqanalyzer
  • Build the bundle - mvn clean install
  • Install the bundle(org.apache.sling.reqanalyzer-0.0.1-SNAPSHOT.jar) from target folder to server through OSGI console- http://localhost:4502/system/console/bundles


This will create a new log file - requesttracker.txt under ${sling.home}/logs and capture all the request details into the log file.

Apache_Sling_Request_Processing_Analyzer

Analyzing the log file:


The generated log file can be analyzed through the below command.

java -jar C:\sling-org-apache-sling-reqanalyzer-master\target\org.apache.sling.reqanalyzer-0.0.1-SNAPSHOT.jar requesttracker.txt

This will open the Swing GUI with basic request details - click on individual request to see more details about the request

Apache_Sling_Request_Processing_Analyzer

Apache_Sling_Request_Processing_Analyzer

The generated log file can be analyzed through system console - http://localhost:4502/system/console/requestanalyzer

Apache_Sling_Request_Processing_Analyzer
Click on Analyze Now action, this will open the same Swing GUI shown above.

Dumping the details to separate log file:


The Request Process details can be dumped to a separate log file for reference through Apache Sling Request Progress Tracker Log Filter - no bundle is required to be installed but this file can't be analyzed through the approach explained above. The dumped file details can be used for manual analysis.

Define a new logger with below details.

Apache_Sling_Request_Processing_Analyzer

Configure Apache Sling Request Progress Tracker Log Filter

Apache_Sling_Request_Processing_Analyzer

Configure the Extension filter with required file extensions for those the request details should be captured.

Select "Compact Log Format" - this will print the logs fin more readable format.

Apache_Sling_Request_Processing_Analyzer