2

I have set up a fresh Web 8.5 install, and a fresh DXA 1.7 Java web app. However, when I try to start my webapp, I get an error

com.sdl.odata.client.api.exception.ODataClientHttpError: Unable to get response from OData service: <?xml version="1.0" encoding="UTF-8"?><metadata:error xmlns:metadata="http://docs.oasis-open.org/odata/ns/metadata"><metadata:code>9000</metadata:code><metadata:message>org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'storageFactoryConfigurationLoader': Invocation of init method failed; nested exception is java.lang.NullPointerException</metadata:message></metadata:error>

com.sdl.odata.client.util.ODataClientUtils.buildException(ODataClientUtils.java:93)
com.sdl.odata.client.caller.BasicEndpointCaller.getResponse(BasicEndpointCaller.java:199)
com.sdl.odata.client.caller.BasicEndpointCaller.callEndpoint(BasicEndpointCaller.java:82)
com.sdl.odata.client.DefaultODataClient.getODataResponse(DefaultODataClient.java:141)
com.sdl.odata.client.DefaultODataClient.getEntity(DefaultODataClient.java:69)
com.sdl.context.odata.client.ODataContextEngineProxy.resolve(ODataContextEngineProxy.java:107)
com.sdl.context.odata.client.CachingContextEngine.resolve(CachingContextEngine.java:61)
com.sdl.context.odata.client.api.ODataContextEngine.resolve(ODataContextEngine.java:46)
com.sdl.webapp.tridion.contextengine.ContextServiceClaimsProvider.getContextClaims(ContextServiceClaimsProvider.java:101)
com.sdl.webapp.common.impl.contextengine.ContextEngineImpl.claims(ContextEngineImpl.java:52)
com.sdl.webapp.common.impl.contextengine.ContextEngineImpl.getClaims(ContextEngineImpl.java:32)
com.sdl.webapp.common.impl.contextengine.ContextEngineImpl.deviceFamily(ContextEngineImpl.java:67)
com.sdl.webapp.common.impl.contextengine.ContextEngineImpl.getDeviceFamily(ContextEngineImpl.java:27)
com.sdl.dxa.DxaSpringInitialization$1.processDeviceFamily(DxaSpringInitialization.java:112)
com.sdl.dxa.DxaSpringInitialization$1.resolveViewName(DxaSpringInitialization.java:94)
org.springframework.web.servlet.DispatcherServlet.resolveViewName(DispatcherServlet.java:1211)
org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1160)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:950)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778)
javax.servlet.http.HttpServlet.service(HttpServlet.java:635)
javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
com.tridion.ambientdata.web.AbstractAmbientDataServletFilter.doFilter(AbstractAmbientDataServletFilter.java:286)

As this looks like an error with my context microservice, I looked at the logs of this service. The service itself started fine, and showed no errors when loading.

However, upon the first request from DXA, I notice the following error in the context service logs

