I am getting Claimstore as Null in java. My claim store is null from the below code.:
@SneakyThrows(ParseException.class)
private ResultSet executeSmartTargetQuery(AbstractSmartTargetPageModel stPageModel, final TcmUri pageUri) throws SmartTargetException {
TcmUri publicationUri = new TcmUri(TcmUtils.buildPublicationTcmUri(pageUri.getPublicationId()));
ClaimStore claimStore = AmbientDataContext.getCurrentClaimStore();
System.out.println("Claim Store "+ claimStore);
String triggers = AmbientDataHelper.getTriggers(claimStore);
I got to know the filter mapping to be add, ADF ClaimStore not available (null) in Java Application After that I added the filter in below code, I am getting 404 Error:
public class WebAppConfiguration implements WebApplicationInitializer {
@Override
public void onStartup(ServletContext servletContext) throws ServletException {
AnnotationConfigWebApplicationContext servletAppContext = new AnnotationConfigWebApplicationContext();
servletAppContext.register(DxaSpringInitialization.class);
servletAppContext.register(CeairModuleInitializer.class);
servletContext.addListener(new ContextLoaderListener(servletAppContext));
ServletRegistration.Dynamic registration = servletContext.addServlet("DispatcherServlet", new DispatcherServlet(servletAppContext));
registration.setLoadOnStartup(1);
registration.addMapping("/");
registerFilter(servletContext, AmbientClientFilter.class, "/*");
}
MY dxa.property file is as follows :
#EHCache configuration
#cache expired elements for amount of seconds
cache.expired.ttl=120
cache.dependency.ttl=120
cache.ttl=1800
## DXA
# Web Properties
#dxa.web.views.prefix=/WEB-INF/Views/
#dxa.web.views.suffix=.jsp
# Possible profiles:
# search.aws - Activates AWS in Search, Not compatible with search.solr
# search.solr - Activates SOLR in Search, Not compatible with search.aws
# dxa.no-cache - Makes DXA use NoCacheProvider in Tridion
# test Activates - Testing context, Only affects unit testing. Activated in Tests by default. Doesnt affect application.
spring.profiles.active=search.solr,adf.context.provider
# Multiple-line configuration is possible
#spring.profiles.active=search.solr, \
# dxa.no-cache
#spring.profiles.include=
## Modules
# - All commented are optional
# Mapping for CID resolver (Filter or Servlet)
#dxa.modules.cid.mapping=/cid/*
# Class to use as a resolver for CID images
dxa.modules.cid.className=com.sdl.context.image.servlet.ImageTransformerServlet
# External path to the server which runs DXA for back-mapping for CID Service
#dxa.modules.cid.appHostMapping=localhost:8088
# Redirect link for XO GA client
#dxa.modules.xo.fallbackRedirectUrl=/redirect/
Do someone have any idea, how to solve it.