You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by GitBox <gi...@apache.org> on 2021/08/19 03:34:19 UTC

[GitHub] [servicecomb-java-chassis] hhj-cmd11 opened a new issue #2518: ServiceCombo 2.0.2 upgrade to 2.1.5, failed to find cipher named

hhj-cmd11 opened a new issue #2518:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2518


   [ INFO ]:2021-08-19 02:58:14 [main] MicroserviceRegisterTask:80 - running microservice register task.
   [ ERROR]:2021-08-19 02:58:14 [registry-vert.x-eventloop-thread-0] ContextImpl:413 - Unhandled exception
   java.lang.IllegalArgumentException: failed to find cipher named genex-security
           at org.apache.servicecomb.huaweicloud.servicestage.AKSKAuthHeaderProvider.lambda$findCipher$1(AKSKAuthHeaderProvider.java:128) ~[servicestage-2.1.5.jar:2.1.5]
           at java.util.Optional.orElseThrow(Optional.java:290) ~[?:1.8.0_272]
           at org.apache.servicecomb.huaweicloud.servicestage.AKSKAuthHeaderProvider.findCipher(AKSKAuthHeaderProvider.java:128) ~[servicestage-2.1.5.jar:2.1.5]
           at org.apache.servicecomb.huaweicloud.servicestage.AKSKAuthHeaderProvider.getSecretKey(AKSKAuthHeaderProvider.java:107) ~[servicestage-2.1.5.jar:2.1.5]
           at org.apache.servicecomb.huaweicloud.servicestage.AKSKAuthHeaderProvider.load(AKSKAuthHeaderProvider.java:92) ~[servicestage-2.1.5.jar:2.1.5]
           at org.apache.servicecomb.huaweicloud.servicestage.AKSKAuthHeaderProvider.authHeaders(AKSKAuthHeaderProvider.java:84) ~[servicestage-2.1.5.jar:2.1.5]
           at org.apache.servicecomb.foundation.auth.AuthHeaderProvider.getSignAuthHeaders(AuthHeaderProvider.java:29) ~[foundation-spi-2.1.5.jar:2.1.5]
           at org.apache.servicecomb.serviceregistry.client.http.RestClientUtil.lambda$getSignAuthHeaders$3(RestClientUtil.java:226) ~[registry-service-center-2.1.5.jar:2.1.5]
           at java.util.ArrayList.forEach(ArrayList.java:1259) ~[?:1.8.0_272]
           at org.apache.servicecomb.serviceregistry.client.http.RestClientUtil.getSignAuthHeaders(RestClientUtil.java:226) ~[registry-service-center-2.1.5.jar:2.1.5]
           at org.apache.servicecomb.serviceregistry.client.http.RestClientUtil.lambda$httpDo$2(RestClientUtil.java:146) ~[registry-service-center-2.1.5.jar:2.1.5]
           at org.apache.servicecomb.foundation.vertx.client.http.HttpClientWithContext.lambda$runOnContext$0(HttpClientWithContext.java:43) ~[foundation-vertx-2.1.5.jar:2.1.5]
           at io.vertx.core.impl.ContextImpl.executeTask(ContextImpl.java:366) ~[vertx-core-3.9.4.jar:3.9.4]
           at io.vertx.core.impl.EventLoopContext.lambda$executeAsync$0(EventLoopContext.java:38) ~[vertx-core-3.9.4.jar:3.9.4]
           at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164) [netty-common-4.1.63.Final.jar:4.1.63.Final]
           at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:472) [netty-common-4.1.63.Final.jar:4.1.63.Final]
           at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:500) [netty-transport-4.1.63.Final.jar:4.1.63.Final]
           at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989) [netty-common-4.1.63.Final.jar:4.1.63.Final]
           at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) [netty-common-4.1.63.Final.jar:4.1.63.Final]
           at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [netty-common-4.1.63.Final.jar:4.1.63.Final]
           at java.lang.Thread.run(Thread.java:748) [?:1.8.0_272]
   
   
   
   my configuration:
   
   server:
     akskCustomCipher: genex-security 
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-java-chassis] liubao68 commented on issue #2518: ServiceCombo 2.0.2 upgrade to 2.1.5, failed to find cipher named

Posted by GitBox <gi...@apache.org>.
liubao68 commented on issue #2518:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2518#issuecomment-901586918


   是否有调试下堆栈里面提示的代码:AKSKAuthHeaderProvider,看看业务自定的SPI、bean(genex-security)是否加载。 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-java-chassis] zyx-zyj commented on issue #2518: ServiceCombo 2.0.2 upgrade to 2.1.5, failed to find cipher named

Posted by GitBox <gi...@apache.org>.
zyx-zyj commented on issue #2518:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2518#issuecomment-915840680


   在调试业务自定的SPI加载时,在调用BeanUtils.getBeansOfType(Cipher.class)时获取的map size
   为0
   private Cipher findCipher() {
           if ("default".equals(this.getCipher())) {
               return DefaultCipher.getInstance();
           } else {
               Map<String, Cipher> cipherBeans = BeanUtils.getBeansOfType(Cipher.class);
               return (Cipher)cipherBeans.values().stream().filter((c) -> {
                   return c.name().equals(this.getCipher());
               }).findFirst().orElseThrow(() -> {
                   return new IllegalArgumentException("failed to find cipher named " + this.getCipher());
               });
           }
       }
   断点调试发现BeanUtils的ApplicationContext context为null,请问还需要配置什么吗?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-java-chassis] zyx-zyj commented on issue #2518: ServiceCombo 2.0.2 upgrade to 2.1.5, failed to find cipher named

Posted by GitBox <gi...@apache.org>.
zyx-zyj commented on issue #2518:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2518#issuecomment-916563210


   问题已解决,BeanUtils.getBeansOfType(Cipher.class)是2.2.0版本使用的方法,切换2.5.1版本后使用的SPIServiceUtils.getOrLoadSortedService(Cipher.class)方法,成功实现自定义加密操作


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org