RWS / dxa-web-application-java

SDL Digital Experience Accelerator Java Spring MVC web application
25 stars 37 forks source link

Unable to start when there is no context service #72

Closed janb87 closed 7 years ago

janb87 commented 7 years ago

The Content Delivery instance I'm using has no context service installed (there is no web service available).

DXA fails upon initialization when I run it. I tried enabling / disabling adf but this doesn't make any difference. I'm running this against the latest 1.7.0-SNAPSHOT.

Stack trace of the issue.

09:09:47.246 [RMI TCP Connection(3)-127.0.0.1] WARN  c.s.c.o.c.ContextServiceClientConfiguration - Unable to resolve ContextService uri using discovery service. Proceeding with fallback variant.
com.sdl.web.client.configuration.api.ConfigurationException: ContextServiceCapability not defined!
    at com.sdl.context.odata.client.ContextServiceClientConfiguration.lambda$resolveContextServiceUriUsingDiscoveryService$0(ContextServiceClientConfiguration.java:102) ~[context-client-8.5.0-1013.jar:8.5.0-1013]
    at java.util.Optional.orElseThrow(Optional.java:290) ~[na:1.8.0_92]
    at com.sdl.context.odata.client.ContextServiceClientConfiguration.resolveContextServiceUriUsingDiscoveryService(ContextServiceClientConfiguration.java:101) ~[context-client-8.5.0-1013.jar:8.5.0-1013]
    at com.sdl.context.odata.client.ContextServiceClientConfiguration.readClientConfiguration(ContextServiceClientConfiguration.java:42) ~[context-client-8.5.0-1013.jar:8.5.0-1013]
    at com.sdl.context.odata.client.api.ODataContextEngine.<init>(ODataContextEngine.java:32) [context-client-8.5.0-1013.jar:8.5.0-1013]
    at com.sdl.webapp.tridion.contextengine.ContextServiceClaimsProvider.init(ContextServiceClaimsProvider.java:78) [dxa-web8-provider-1.7.0-SNAPSHOT.jar:1.7.0-SNAPSHOT]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_92]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_92]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_92]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_92]
janb87 commented 7 years ago

Relates to #70

azarakovskiy commented 7 years ago

Internal ID: TSI-2200. To reproduce the issue you have to remove the capability. Just disabling service is not enough.

rpannekoek commented 7 years ago

Fixed in DXA 1.7

janb87 commented 7 years ago

I've looked at the code changes and the issue is only partially solved.

In our scenario "public Map<String, Object> getContextClaims(String aspectName) throws DxaException {" would always throw an exception on every request.

@azarakovsky What are your suggestions on fixing this? Should we extend something to overwrite this behavior?

azarakovskiy commented 7 years ago

@janb87 I don't really understand. It seems you're trying to use ContextServiceClaimsProvider without Context Service. This will never work of course, you have to either switch to ADF or enable Context Service.