2017-10-05 21:55:40,454 ERROR ODataQueryProcessorImpl - Unexpected Exception when executing query.
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'storageFactoryConfigurationLoader': Invocation of init method failed; nested exception is java.lang.NullPointerException
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:136)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:408)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1575)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:751)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:861)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:541)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83)
at com.tridion.cd.core.kernel.SpringContentDeliveryKernel.ensureInitialised(SpringContentDeliveryKernel.java:38)
at com.tridion.cd.core.kernel.KernelFactory.registerKernel(KernelFactory.java:40)
at com.tridion.cd.core.kernel.KernelFactory.getKernel(KernelFactory.java:27)
at com.tridion.storage.StorageManagerFactory.getComponent(StorageManagerFactory.java:70)
at com.tridion.storage.StorageManagerFactory.getStorageManager(StorageManagerFactory.java:49)
at com.tridion.storage.StorageManagerFactory.getDAO(StorageManagerFactory.java:175)
at com.tridion.storage.StorageManagerFactory.getDAO(StorageManagerFactory.java:149)
at com.sdl.context.api.ContextExpressionServiceImpl.getDAOSafely(ContextExpressionServiceImpl.java:91)
at com.sdl.context.api.ContextExpressionServiceImpl.loadContextExpressions(ContextExpressionServiceImpl.java:37)
at com.sdl.context.engine.SimpleContextEngine.updateVocabulary(SimpleContextEngine.java:257)
at com.sdl.context.engine.SimpleContextEngine.enrichedResolve(SimpleContextEngine.java:274)
at com.sdl.context.engine.SimpleContextEngine.resolve(SimpleContextEngine.java:216)
at com.sdl.context.odata.datalayer.dao.ODataContextMapDao.selectByKeyOperation(ODataContextMapDao.java:152)
at com.sdl.context.odata.datalayer.dao.ODataContextMapDao.executeQueryListResult(ODataContextMapDao.java:132)
at com.sdl.context.odata.datalayer.dao.ODataContextMapDao$$FastClassBySpringCGLIB$$a7568043.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:720)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:136)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:655)
at com.sdl.context.odata.datalayer.dao.ODataContextMapDao$$EnhancerBySpringCGLIB$$21e21606.executeQueryListResult(<generated>)
at com.sdl.context.odata.datalayer.ContextDataSource.executeQueryListResult(ContextDataSource.java:124)
at com.sdl.context.odata.datalayer.ContextDataSourceProvider$1.execute(ContextDataSourceProvider.java:49)
at com.sdl.odata.processor.ODataQueryProcessorImpl.query(ODataQueryProcessorImpl.java:94)
at com.sdl.odata.service.actor.ODataQueryProcessorActor$$anonfun$receive$1.applyOrElse(ODataQueryProcessorActor.scala:38)
at akka.actor.Actor$class.aroundReceive(Actor.scala:480)
at com.sdl.odata.service.actor.ODataQueryProcessorActor.aroundReceive(ODataQueryProcessorActor.scala:29)
at akka.actor.ActorCell.receiveMessage(ActorCell.scala:526)
at akka.actor.ActorCell.invoke(ActorCell.scala:495)
at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:257)
at akka.dispatch.Mailbox.run(Mailbox.scala:224)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException: null
at com.tridion.storage.configuration.StorageFactoryConfigurationLoader.configure(StorageFactoryConfigurationLoader.java:60)
at com.tridion.storage.configuration.StorageFactoryConfigurationLoader.initialize(StorageFactoryConfigurationLoader.java:53)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:365)
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:310)
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:133)
... 48 common frames omitted

From the error, it looks like it can't seem to initialize the storage configuration. However, I just copied the microservice configuration from the SDL Web Installation directory, and kept all default settings.

Am I missing something in my setup ?

The storage config looks very minimal

<?xml version="1.0" encoding="UTF-8"?><Configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Version="8.5" xsi:noNamespaceSchemaLocation="schemas/cd_storage_conf.xsd">
<ConfigRepository CacheEnabled="true" CacheExpirationDuration="600" ClientId="registration" ClientSecret="*****" ConnectionTimeout="10000" ServiceMonitorPollDuration="10" ServiceUri="${discoveryurl:-http://localhost:8082/discovery.svc}" TokenServiceUrl="${tokenurl:-http://localhost:8082/token.svc}">
    <Roles>
        <Role Name="ContextServiceCapability" Url="${contexturl:-http://localhost:8087/context.svc}"/>
    </Roles>
</ConfigRepository>

Small update: the error seems to go away if I disable the context-expression-module. However, we're planning on using this module, so just leaving it out isn't an option

3
  • 1
    Just rebooted my server, and the error seems to have gone. Very odd... Oct 5, 2017 at 22:52
  • 1
    Please self answer your question with this information, after a few days you can accept your answer and that will close the question, making it a vallid resource for people encountering the same in the future. Oct 6, 2017 at 13:29
  • 1
    actually, the error returned about an hour ago, so it's not really solved yet. Oct 6, 2017 at 14:26

1 Answer 1

2

Above issue sure for cd_storage_config.xml issue on context service

Here is the working config:

<?xml version="1.0" encoding="UTF-8"?>
<Configuration Version="8.5"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="../schemas/cd_storage_conf.xsd">
  <Global>

    <ObjectCache Enabled="false">
    </ObjectCache>

    <Storages>
      <StorageBindings>
        <Bundle src="storage_extension_dao_bundle.xml"/>
      </StorageBindings>

      <Storage Class="com.tridion.storage.persistence.JPADAOFactory" Type="persistence" Id="defaultdb" dialect="MSSQL" >
        <Pool Type="jdbc" CheckoutTimeout="120" IdleTimeout="120" MonitorInterval="60" Size="5"/>
        <DataSource Class="com.microsoft.sqlserver.jdbc.SQLServerDataSource">
          <Property Name="serverName" Value="localhost" />
          <Property Name="portNumber" Value="1433" />
          <Property Name="databaseName" Value="xxxx" />
          <Property Name="user" Value="xxxx" />
          <Property Name="password" Value="xxxx" />
        </DataSource>
      </Storage>
    </Storages>
  </Global>

  <ItemTypes defaultStorageId="defaultdb" cached="true">
  </ItemTypes>

  <License Location="C:/SDL/licenses/cd_licenses.xml"/>

</Configuration>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.