Friday, April 1, 2016

ATG Endeca Assembler Integration : Unable to resolve NavigationState component with NullPointerException - Internal Server Error (500)

Behaviour : - Following exceptions/errors comes while processing serving client request 15:51:09,509 ERROR [nucleusNamespace] (ht... thumbnail 1 summary
Behaviour : -

Following exceptions/errors comes while processing serving client request

15:51:09,509 ERROR [nucleusNamespace] (http-/0.0.0.0:8380-10) null: 
atg.nucleus.InstanceFactoryException: Error invoking method public 
com.endeca.infront.navigation.NavigationState com.endeca.infront.navigation.url.
UrlNavigationStateBuilder.parseNavigationState(javax.servlet.http.HttpServletRequest) 
throws com.endeca.infront.navigation.NavigationException on instance 
atg.endeca.assembler.navigation.ExtendedNavigationStateBuilder@1682b72f with parameters :[ContentLength: -1
        at atg.nucleus.factory.instance.MethodInstanceFactory.createInstance(MethodInstanceFactory.java:312) [_DAS_slib_sclasses.jar:]
        at atg.nucleus.MultiRootNameResolver.createFromName(MultiRootNameResolver.java:833) [_DAS_slib_sclasses.jar:]
        at atg.nucleus.MultiRootNameResolver.resolveName(MultiRootNameResolver.java:455) [_DAS_slib_sclasses.jar:]
        at atg.nucleus.ConfigurationRef.getValue(ConfigurationRef.java:119) [_DAS_slib_sclasses.jar:]
        at atg.nucleus.factory.instance.AbstractParameterInstanceFactory
.resolveParameterValues(AbstractParameterInstanceFactory.java:475) [_DAS_slib_sclasses.jar:]
Caused by: java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_55]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_55]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_55]
        at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_55]
        at atg.nucleus.factory.instance.MethodInstanceFactory.
createInstance(MethodInstanceFactory.java:303) [_DAS_slib_sclasses.jar:]
        ... 106 more
Caused by: com.endeca.infront.navigation.NavigationException: 
com.endeca.soleng.urlformatter.UrlFormatException: 
Request query string is improperly encoded: parameter field contains multiple '=' signs: test=test=123
        at com.endeca.infront.navigation.url.UrlNavigationStateBuilder.parseNavigationState
(UrlNavigationStateBuilder.java:355) [_DAF.Endeca.Assembler_slib_sendeca__assembler__navigation-11.1.0.jar:11.1.0]
        at atg.endeca.assembler.navigation.ExtendedNavigationStateBuilder.parseNavigationState
(ExtendedNavigationStateBuilder.java:312) [_DAF.Endeca.Assembler_slib_sclasses.jar:]
        at com.endeca.infront.navigation.url.UrlNavigationStateBuilder.parseNavigationState
(UrlNavigationStateBuilder.java:324) [_DAF.Endeca.Assembler_slib_sendeca__assembler__navigation-11.1.0.jar:11.1.0]
        ... 111 more
Caused by: com.endeca.soleng.urlformatter.UrlFormatException: 
Request query string is improperly encoded: parameter field contains multiple '=' signs: test=test=123
        at com.endeca.soleng.urlformatter.seo.SeoUrlFormatter.parseQueryString(SeoUrlFormatter.java:736) [_DAF.Endeca.Assembler_slib_sendeca__assembler__navigation-11.1.0.jar:11.1.0]
        at com.endeca.soleng.urlformatter.seo.SeoUrlFormatter.parseRequest(SeoUrlFormatter.java:451) [_DAF.Endeca.Assembler_slib_sendeca__assembler__navigation-11.1.0.jar:11.1.0]
        at com.endeca.infront.navigation.url.UrlNavigationStateBuilder.parseNavigationState
(UrlNavigationStateBuilder.java:352) [_DAF.Endeca.Assembler_slib_sendeca__assembler__navigation-11.1.0.jar:11.1.0]
        ... 113 more

15:51:09,546 ERROR [nucleusNamespace] (http-/0.0.0.0:8380-10) null: atg.nucleus.InstanceFactoryException: 

Error invoking constructor public com.endeca.infront.content.MdexContentRequestBroker(
com.endeca.infront.navigation.model.MdexResource,com.endeca.infront.navigation.NavigationState,
com.endeca.infront.navigation.UserState,com.endeca.infront.site.model.SiteState,boolean)
        at atg.nucleus.factory.instance.ParameterConstructorInstanceFactory.createInstance
(ParameterConstructorInstanceFactory.java:179) [_DAS_slib_sclasses.jar:]
        at atg.nucleus.PropertyConfiguration.loadFromInstanceFactory(PropertyConfiguration.java:697) [_DAS_slib_sclasses.jar:]
        at atg.nucleus.PropertyConfiguration.createNewInstance(PropertyConfiguration.java:780) [_DAS_slib_sclasses.jar:]
Caused by: atg.nucleus.ConfigurationException: Unable to resolve component /atg/endeca/assembler/cartridge/manager/NavigationState
        at atg.nucleus.ConfigurationRef.getValue(ConfigurationRef.java:125) [_DAS_slib_sclasses.jar:]
        at atg.nucleus.factory.instance.AbstractParameterInstanceFactory.resolveParameterValues
(AbstractParameterInstanceFactory.java:475) [_DAS_slib_sclasses.jar:]
        at atg.nucleus.factory.instance.ParameterConstructorInstanceFactory.
createInstance(ParameterConstructorInstanceFactory.java:159) [_DAS_slib_sclasses.jar:]
        ... 97 more


Solution:-

The issue comes when requests contain unencoded "=" characters. Endeca OOTB does not generate any URL that contains "=" character as part of value in but this could come from cross site forgery or third party.

NavigationStateBuilder gets fails and gives NullPointerException if  "=" sign in query parameter va;ue

Example :- http://localhost:8080/crs/browse/Women-Pants/_/N-16ey25s?Test=test=1

This issue can be fixed if "=" signs are encoded as part of query parameter value.

so URL should be like :
http://localhost:8080/crs/browse/Women-Pants/_/N-16ey25s?Test=test%3D1

Click here to get more information related to ATG-Endeca Integration.

It's your Turn
Was this post help you to resolve the issue that you are looking for? Any other issues that you might have and need a solution?

Click here for more ATG-Endeca Integration related issue.


Provide your feedback in the comment section below.

3 comments

  1. http://localhost:8080/crs/storeus/browse/Men/_/N-tj6o6j does not pass category id to Endeca. N-tj6o6j , where "tj6o6j" is the encoded N-value. Endeca has feature to store properties inside the dimension value. OOTB CRS stores categoryid, siteid and few other properties get stored as part of dimension values.
    Example :- {DisplayOrder=0, SourceId=6, category.ancestorCatalogIds=mastercatalog, category.catalogs.repositoryId=mastercatalog, category.repositoryId=6, category.rootCatalogId=mastercatalog, category.siteId=home,crsHome, DGraph.Bins=20}

    ATG Manages a cache to map dimension value with category id under /atg/commerce/endeca/cache/DimensionValueCacheTools components. use printCacheMap to print the complete map.

    I hope this helps.

    Thanks,
    Ajay Agrawal

    ReplyDelete
  2. Hi

    I am facing this exception and nothing seems to work.

    Unable to resolve component /atg/endeca/assembler/cartridge/manager/NavigationState

    ReplyDelete
    Replies
    1. could you please send me the complete exception?

      Thanks,
      Ajay Agrawal

      Delete

Text Widget