- 22, Oct 2024
- #1
Я установил службы доставки контента, выполнив команду fastinstall.sh.
SDL Web OAuth 2.0 Token Servlet.
Среда — Linux и Java. Затем изменил cd_storage_conf.xml службы Discovery, добавив атрибут TokenServiceUrl в соответствии с этим сообщением.
Ошибка со службой Discovery и Discovery_registration.jar
{"error":"invalid_grant"}
Также я изменил настройки хранилища на настройки моей БД.
Но при выполнении следующей команды произошла ошибка. Я поместил «discovery-registration.jar» в каталог конфигурации службы Discovery.
[root@ip-10-0-1-98 config]# java -jar discovery-registration.jar update
2016-06-08 05:20:18,412 INFO Main - Registration tool is run with following parameters:
2016-06-08 05:20:18,415 INFO Main - Configuration file: cd_storage_conf.xml
2016-06-08 05:20:18,416 INFO Main - The Command is: update
2016-06-08 05:20:18,417 INFO RegistrationTool - Reading configuration from file: 'cd_storage_conf.xml'
2016-06-08 05:20:18,494 INFO ODataClientProvider - Creating OData client
2016-06-08 05:20:19,388 INFO ODataClientProvider - Successfully created OData client
2016-06-08 05:20:19,388 INFO ODataClientProvider - Creating token provider for OAuth enabled OData client
2016-06-08 05:20:19,774 INFO DefaultDiscoveryClient - Capability: class com.sdl.web.discovery.datalayer.model.TokenServiceCapability not found.
2016-06-08 05:20:19,776 INFO ODataClientProvider - Creating token provider using TokenServiceUrl from configuration file
2016-06-08 05:20:19,869 INFO ODataClientProvider - Successfully created token provider for OAuth enabled OData client
2016-06-08 05:20:19,869 INFO UpdateCommand - Updating Capabilities in the discovery-service...
Exception in thread "main" com.sdl.web.client.ClientException: Unable to obtain OAuth token from discovery service. Probably Discovery service is not up and running.
at com.sdl.web.client.impl.DefaultOAuthClient.obtainTokenResult(DefaultOAuthClient.java:129)
at com.sdl.web.client.impl.DefaultOAuthClient.doFetchOAuthToken(DefaultOAuthClient.java:100)
at com.sdl.web.client.impl.DefaultOAuthClient.getToken(DefaultOAuthClient.java:79)
at com.sdl.web.client.impl.OAuthTokenProvider.getToken(OAuthTokenProvider.java:70)
at com.sdl.web.discovery.registration.ODataClientProvider.provideClient(ODataClientProvider.java:129)
at com.sdl.web.discovery.registration.command.AbstractCommand.getCapabilitiesFromService(AbstractCommand.java:33)
at com.sdl.web.discovery.registration.command.AbstractCommand.lambda$getExistingCapabilities$2(AbstractCommand.java:65)
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1374)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
at com.sdl.web.discovery.registration.command.AbstractCommand.getExistingCapabilities(AbstractCommand.java:67)
at com.sdl.web.discovery.registration.command.UpdateCommand.performCommand(UpdateCommand.java:46)
at com.sdl.web.discovery.registration.RegistrationTool.performCommand(RegistrationTool.java:62)
at com.sdl.web.discovery.registration.Main.main(Main.java:36)
Caused by: com.sdl.odata.client.api.exception.ODataClientException: Unable to process response from OData service.
at com.sdl.odata.client.caller.BasicEndpointCaller.getResponse(BasicEndpointCaller.java:224)
at com.sdl.odata.client.caller.BasicEndpointCaller.sendRequest(BasicEndpointCaller.java:145)
at com.sdl.odata.client.caller.BasicEndpointCaller.doPostEntity(BasicEndpointCaller.java:105)
at com.sdl.web.client.impl.DefaultOAuthClient.obtainTokenResult(DefaultOAuthClient.java:115)
... 17 more
Caused by: java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
at java.net.SocketInputStream.read(SocketInputStream.java:170)
at java.net.SocketInputStream.read(SocketInputStream.java:141)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:246)
at java.io.BufferedInputStream.read1(BufferedInputStream.java:286)
at java.io.BufferedInputStream.read(BufferedInputStream.java:345)
at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:704)
at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:647)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1536)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1441)
at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:480)
at com.sdl.odata.client.caller.BasicEndpointCaller.getResponse(BasicEndpointCaller.java:204)
... 20 more
Обновление java -jar Discovery-registration.jar
http://10.0.x.xx:8082/discovery.svc
<ConfigRepository ServiceUri="http://10.0.x.xx:8082/discovery.svc"
ConnectionTimeout="40000"
CacheEnabled="true"
CacheExpirationDuration="600"
ServiceMonitorPollDuration="10"
ClientId="registration"
ClientSecret="encrypted:HzfQh9wYwAKShDxCm4DnnBnysAz9PtbDMFXMbPszSVY="
TokenServiceUrl="http://10.0.x.xx:8082/token.svc">
<Roles>
<Role Name="TokenServiceCapability" Url="http://10.0.x.x:8082/token.svc"/>
</Roles>
</ConfigRepository>
http://10.0.x.xx:8082/token.svc
./quickinstall.sh --all -s /home/user/Content\ Delivery/roles --license /home/user/cd_licenses.xml
URL-адреса «discovery.svc» и «token.svc» возвращаются после каждого результата.
Я думаю, это означает, что служба Discovery работает нормально.
Почему команда «discovery-registration.jar» не работает?
Есть ли необходимая конфигурация?