cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

/my-accounts URLs giving server error on first hit

former_member637004
Discoverer
0 Likes
357

Hi All,

I'm seeing null pointer exception when I hit the url https://hostname/my-account for the first time after clearing cache. Once reloaded issue is disappeared. Below is the exception.

SEVERE: Servlet.service() for servlet [DispatcherServlet] in context with path [] threw exception [Error while processing internal filterchain. Exception occurred at chain position: 12 of 16. Current filter: 'FilterChainProxy[Filter Chains: [[ Ant [pattern='/_ui/**'], []], [ Ant [pattern='/checkout/**'], [org.springframework.security.web.access.channel.ChannelProcessingFilter@17a77771, org.springframework.security.web.context.SecurityContextPersistenceFilter@7bcbaab4, org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@41e7bec2, org.springframework.security.web.header.HeaderWriterFilter@8489662, org.springframework.security.web.authentication.logout.LogoutFilter@247864e5, org.springframework.security.web.csrf.CsrfFilter@2c0e4d4, org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter@7e2d4be0, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@321a39c1, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@55223c2b, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@5041841f, org.springframework.security.web.session.SessionManagementFilter@4427b7bc, org.springframework.security.web.access.ExceptionTranslationFilter@27905ac8, org.springframework.security.web.access.intercept.FilterSecurityInterceptor@6397f975]], [ com.abc.storefront.security.ExcludeUrlRequestMatcher@4e208a07, [org.springframework.security.web.access.channel.ChannelProcessingFilter@4ca8b6d4, org.springframework.security.web.context.SecurityContextPersistenceFilter@55679ac1, org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@2f08d751, org.springframework.security.web.header.HeaderWriterFilter@65b21005, org.springframework.security.web.authentication.logout.LogoutFilter@247864e5, org.springframework.security.web.csrf.CsrfFilter@6ca50471, org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter@57d3ab6, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@6ca6c717, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@19e1d0be, org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter@5da3c97f, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@3167e0f7, org.springframework.security.web.session.SessionManagementFilter@6b2307b3, org.springframework.security.web.access.ExceptionTranslationFilter@7cd05e49, org.springframework.security.web.access.intercept.FilterSecurityInterceptor@3f7b889d]]]]'!; nested exception is java.lang.NullPointerException] with root cause
java.lang.NullPointerException
        at com.abc.storefront.util.SiteThemeResolverUtils.resolveThemeForCurrentSite(SiteThemeResolverUtils.java:35)
        at com.abc.storefront.web.theme.StorefrontResourceBundleSource.determineDefaultThemeName(StorefrontResourceBundleSource.java:215)
        at com.abc.storefront.web.theme.StorefrontResourceBundleSource.getMessage(StorefrontResourceBundleSource.java:190)
        at org.springframework.context.support.AbstractApplicationContext.getMessage(AbstractApplicationContext.java:1253)
        at org.springframework.context.support.MessageSourceAccessor.getMessage(MessageSourceAccessor.java:85)

On further debugging, I understood the issue is due to session attribute DETECTED_UI_EXPERIENCE_LEVEL is null for the first time in DefaultUiExperienceService.java, but from second hit, the value is somehow populating with "DESKTOP" and there will not be any issue.

The same issue has also been reported below by some others.

https://stackoverflow.com/questions/59926387/getting-servoor-error-while-accesing-this-https-apparel...

	@Override
	public UiExperienceLevel getUiExperienceLevel()
	{
		// Lookup the UiExperienceLevel override specified in the current session
		final UiExperienceLevel sessionOverrideUiExperienceLevel = getOverrideUiExperienceLevel();
		if (sessionOverrideUiExperienceLevel != null)
		{
			return sessionOverrideUiExperienceLevel;
		}


		return getDetectedUiExperienceLevel();
	}



	@Override
	public UiExperienceLevel getDetectedUiExperienceLevel()
	{
		return getSessionService().getAttribute(DETECTED_UI_EXPERIENCE_LEVEL);
	}

Accepted Solutions (0)

Answers (0)