急求大佬指导grpc python进行安全连接的代码(有PHP版本的代码,改写成python) 10C

急求大佬,我现在在用python写grpc的客户端,用来获取数据提供商的股票数据。提供商只给了我一个PHP版本的代码用作指导,但是我需要用python写。其他地方都没有问题了,只有安全连接这个部分卡住了,查了两天也没查到解决办法。。用了好几种api可是都不行。情况就是有url,端口,.pem格式的证书以及账号和密码。大概的思路应该是在建立channel的时候带入额外的账号密码等信息?
求大佬帮忙看看用python怎么写呢。。跪谢大佬了!

下面为php代码:
图片说明

下面为我写的不好用的python代码:

 from __future__ import print_function

import grpc

import historicalQuote_pb2
import historicalQuote_pb2_grpc
import common_pb2
import common_pb2_grpc
import marketData_pb2
import marketData_pb2_grpc

import os

from google import auth as google_auth
from google.auth.transport import grpc as google_auth_transport_grpc
from google.auth.transport import requests as google_auth_transport_requests

def run():
    symbol = common_pb2.Symbol()
    symbol.code = "BABA"
    symbol.market = common_pb2.US
    symbol.type = common_pb2.Stock

    market_request = marketData_pb2.MarketDataRequest()
    market_request.symbol.code = symbol.code
    market_request.symbol.market = symbol.market
    market_request.symbol.type = symbol.type
    market_request.language = common_pb2.zhHans

    print(market_request)

    try:
        path = os.path.abspath('.')
        pemPath = path + '/open_test_cert.pem'
        transport_creds = grpc.ssl_channel_credentials(open(pemPath).read())
        options = []
        update_metadata = {}
        update_metadata2 = {}

        update_metadata['UserName'] = 'xxxx'
        update_metadata['Password'] = 'yyyy'
        update_metadata2['grpc.ssl_target_name_override'] = 'open.test.yintongzhibo.com'
        options.append(update_metadata)
        # options.append(update_metadata2)
        channel = grpc.secure_channel("open.test.yintongzhibo.com:9002",transport_creds,options)



        # credentials , project= google_auth.default(scopes=(scope1,scope2,scope3))
        # credentials , project= google_auth.default()
        # http_request = google_auth_transport_requests.Request()
        # metadata_plugin = AuthMetadataPlugin(credentials,http_request)
        # google_auth_credentials = grpc.metadata_call_credentials(metadata_plugin)
        # ssl_credentials = grpc.ssl_channel_credentials(open(pemPath).read())
        # composite_credentials = grpc.composite_channel_credentials(ssl_credentials,google_auth_credentials)
        # channel = grpc.secure_channel("open.test.yintongzhibo.com:9002",composite_credentials)
        # channel = google_auth_transport_grpc.secure_authorized_channel(credentials,request,'open.test.yintongzhibo.com:9002')



        stub = historicalQuote_pb2_grpc.HistoricalQuoteServiceStub(channel)
        response = stub.getTodayM1Quotes(symbol)
        # stub = marketData_pb2_grpc.MarketDataServiceStub(channel)
        # response = stub.getMarketData(market_request)
        print(response.message)

    except Exception as e:
        print (e)



if __name__ == '__main__':
  run()

3个回答

求大佬啊。。。。。。。。。。。。。。。。。

LeoHirasawa
LeoHirasawa 大佬,我看过文档了,就是没有带额外信息的例子(用户名,密码),只有带证书的。。。api也一直没找到。。求助啊大佬
2 年多之前 回复

你好,我用你发的这个php版本的代码进行grcp的安全连接却不能连接上。能帮我看下吗

$di->setShared('grpc', function () {
    require ZPT_PATH . '/vendor/autoload.php';
    $config = $this->getConfig();
    $grpc_config =  $config->grpc->host. ':' .$config->grpc->port;
    $credentials = Grpc\ChannelCredentials::createSsl(file_get_contents(dirname(__FILE__) . '/zuopintong_com.crt'));

    $client = new Zpt\BaseClient($grpc_config,[
        'credentials' => $credentials,
        'grpc.ssl_target_name_override' => 'grpc.zuopintong.com',
        ]);
//    var_dump($client);die;
    return $client;
});
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
grpc helloworld程序卡死?
在跟随教程安装 grpc 后运行 helloworld 时,greeter__server 没有预想的输出。 具体来说应该是在 "BuildAndStart" 这一步卡住,清空grpc重装后还是这个问题,不知道什么原因。 跟随这个教程:https://blog.csdn.net/libaineu2004/article/details/80734547 我确定完全按照教程去做的,除了git下载第三方库下载不了去github里一个个手动拷贝的 ![图片说明](https://img-ask.csdn.net/upload/202001/16/1579136058_120097.png) 环境是虚拟机centos7
关于Colab上Keras模型转TPU模型的问题
使用TPU加速训练,将Keras模型转TPU模型时报错,如图![图片说明](https://img-ask.csdn.net/upload/202001/14/1578998736_238721.png) 关键代码如下 引用库: ``` %tensorflow_version 1.x import json import os import numpy as np import tensorflow as tf from tensorflow.python.keras.applications import resnet from tensorflow.python.keras import callbacks from tensorflow.python.keras.preprocessing.image import ImageDataGenerator import matplotlib.pyplot as plt ``` 转换TPU模型代码如下 ``` # This address identifies the TPU we'll use when configuring TensorFlow. TPU_WORKER = 'grpc://' + os.environ['COLAB_TPU_ADDR'] tf.logging.set_verbosity(tf.logging.INFO) self.model = tf.contrib.tpu.keras_to_tpu_model(self.model, strategy=tf.contrib.tpu.TPUDistributionStrategy(tf.contrib.cluster_resolver.TPUClusterResolver(TPU_WORKER))) self.model = resnet50.ResNet50(weights=None, input_shape=dataset.input_shape, classes=num_classes) ```
grpc-java 如何做负载均衡?
那位大佬有关于grpc-java的负载均衡的demo?求大佬解救一下小白!!!
Python client + Java Server 使用grpc 报错
Python client + Java Server 使用grpc 报错 因为没有找到现成的例子,对python也不是很熟悉.所以请各位看官大佬帮忙看下这个问题.最好有的demo的话也可以给一下.多谢 ``` grpc._channel._Rendezvous: <_Rendezvous of RPC that terminated with (StatusCode.UNIMPLEMENTED, Method not found: DemoGrpc.SendMailService/sendMail)> ``` proto文件都是一样.同种语言之间调用没有问题,就是互相调用的时候直接报这个错.
grpc连接服务器报错,连接报Make sure to call shutdown()
每次使用java客户端连接python服务器时,grpc连接就报错。但是最终会连接成功。 每次报错一大堆错误日志: ERROR io.grpc.internal.ManagedChannelOrphanWrapper - *~*~*~ Channel ManagedChannelImpl{logId=433, target=57.101.32.97:8002} was not shutdown properly!!! ~*~*~* Make sure to call shutdown()/shutdownNow() and wait until awaitTermination() returns true. java.lang.RuntimeException: ManagedChannel allocation site at io.grpc.internal.ManagedChannelOrphanWrapper$ManagedChannelReference.<init>(ManagedChannelOrphanWrapper.java:94) at io.grpc.internal.ManagedChannelOrphanWrapper.<init>(ManagedChannelOrphanWrapper.java:52) at io.grpc.internal.ManagedChannelOrphanWrapper.<init>(ManagedChannelOrphanWrapper.java:43) at io.grpc.internal.AbstractManagedChannelImplBuilder.build(AbstractManagedChannelImplBuilder.java:514) at com.ruijie.wechat.open.util.GrpcUtil.createChannel(GrpcUtil.java:32) at com.ruijie.wechat.open.util.GrpcUtil.getGrpcChannel(GrpcUtil.java:41) at com.ruijie.wechat.open.service.statistics.impl.UnifiedDataCenterService.dealCountTypeSpecs(UnifiedDataCenterService.java:127) at com.ruijie.wechat.open.service.statistics.impl.UnifiedDataCenterService$$FastClassBySpringCGLIB$$a137a63d.invoke(<generated>) at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:669) at com.ruijie.wechat.open.service.statistics.impl.UnifiedDataCenterService$$EnhancerBySpringCGLIB$$df7696f8.dealCountTypeSpecs(<generated>) at com.ruijie.wechat.open.service.statistics.impl.UnifiedStatisticsServiceImpl.getCountInfo(UnifiedStatisticsServiceImpl.java:116) at com.ruijie.wechat.open.controller.statistics.UnifiedStatisticsController.getCount(UnifiedStatisticsController.java:127) at sun.reflect.GeneratedMethodAccessor502.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205) at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:133) at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:97) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738) at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:967) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:901) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970) at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872) at javax.servlet.http.HttpServlet.service(HttpServlet.java:661) at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846) at javax.servlet.http.HttpServlet.service(HttpServlet.java:742) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.springframework.boot.web.filter.ApplicationContextHeaderFilter.doFilterInternal(ApplicationContextHeaderFilter.java:55) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.springframework.boot.actuate.trace.WebRequestTraceFilter.doFilterInternal(WebRequestTraceFilter.java:110) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:108) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:81) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.springframework.boot.actuate.autoconfigure.MetricsFilter.doFilterInternal(MetricsFilter.java:106) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:478) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:803) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1459) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745)
Prometheus 如何监控 grpc-java server
如何通过prometheus 去监控 grpc 的 server ip 等一些信息?用的是Java语言
--go_out: protoc-gen-go: 系统找不到指定的文件。
protoc --go_out=plugins=grpc:. hello.proto --go_out: protoc-gen-go: 系统找不到指定的文件。
Error:(22, 8) java: 类重复: net.whir.hos.organization.grpc.converters.UserInfoConverterImpl
用spring Boot 启动 显示类重复 求各位大神帮帮忙,如何解决?![图片说明](https://img-ask.csdn.net/upload/201911/23/1574503940_832340.png)
fabric网络环境整合java-sdk grpc连接异常
1、调用fabric-java-sdk整合fabric网络环境。启动的过程中一直报错 ``` 23:16:57.825 [main] ERROR org.hyperledger.fabric.sdk.Channel - Channel Channel{id: 1, name: mychannel} Sending proposal with transaction: 5fe505ed0e555ac50cc4773876d8eb3746da951a3ad2f8461b2fa177901e5862 to Peer{ id: 2, name: peer0.org1.example.com, channelName: mychannel, url: grpc://x.x.x.x:7051} failed because of: gRPC failure=Status{code=INTERNAL, description=http2 exception, cause=io.netty.handler.codec.http2.Http2Exception: First received frame was not SETTINGS. Hex dump for first 5 bytes: 1503010002 at io.netty.handler.codec.http2.Http2Exception.connectionError(Http2Exception.java:85) at io.netty.handler.codec.http2.Http2ConnectionHandler$PrefaceDecoder.verifyFirstFrameIsSettings(Http2ConnectionHandler.java:350) at io.netty.handler.codec.http2.Http2ConnectionHandler$PrefaceDecoder.decode(Http2ConnectionHandler.java:251) at io.netty.handler.codec.http2.Http2ConnectionHandler.decode(Http2ConnectionHandler.java:450) at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:502) at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:441) at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:278) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:359) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:345) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:337) at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1408) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:359) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:345) at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:930) at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163) at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:677) at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:612) at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:529) at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:491) at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:905) at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) at java.lang.Thread.run(Thread.java:748) } java.lang.Exception: io.grpc.StatusRuntimeException: INTERNAL: http2 exception at org.hyperledger.fabric.sdk.Channel.sendProposalToPeers(Channel.java:4179) at org.hyperledger.fabric.sdk.Channel.getConfigBlock(Channel.java:854) at org.hyperledger.fabric.sdk.Channel.parseConfigBlock(Channel.java:1820) at org.hyperledger.fabric.sdk.Channel.loadCACertificates(Channel.java:1657) at org.hyperledger.fabric.sdk.Channel.initialize(Channel.java:1103) ``` grpc://x.x.x.x:7051 访问失败 服务器地址为阿里云服务 根据网上提供的方法都说是grpc通信错误,添加相应的依赖, 然后并没用。 实在搞不懂是怎么弄了 哪位大神指导一下。 Fabric环境为1.0的版本
Hyperledger Explorer 出现 Error: 2 UNKNOWN: Stream removed 异常
``` [2019-11-13 20:20:34.351] [DEBUG] Platform - ******* Initialization started for hyperledger fabric platform ****** [2019-11-13 20:20:34.352] [DEBUG] Platform - Setting admin organization enrolment files [2019-11-13 20:20:34.352] [DEBUG] Platform - Creating client [[object Object]] >> first-network [2019-11-13 20:20:34.353] [DEBUG] FabricUtils - ************ Initializing fabric client for [first-network]************ [2019-11-13 20:20:34.353] [DEBUG] FabricClient - Client configuration [first-network] ... this.client_config { name: 'first-network', profile: '/root/go/src/github.com/hyperledger/blockchain-explorer/app/platform/fabric/connection-profile/first-network.json', enableAuthentication: false } [2019-11-13 20:20:34.354] [DEBUG] FabricGateway - LOADING CONFIGURATION [OBJECT OBJECT] [2019-11-13 20:20:34.354] [DEBUG] FabricGateway - LOADING CONFIGURATION [OBJECT OBJECT] [2019-11-13 20:20:34.354] [INFO] FabricGateway - peer0.org1.example.com [2019-11-13 20:20:34.354] [INFO] FabricGateway - peer0.org1.example.com [2019-11-13 20:20:34.355] [INFO] FabricGateway - /root/go/src/github.com/hyperledger/fabric-samples/first-network/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/signcerts/Admin@org1.example.com-cert.pem adminPrivateKeyPath /root/go/src/github.com/hyperledger/fabric-samples/first-network/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/keystore/5ceddae32a833ed134279f0a7caab64a7193614c86948ad3491bb309283b401d_sk [2019-11-13 20:20:34.355] [INFO] FabricGateway - /root/go/src/github.com/hyperledger/fabric-samples/first-network/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/signcerts/Admin@org1.example.com-cert.pem adminPrivateKeyPath /root/go/src/github.com/hyperledger/fabric-samples/first-network/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/keystore/5ceddae32a833ed134279f0a7caab64a7193614c86948ad3491bb309283b401d_sk [2019-11-13 20:20:34.356] [INFO] FabricGateway - admin [2019-11-13 20:20:34.356] [INFO] FabricGateway - admin [2019-11-13 20:20:34.631] [DEBUG] FabricClient - Set client [first-network] default channel as >> mychannel [2019-11-13 20:20:34.652] [ERROR] FabricClient - { Error: 2 UNKNOWN: Stream removed at Object.exports.createStatusError (/root/go/src/github.com/hyperledger/blockchain-explorer/node_modules/fabric-network/node_modules/grpc/src/common.js:91:15) at Object.onReceiveStatus (/root/go/src/github.com/hyperledger/blockchain-explorer/node_modules/fabric-network/node_modules/grpc/src/client_interceptors.js:1204:28) at InterceptingListener._callNext (/root/go/src/github.com/hyperledger/blockchain-explorer/node_modules/fabric-network/node_modules/grpc/src/client_interceptors.js:568:42) at InterceptingListener.onReceiveStatus (/root/go/src/github.com/hyperledger/blockchain-explorer/node_modules/fabric-network/node_modules/grpc/src/client_interceptors.js:618:8) at callback (/root/go/src/github.com/hyperledger/blockchain-explorer/node_modules/fabric-network/node_modules/grpc/src/client_interceptors.js:845:24) code: 2, metadata: Metadata { _internal_repr: {} }, details: 'Stream removed', peer: { url: 'grpc://隐藏地址:7051', name: 'peer0.org1.example.com', options: { 'grpc.max_receive_message_length': -1, 'grpc.max_send_message_length': -1, 'grpc.keepalive_time_ms': 120000, 'grpc.http2.min_time_between_pings_ms': 120000, 'grpc.keepalive_timeout_ms': 20000, 'grpc.http2.max_pings_without_data': 0, 'grpc.keepalive_permit_without_calls': 1, name: 'peer0.org1.example.com', 'request-timeout': 300000, clientCert: '-----BEGIN CERTIFICATE-----\nMIICKzCCAdGgAwIBAgIRAJw2YDgGud/J/TE7tq1P1a8wCgYIKoZIzj0EAwIwczEL\nMAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBG\ncmFuY2lzY28xGTAXBgNVBAoTEG9yZzEuZXhhbXBsZS5jb20xHDAaBgNVBAMTE2Nh\nLm9yZzEuZXhhbXBsZS5jb20wHhcNMTkxMTEzMDMzMjAwWhcNMjkxMTEwMDMzMjAw\nWjBsMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMN\nU2FuIEZyYW5jaXNjbzEPMA0GA1UECxMGY2xpZW50MR8wHQYDVQQDDBZBZG1pbkBv\ncmcxLmV4YW1wbGUuY29tMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEDv+QrNpH\nD7X3Erolb3YUfoPwfWXpBReeNumtPqGmSqMtpEOm/Bz1JoZ6crNav6/QDrOrOZHl\naHYxMfFrZy0aO6NNMEswDgYDVR0PAQH/BAQDAgeAMAwGA1UdEwEB/wQCMAAwKwYD\nVR0jBCQwIoAgjdsNfvZPIL6xrscyAQBn/1ykaWuPEFOyeEa0ryCJYqMwCgYIKoZI\nzj0EAwIDSAAwRQIhAJ5sBseMFcGBs/6xr2xj/RzsPWCfrWvk6wL3y/sm468aAiBL\n9CBXGEs01kgH33Z61/vEpTJLubdw19v2gr1rE4p/kw==\n-----END CERTIFICATE-----\n', 'grpc.ssl_target_name_override': 'peer0.org1.example.com', 'grpc.default_authority': 'peer0.org1.example.com' } } } [2019-11-13 20:20:34.653] [DEBUG] FabricClient - this.defaultPeer peer0.org1.example.com [2019-11-13 20:20:34.662] [ERROR] FabricClient - { Error: 2 UNKNOWN: Stream removed at Object.exports.createStatusError (/root/go/src/github.com/hyperledger/blockchain-explorer/node_modules/fabric-network/node_modules/grpc/src/common.js:91:15) at Object.onReceiveStatus (/root/go/src/github.com/hyperledger/blockchain-explorer/node_modules/fabric-network/node_modules/grpc/src/client_interceptors.js:1204:28) at InterceptingListener._callNext (/root/go/src/github.com/hyperledger/blockchain-explorer/node_modules/fabric-network/node_modules/grpc/src/client_interceptors.js:568:42) at InterceptingListener.onReceiveStatus (/root/go/src/github.com/hyperledger/blockchain-explorer/node_modules/fabric-network/node_modules/grpc/src/client_interceptors.js:618:8) at callback (/root/go/src/github.com/hyperledger/blockchain-explorer/node_modules/fabric-network/node_modules/grpc/src/client_interceptors.js:845:24) code: 2, metadata: Metadata { _internal_repr: {} }, details: 'Stream removed' } [2019-11-13 20:20:34.665] [INFO] main - Please set logger.setLevel to DEBUG in ./app/helper.js to log the debugging. ```
实例化合约报错:chaincode registration failed
环境是用fabric1.4.2 + raft 共识机制 3台raft+1台peer image 均启动正常 在实例化链码时候报错,请各位大咖帮我看看,如何解决,谢谢 # 1、实例化链码 peer chaincode instantiate -o orderer0.koko.com:7050 --tls true --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/koko.com/orderers/orderer0.koko.com/msp/tlscacerts/tlsca.koko.com-cert.pem -C kokochannel -n mycc -l golang -v 1.0 -c '{"Args":["init","a","100","b","200"]}' -P 'AND("Org1MSP.peer")' # 2、cli容器报错: Error: could not assemble transaction, err proposal response was not successful, error code 500, msg chaincode registration failed: container exited with 0![图片说明](https://img-ask.csdn.net/upload/201909/21/1569050405_900988.png) # 3、实例化合约peer docker 日志报错 信息 docker logs -f peer d4e4543te534r5 [kokochannel][52342533] Exit chaincode: name:"lscc" (44159ms) 2019-09-21 06:23:09.871 UTC [endorser] SimulateProposal -> ERRO 04c [kokochannel][52342533] failed to invoke chaincode name:"lscc" , error: container exited with 0 github.com/hyperledger/fabric/core/chaincode.(*RuntimeLauncher).Launch.func1 /opt/gopath/src/github.com/hyperledger/fabric/core/chaincode/runtime_launcher.go:63 runtime.goexit /opt/go/src/runtime/asm_amd64.s:1333 chaincode registration failed 2019-09-21 06:23:09.871 UTC [comm.grpc.server] 1 -> INFO 04d unary call completed grpc.service=protos.Endorser grpc.method=ProcessProposal grpc.peer_address=172.19.0.1:39190 grpc.code=OK grpc.call_duration=44.161172022s![图片说明](https://img-ask.csdn.net/upload/201909/21/1569050439_481805.png) 4、实例化合约 orderer docker 日志错误信息 docker logs -f 78ret8rere8retre 2019-09-21 06:04:23.367 UTC [common.deliver] deliverBlocks -> WARN 039 [channel: kokochannel] Rejecting deliver request for 192.168.213.134:46044 because of consenter error 2019-09-21 06:04:23.372 UTC [comm.grpc.server] 1 -> INFO 03a streaming call completed grpc.service=orderer.AtomicBroadcast grpc.method=Deliver grpc.peer_address=192.168.213.134:46044 grpc.code=OK grpc.call_duration=197.489105ms 2019-09-21 06:04:23.591 UTC [common.deliver] deliverBlocks -> WARN 03b [channel: kokochannel] Rejecting deliver request for 192.168.213.134:46046 because of consenter error 2019-09-21 06:04:23.643 UTC [comm.grpc.server] 1 -> INFO 03c streaming call completed grpc.service=orderer.AtomicBroadcast grpc.method=Deliver grpc.peer_address=192.168.213.134:46046 grpc.code=OK grpc.call_duration=252.482946ms 2019-09-21 06:04:23.848 UTC [common.deliver] deliverBlocks -> WARN 03d [channel: kokochannel] Rejecting deliver request for 192.168.213.134:46048 because of consenter error 2019-09-21 06:04:23.848 UTC [comm.grpc.server] 1 -> INFO 03e streaming call completed grpc.service=orderer.AtomicBroadcast grpc.method=Deliver grpc.peer_address=192.168.213.134:46048 grpc.code=OK grpc.call_duration=200.238916ms 2019-09-21 06:04:24.054 UTC [common.deliver] deliverBlocks -> WARN 03f [channel: kokochannel] Rejecting deliver request for 192.168.213.134:46050 because of consenter error 2019-09-21 06:04:24.054 UTC [comm.grpc.server] 1 -> INFO 040 streaming call completed grpc.service=orderer.AtomicBroadcast grpc.method=Deliver grpc.peer_address=192.168.213.134:46050 grpc.code=OK grpc.call_duration=201.471445ms 2019-09-21 06:04:24.260 UTC [common.deliver] deliverBlocks -> WARN 041 [channel: kokochannel] Rejecting deliver request for 192.168.213.134:46052 because of consenter error 2019-09-21 06:04:24.260 UTC [comm.grpc.server] 1 -> INFO 042 streaming call completed grpc.service=orderer.AtomicBroadcast grpc.method=Deliver grpc.peer_address=192.168.213.134:46052 grpc.code=OK grpc.call_duration=201.238803ms 2019-09-21 06:04:24.295 UTC [orderer.consensus.etcdraft] Step -> INFO 043 1 [logterm: 1, index: 3, vote: 0] cast MsgPreVote for 2 [logterm: 1, index: 3] at term 1 channel=kokochannel node=1 2019-09-21 06:04:24.339 UTC [orderer.consensus.etcdraft] Step -> INFO 044 1 [term: 1] received a MsgVote message with higher term from 2 [term: 2] channel=kokochannel node=1 2019-09-21 06:04:24.339 UTC [orderer.consensus.etcdraft] becomeFollower -> INFO 045 1 became follower at term 2 channel=kokochannel node=1 2019-09-21 06:04:24.339 UTC [orderer.consensus.etcdraft] Step -> INFO 046 1 [logterm: 1, index: 3, vote: 0] cast MsgVote for 2 [logterm: 1, index: 3] at term 2 channel=kokochannel node=1 2019-09-21 06:04:24.343 UTC [orderer.consensus.etcdraft] run -> INFO 047 raft.node: 1 elected leader 2 at term 2 channel=kokochannel node=1 2019-09-21 06:04:24.344 UTC [orderer.consensus.etcdraft] serveRequest -> INFO 048 Raft leader changed: 0 -> 2 channel=kokochannel node=1 2019-09-21 06:04:24.498 UTC [common.deliver] Handle -> WARN 049 Error reading from 192.168.213.134:46054: rpc error: code = Canceled desc = context canceled 2019-09-21 06:04:24.498 UTC [comm.grpc.server] 1 -> INFO 04a streaming call completed grpc.service=orderer.AtomicBroadcast grpc.method=Deliver grpc.peer_address=192.168.213.134:46054 error="rpc error: code = Canceled desc = context canceled" grpc.code=Canceled grpc.call_duration=233.075631ms 2019-09-21 06:23:09.917 UTC [orderer.common.broadcast] Handle -> WARN 04b Error reading from 192.168.213.134:46118: rpc error: code = Canceled desc = context canceled 2019-09-21 06:23:09.917 UTC [comm.grpc.server] 1 -> INFO 04c streaming call completed grpc.service=orderer.AtomicBroadcast grpc.method=Broadcast grpc.peer_address=192.168.213.134:46118 error="rpc error: code = Canceled desc = context canceled" grpc.code=Canceled grpc.call_duration=44.160408206s![图片说明](https://img-ask.csdn.net/upload/201909/21/1569050453_792288.png) 已解决
c++ grpc 异步服务器在多线程情况下出core。
我有一个c++ grpc服务器,异步的,不是stream模式,在多线程情况下跑了一会儿会core,打印出来的错误是 E0717 18:54:02.635424482 14110 server_cc.cc:677] Fatal: grpc_call_start_batch returned 8 E0717 18:54:02.635514690 14110 server_cc.cc:678] ops[0]: SEND_MESSAGE ptr=0x7f3c0815cb60 E0717 18:54:02.635563281 14110 server_cc.cc:678] ops[1]: SEND_STATUS_FROM_SERVER status=0 单线程情况下就没有啥问题,请问这个是为什么? 我google了下,说是不能同时有多个写,可是我看grpc repo里面的实现也没有对输出做处理。 有没有正确的grpc async simple server 在多线程下的正确实现可以参考下的吗?
怎么使用gRPC调用SpringBean的方法
最近在学习gRPC,请问各位大神,怎么把gRPC集成到Spring环境里,通过gRPC远程调用SpringBean?
怎么将gRPC的数据序列化从Protocol Buffers替换成JSON
![图片说明](https://img-ask.csdn.net/upload/201610/17/1476693797_66193.jpg) 最近在学习gRPC,看到gRPC的概述文档中说,可以把数据序列化从Protocol Buffers换成JSON,请问有没有人知道怎么替换?
帮忙解决一个docker守护进程自己莫名死掉的问题,containerd异常
CentOS7, 多台虚拟机构建的Docker集群,所有服务器配置相同,其中一台总是莫名的Docker守护进程死掉,查看message日志如下: ``` Sep 3 12:30:03 sup-svc-70 systemd: Unit containerd.service entered failed state. Sep 3 12:30:03 sup-svc-70 containerd: github.com/containerd/containerd/metrics/cgroups.(*oomCollector).start(0xc0003146c0) Sep 3 12:30:03 sup-svc-70 containerd: /go/src/github.com/containerd/containerd/metrics/cgroups/oom.go:114 +0x7d Sep 3 12:30:03 sup-svc-70 containerd: created by github.com/containerd/containerd/metrics/cgroups.newOOMCollector Sep 3 12:30:03 sup-svc-70 containerd: /go/src/github.com/containerd/containerd/metrics/cgroups/oom.go:50 +0xed Sep 3 12:30:03 sup-svc-70 containerd: goroutine 15 [IO wait, 1615 minutes]: Sep 3 12:30:03 sup-svc-70 containerd: internal/poll.runtime_pollWait(0x7f906759ff00, 0x72, 0x0) Sep 3 12:30:03 sup-svc-70 containerd: /.GOROOT/src/runtime/netpoll.go:173 +0x68 Sep 3 12:30:03 sup-svc-70 containerd: internal/poll.(*pollDesc).wait(0xc00036af98, 0x72, 0xc0001b6800, 0x0, 0x0) Sep 3 12:30:03 sup-svc-70 containerd: /.GOROOT/src/internal/poll/fd_poll_runtime.go:85 +0x9c Sep 3 12:30:03 sup-svc-70 containerd: internal/poll.(*pollDesc).waitRead(0xc00036af98, 0xffffffffffffff00, 0x0, 0x0) Sep 3 12:30:03 sup-svc-70 containerd: /.GOROOT/src/internal/poll/fd_poll_runtime.go:90 +0x3f Sep 3 12:30:03 sup-svc-70 containerd: internal/poll.(*FD).Accept(0xc00036af80, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0) Sep 3 12:30:03 sup-svc-70 containerd: /.GOROOT/src/internal/poll/fd_unix.go:384 +0x1a2 Sep 3 12:30:03 sup-svc-70 containerd: net.(*netFD).accept(0xc00036af80, 0xc000326058, 0x0, 0x0) Sep 3 12:30:03 sup-svc-70 containerd: /.GOROOT/src/net/fd_unix.go:238 +0x44 Sep 3 12:30:03 sup-svc-70 containerd: net.(*UnixListener).accept(0xc0000df890, 0xc0003d9dc8, 0xc0003d9dd0, 0x18) Sep 3 12:30:03 sup-svc-70 containerd: /.GOROOT/src/net/unixsock_posix.go:162 +0x34 Sep 3 12:30:03 sup-svc-70 containerd: net.(*UnixListener).Accept(0xc0000df890, 0x55d3f39bdd58, 0xc0000c2000, 0x55d3f39eb6c0, 0xc000326058) Sep 3 12:30:03 sup-svc-70 containerd: /.GOROOT/src/net/unixsock.go:257 +0x49 Sep 3 12:30:03 sup-svc-70 containerd: github.com/containerd/containerd/vendor/google.golang.org/grpc.(*Server).Serve(0xc0000c2000, 0x55d3f39e1960, 0xc0000df890, 0x0, 0x0) Sep 3 12:30:03 sup-svc-70 containerd: /go/src/github.com/containerd/containerd/vendor/google.golang.org/grpc/server.go:544 +0x212 Sep 3 12:30:03 sup-svc-70 containerd: github.com/containerd/containerd/services/server.(*Server).ServeGRPC(0xc00026e7b0, 0x55d3f39e1960, 0xc0000df890, 0x18, 0xc0004b2738) Sep 3 12:30:03 sup-svc-70 containerd: /go/src/github.com/containerd/containerd/services/server/server.go:167 +0x6b Sep 3 12:30:03 sup-svc-70 containerd: github.com/containerd/containerd/services/server.(*Server).ServeGRPC-fm(0x55d3f39e1960, 0xc0000df890,0xc0000df890, 0x0) Sep 3 12:30:03 sup-svc-70 containerd: /go/src/github.com/containerd/containerd/cmd/containerd/command/main.go:171 +0x40 Sep 3 12:30:03 sup-svc-70 containerd: github.com/containerd/containerd/cmd/containerd/command.serve.func1(0x55d3f39e1960, 0xc0000df890, 0xc000249f70, 0x55d3f39e2f20, 0xc00003c018, 0xc0001e9640, 0x1f) Sep 3 12:30:03 sup-svc-70 dockerd: time="2019-09-03T12:30:03.279896469+08:00" level=error msg="failed to get event" error="rpc error: code = Unavailable desc = all SubConns are in TransientFailure, latest connection error: connection error: desc = \"transport: Error while dialin g dial unix /run/containerd/containerd.sock: connect: connection refused\"" module=libcontainerd namespace=moby Sep 3 12:30:03 sup-svc-70 dockerd: time="2019-09-03T12:30:03.279979412+08:00" level=error msg="failed to get event" error="rpc error: code = Unavailable desc = all SubConns are in TransientFailure, latest connection error: connection error: desc = \"transport: Error while dialin g dial unix /run/containerd/containerd.sock: connect: connection refused\"" module=libcontainerd namespace=moby ``` **** 请问下,这可能是什么问题造成的,如何解决,或者该朝哪个方向去调查?
Use the @grpc/proto-loader module with grpc.loadPackageDefinition instead
postgres://root:root@127.0.0.1:5432/root (node:12744) DeprecationWarning: grpc.load: Use the @grpc/proto-loader module with grpc.loadPackageDefinition instead <<<<<<<<<<<<<<<<<<<<<<<<<< Explorer Error >>>>>>>>>>>>>>>>>>>>> TypeError: Channel's second argument must be a ChannelCredentials at ServiceClient.Client (/home/wdrfxy/blockchain-explorer/node_modules/grpc/src/client.js:410:23) at new ServiceClient (/home/wdrfxy/blockchain-explorer/node_modules/grpc/src/client.js:936:12) at new AdminPeer (/home/wdrfxy/blockchain-explorer/app/platform/fabric/AdminPeer.js:65:30) at FabricClient.newAdminPeer (/home/wdrfxy/blockchain-explorer/app/platform/fabric/FabricClient.js:546:25) at FabricClient.initializeChannelFromDiscover (/home/wdrfxy/blockchain-explorer/app/platform/fabric/FabricClient.js:499:38) at <anonymous> Received kill signal, shutting down gracefully Closed out connections
C++编译Tensorflow时出现 no such package '@icu//'no such package '@grpc//'这两个error是为什么呀?
![图片说明](https://img-ask.csdn.net/upload/201907/03/1562133791_485352.png)
移植GRPC,key在开源Java server上加载,总是报Proc-type:4
小妹初步接触这个grpc,看了一下: 产品必须要用固定的key文件,格式为下面的,应该是pkcs1,在工具服务端加载总是报错;然后grpc 开源的自己客户端、服务端对接,可以,我看了下,是pkcs8的。想请问一下,grpc 开源的只能支持pkcs8么,不能支持pkcs1的key么。但是产品上的key必须是pkcs1,如果是pkcs8,他会提示:key文件没有加密!现在只能寄希望开源能适配pkcs1的情况了 这种情况要怎么适配 小妹只有3个币,倾其所有,望大神帮我解答 -----BEGIN RSA PRIVATE KEY----- Proc-Type: 4,ENCRYPTED DEK-Info: DES-EDE3-CBC,29DE8F99F382D122 3gQZqxU8HPaUzfFOX1scxXU2qiJezXEwVarq13fALK6/08CEs+66O7iQxfjSMsT9 J9aDluB7Xr9JtAhAqGCQZ9XMLS5rP7aOWnXpmp46XtDYoYEB3Kebov7iFJOEAgXf xtPm7AJtQSqTE1wof4y9EQTjysECnndyyXDASt/ugvfFuLn6dZ5Qiv8f2Jpce8Ek dzU6ToVFnrb3eNt+/UP1PGCKFuTA6nEG284e0FrTE94JL8Fwi9NWlp7CdYINM2HL Q6TMLIVdxJk/gnZm3h2bmVrqhMoacNdStC6EKMoEBoSWsqTpQRg08Z9qA6m5BjYI CzoRNfB5BPIIVxCa1maxWbCbac1Wk+34bwk1aLuKZGXRpRWT3wE5vMYr6y54MbYt XMtB7I6xLQZRzWEkqxWtpca/PfzgGF0DwxSLGFIVmc0EpdX7OJQEjPoLeCTokDlG K4c1S930kqMrkK8Fc4o7l05TzRGwQQVJCw0MaN626daSy1obF/hHoZPt8jTWFmBV kELDGwljaxvBj5oqBZZuZwv2IGZ56W4vbyDuF7/CoGLAtnh5XxXSV14jlo62NYIf g/BW6tPznLXCWm+gzNJ6nud7cARZZwOfF4dQND6JIKGLob0cAUHkawqXXEbRUdF5 IVCRCbrpg14BZyRyoGsj7oQXBQz0h/8QE7Lj8QqIZ5is84xAczs/+UWtx+qZKFq1 ugAm+raN+jFL4LtAe7dovDSx7SfRgPkQJykToaiMP4hJcPqHHtoBw7oiaFZzY5KV p131eXUMr8Yv9w1FWBlc8IrInvBkGmMhcsPbePh9/CKQdU6WH993Dg== -----END RSA PRIVATE KEY-----
通过java版sdk调用智能合约向Fabric提交交易出现异常
是在程序中通过java版的Fabric-sdk调用部署在远程主机上的智能合约执行相关的业务逻辑,但在执行过程中出现异常信息,导致交易请求没有提交到Fabric的peer节点上,具体异常信息如下: ``` 17:16:06 [http-bio-8080-exec-5] ERROR org.hyperledger.fabric.sdk.Channel - Sending proposal to peer0.org0.example.com failed because of: gRPC failure=Status{code=UNKNOWN, description=chaincode error (status: 500, message: Failed to unmarshal section -), cause=null} java.lang.Exception: io.grpc.StatusRuntimeException: UNKNOWN: chaincode error (status: 500, message: Failed to unmarshal section -) at org.hyperledger.fabric.sdk.Channel.sendProposalToPeers(Channel.java:2241) at org.hyperledger.fabric.sdk.Channel.sendProposal(Channel.java:2155) at org.hyperledger.fabric.sdk.Channel.sendTransactionProposal(Channel.java:2103) at com.cmit.fabric.java.sdk.test.bean.ChaincodeManager.invokeWithTransactionId(ChaincodeManager.java:307) at com.cmit.fabric.java.sdk.test.service.impl.SectionSDKServiceImpl.updateSection(SectionSDKServiceImpl.java:155) at rsbc.controller.NetworkController.modifySave(NetworkController.java:357) 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.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221) at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:136) at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:832) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:743) at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:961) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:895) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:967) at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:869) at javax.servlet.http.HttpServlet.service(HttpServlet.java:650) at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:843) at javax.servlet.http.HttpServlet.service(HttpServlet.java:731) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at com.planetj.servlet.filter.compression.CompressingFilter.doFilter(CompressingFilter.java:293) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:61) at org.apache.shiro.web.servlet.AdviceFilter.executeChain(AdviceFilter.java:108) at org.apache.shiro.web.servlet.AdviceFilter.doFilterInternal(AdviceFilter.java:137) at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125) at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:66) at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449) at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365) at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90) at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83) at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383) at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362) at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125) at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346) at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:262) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at net.mopai.filter.SiteStatusFilter.doFilterInternal(SiteStatusFilter.java:50) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346) at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:262) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at net.mopai.filter.HtmlFilter.doFilterInternal(HtmlFilter.java:40) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:121) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:110) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:506) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:962) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:445) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1115) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:637) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:318) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Unknown Source) Caused by: io.grpc.StatusRuntimeException: UNKNOWN: chaincode error (status: 500, message: Failed to unmarshal section -) at io.grpc.Status.asRuntimeException(Status.java:526) at io.grpc.stub.ClientCalls$UnaryStreamToFuture.onClose(ClientCalls.java:427) at io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:419) at io.grpc.internal.ClientCallImpl.access$100(ClientCallImpl.java:60) at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.close(ClientCallImpl.java:493) at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.access$500(ClientCallImpl.java:422) at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:525) at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37) at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:102) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) ... 1 common frames omitted ``` 面对这个问题没有什么头绪,不知道是哪里出了问题,求问Fabric方面的大神能否给帮忙解释一下,这个异常是因为什么问题导致的!!!不胜感激!!!
Java学习的正确打开方式
在博主认为,对于入门级学习java的最佳学习方法莫过于视频+博客+书籍+总结,前三者博主将淋漓尽致地挥毫于这篇博客文章中,至于总结在于个人,实际上越到后面你会发现学习的最好方式就是阅读参考官方文档其次就是国内的书籍,博客次之,这又是一个层次了,这里暂时不提后面再谈。博主将为各位入门java保驾护航,各位只管冲鸭!!!上天是公平的,只要不辜负时间,时间自然不会辜负你。 何谓学习?博主所理解的学习,它
大学四年自学走来,这些私藏的实用工具/学习网站我贡献出来了
大学四年,看课本是不可能一直看课本的了,对于学习,特别是自学,善于搜索网上的一些资源来辅助,还是非常有必要的,下面我就把这几年私藏的各种资源,网站贡献出来给你们。主要有:电子书搜索、实用工具、在线视频学习网站、非视频学习网站、软件下载、面试/求职必备网站。 注意:文中提到的所有资源,文末我都给你整理好了,你们只管拿去,如果觉得不错,转发、分享就是最大的支持了。 一、PDF搜索网站推荐 对于大部
linux系列之常用运维命令整理笔录
本博客记录工作中需要的linux运维命令,大学时候开始接触linux,会一些基本操作,可是都没有整理起来,加上是做开发,不做运维,有些命令忘记了,所以现在整理成博客,当然vi,文件操作等就不介绍了,慢慢积累一些其它拓展的命令,博客不定时更新 顺便拉下票,我在参加csdn博客之星竞选,欢迎投票支持,每个QQ或者微信每天都可以投5票,扫二维码即可,http://m234140.nofollow.ax.
Vue + Spring Boot 项目实战(十四):用户认证方案与完善的访问拦截
本篇文章主要讲解 token、session 等用户认证方案的区别并分析常见误区,以及如何通过前后端的配合实现完善的访问拦截,为下一步权限控制的实现打下基础。
比特币原理详解
一、什么是比特币 比特币是一种电子货币,是一种基于密码学的货币,在2008年11月1日由中本聪发表比特币白皮书,文中提出了一种去中心化的电子记账系统,我们平时的电子现金是银行来记账,因为银行的背后是国家信用。去中心化电子记账系统是参与者共同记账。比特币可以防止主权危机、信用风险。其好处不多做赘述,这一层面介绍的文章很多,本文主要从更深层的技术原理角度进行介绍。 二、问题引入  假设现有4个人
程序员接私活怎样防止做完了不给钱?
首先跟大家说明一点,我们做 IT 类的外包开发,是非标品开发,所以很有可能在开发过程中会有这样那样的需求修改,而这种需求修改很容易造成扯皮,进而影响到费用支付,甚至出现做完了项目收不到钱的情况。 那么,怎么保证自己的薪酬安全呢? 我们在开工前,一定要做好一些证据方面的准备(也就是“讨薪”的理论依据),这其中最重要的就是需求文档和验收标准。一定要让需求方提供这两个文档资料作为开发的基础。之后开发
网页实现一个简单的音乐播放器(大佬别看。(⊙﹏⊙))
今天闲着无事,就想写点东西。然后听了下歌,就打算写个播放器。 于是乎用h5 audio的加上js简单的播放器完工了。 欢迎 改进 留言。 演示地点跳到演示地点 html代码如下`&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;music&lt;/title&gt; &lt;meta charset="utf-8"&gt
Python十大装B语法
Python 是一种代表简单思想的语言,其语法相对简单,很容易上手。不过,如果就此小视 Python 语法的精妙和深邃,那就大错特错了。本文精心筛选了最能展现 Python 语法之精妙的十个知识点,并附上详细的实例代码。如能在实战中融会贯通、灵活使用,必将使代码更为精炼、高效,同时也会极大提升代码B格,使之看上去更老练,读起来更优雅。 1. for - else 什么?不是 if 和 else 才
数据库优化 - SQL优化
前面一篇文章从实例的角度进行数据库优化,通过配置一些参数让数据库性能达到最优。但是一些“不好”的SQL也会导致数据库查询变慢,影响业务流程。本文从SQL角度进行数据库优化,提升SQL运行效率。 判断问题SQL 判断SQL是否有问题时可以通过两个表象进行判断: 系统级别表象 CPU消耗严重 IO等待严重 页面响应时间过长
2019年11月中国大陆编程语言排行榜
2019年11月2日,我统计了某招聘网站,获得有效程序员招聘数据9万条。针对招聘信息,提取编程语言关键字,并统计如下: 编程语言比例 rank pl_ percentage 1 java 33.62% 2 c/c++ 16.42% 3 c_sharp 12.82% 4 javascript 12.31% 5 python 7.93% 6 go 7.25% 7
通俗易懂地给女朋友讲:线程池的内部原理
餐厅的约会 餐盘在灯光的照耀下格外晶莹洁白,女朋友拿起红酒杯轻轻地抿了一小口,对我说:“经常听你说线程池,到底线程池到底是个什么原理?”我楞了一下,心里想女朋友今天是怎么了,怎么突然问出这么专业的问题,但做为一个专业人士在女朋友面前也不能露怯啊,想了一下便说:“我先给你讲讲我前同事老王的故事吧!” 大龄程序员老王 老王是一个已经北漂十多年的程序员,岁数大了,加班加不动了,升迁也无望,于是拿着手里
经典算法(5)杨辉三角
写在前面: 我是 扬帆向海,这个昵称来源于我的名字以及女朋友的名字。我热爱技术、热爱开源、热爱编程。技术是开源的、知识是共享的。 这博客是对自己学习的一点点总结及记录,如果您对 Java、算法 感兴趣,可以关注我的动态,我们一起学习。 用知识改变命运,让我们的家人过上更好的生活。 目录一、杨辉三角的介绍二、杨辉三角的算法思想三、代码实现1.第一种写法2.第二种写法 一、杨辉三角的介绍 百度
腾讯算法面试题:64匹马8个跑道需要多少轮才能选出最快的四匹?
昨天,有网友私信我,说去阿里面试,彻底的被打击到了。问了为什么网上大量使用ThreadLocal的源码都会加上private static?他被难住了,因为他从来都没有考虑过这个问题。无独有偶,今天笔者又发现有网友吐槽了一道腾讯的面试题,我们一起来看看。 腾讯算法面试题:64匹马8个跑道需要多少轮才能选出最快的四匹? 在互联网职场论坛,一名程序员发帖求助到。二面腾讯,其中一个算法题:64匹
面试官:你连RESTful都不知道我怎么敢要你?
面试官:了解RESTful吗? 我:听说过。 面试官:那什么是RESTful? 我:就是用起来很规范,挺好的 面试官:是RESTful挺好的,还是自我感觉挺好的 我:都挺好的。 面试官:… 把门关上。 我:… 要干嘛?先关上再说。 面试官:我说出去把门关上。 我:what ?,夺门而去 文章目录01 前言02 RESTful的来源03 RESTful6大原则1. C-S架构2. 无状态3.统一的接
SQL-小白最佳入门sql查询一
一 说明 如果是初学者,建议去网上寻找安装Mysql的文章安装,以及使用navicat连接数据库,以后的示例基本是使用mysql数据库管理系统; 二 准备前提 需要建立一张学生表,列分别是id,名称,年龄,学生信息;本示例中文章篇幅原因SQL注释略; 建表语句: CREATE TABLE `student` ( `id` int(11) NOT NULL AUTO_INCREMENT, `
项目中的if else太多了,该怎么重构?
介绍 最近跟着公司的大佬开发了一款IM系统,类似QQ和微信哈,就是聊天软件。我们有一部分业务逻辑是这样的 if (msgType = "文本") { // dosomething } else if(msgType = "图片") { // doshomething } else if(msgType = "视频") { // doshomething } else { // dosho
漫话:什么是平衡(AVL)树?这应该是把AVL树讲的最好的文章了
这篇文章通过对话的形式,由浅入深带你读懂 AVL 树,看完让你保证理解 AVL 树的各种操作,如果觉得不错,别吝啬你的赞哦。 1、若它的左子树不为空,则左子树上所有的节点值都小于它的根节点值。 2、若它的右子树不为空,则右子树上所有的节点值均大于它的根节点值。 3、它的左右子树也分别可以充当为二叉查找树。 例如: 例如,我现在想要查找数值为14的节点。由于二叉查找树的特性,我们可...
“狗屁不通文章生成器”登顶GitHub热榜,分分钟写出万字形式主义大作
一、垃圾文字生成器介绍 最近在浏览GitHub的时候,发现了这样一个骨骼清奇的雷人项目,而且热度还特别高。 项目中文名:狗屁不通文章生成器 项目英文名:BullshitGenerator 根据作者的介绍,他是偶尔需要一些中文文字用于GUI开发时测试文本渲染,因此开发了这个废话生成器。但由于生成的废话实在是太过富于哲理,所以最近已经被小伙伴们给玩坏了。 他的文风可能是这样的: 你发现,
程序员:我终于知道post和get的区别
IT界知名的程序员曾说:对于那些月薪三万以下,自称IT工程师的码农们,其实我们从来没有把他们归为我们IT工程师的队伍。他们虽然总是以IT工程师自居,但只是他们一厢情愿罢了。 此话一出,不知激起了多少(码农)程序员的愤怒,却又无可奈何,于是码农问程序员。 码农:你知道get和post请求到底有什么区别? 程序员:你看这篇就知道了。 码农:你月薪三万了? 程序员:嗯。 码农:你是怎么做到的? 程序员:
《程序人生》系列-这个程序员只用了20行代码就拿了冠军
你知道的越多,你不知道的越多 点赞再看,养成习惯GitHub上已经开源https://github.com/JavaFamily,有一线大厂面试点脑图,欢迎Star和完善 前言 这一期不算《吊打面试官》系列的,所有没前言我直接开始。 絮叨 本来应该是没有这期的,看过我上期的小伙伴应该是知道的嘛,双十一比较忙嘛,要值班又要去帮忙拍摄年会的视频素材,还得搞个程序员一天的Vlog,还要写BU
开源并不是你认为的那些事
点击上方蓝字 关注我们开源之道导读所以 ————想要理清开源是什么?先要厘清开源不是什么,名正言顺是句中国的古代成语,概念本身的理解非常之重要。大部分生物多样性的起源,...
加快推动区块链技术和产业创新发展,2019可信区块链峰会在京召开
      11月8日,由中国信息通信研究院、中国通信标准化协会、中国互联网协会、可信区块链推进计划联合主办,科技行者协办的2019可信区块链峰会将在北京悠唐皇冠假日酒店开幕。   区块链技术被认为是继蒸汽机、电力、互联网之后,下一代颠覆性的核心技术。如果说蒸汽机释放了人类的生产力,电力解决了人类基本的生活需求,互联网彻底改变了信息传递的方式,区块链作为构造信任的技术有重要的价值。   1
程序员把地府后台管理系统做出来了,还有3.0版本!12月7号最新消息:已在开发中有github地址
第一幕:缘起 听说阎王爷要做个生死簿后台管理系统,我们派去了一个程序员…… 996程序员做的梦: 第一场:团队招募 为了应对地府管理危机,阎王打算找“人”开发一套地府后台管理系统,于是就在地府总经办群中发了项目需求。 话说还是中国电信的信号好,地府都是满格,哈哈!!! 经常会有外行朋友问:看某网站做的不错,功能也简单,你帮忙做一下? 而这次,面对这样的需求,这个程序员
网易云6亿用户音乐推荐算法
网易云音乐是音乐爱好者的集聚地,云音乐推荐系统致力于通过 AI 算法的落地,实现用户千人千面的个性化推荐,为用户带来不一样的听歌体验。 本次分享重点介绍 AI 算法在音乐推荐中的应用实践,以及在算法落地过程中遇到的挑战和解决方案。 将从如下两个部分展开: AI 算法在音乐推荐中的应用 音乐场景下的 AI 思考 从 2013 年 4 月正式上线至今,网易云音乐平台持续提供着:乐屏社区、UGC
【技巧总结】位运算装逼指南
位算法的效率有多快我就不说,不信你可以去用 10 亿个数据模拟一下,今天给大家讲一讲位运算的一些经典例子。不过,最重要的不是看懂了这些例子就好,而是要在以后多去运用位运算这些技巧,当然,采用位运算,也是可以装逼的,不信,你往下看。我会从最简单的讲起,一道比一道难度递增,不过居然是讲技巧,那么也不会太难,相信你分分钟看懂。 判断奇偶数 判断一个数是基于还是偶数,相信很多人都做过,一般的做法的代码如下
《C++ Primer》学习笔记(六):C++模块设计——函数
专栏C++学习笔记 《C++ Primer》学习笔记/习题答案 总目录 https://blog.csdn.net/TeFuirnever/article/details/100700212 —————————————————————————————————————————————————————— 《C++ Primer》习题参考答案:第6章 - C++模块设计——函数 文章目录专栏C+...
8年经验面试官详解 Java 面试秘诀
    作者 | 胡书敏 责编 | 刘静 出品 | CSDN(ID:CSDNnews) 本人目前在一家知名外企担任架构师,而且最近八年来,在多家外企和互联网公司担任Java技术面试官,前后累计面试了有两三百位候选人。在本文里,就将结合本人的面试经验,针对Java初学者、Java初级开发和Java开发,给出若干准备简历和准备面试的建议。   Java程序员准备和投递简历的实
面试官如何考察你的思维方式?
1.两种思维方式在求职面试中,经常会考察这种问题:北京有多少量特斯拉汽车? 某胡同口的煎饼摊一年能卖出多少个煎饼? 深圳有多少个产品经理? 一辆公交车里能装下多少个乒乓球? 一
so easy! 10行代码写个"狗屁不通"文章生成器
前几天,GitHub 有个开源项目特别火,只要输入标题就可以生成一篇长长的文章。背后实现代码一定很复杂吧,里面一定有很多高深莫测的机器学习等复杂算法不过,当我看了源代码之后这程序不到50
知乎高赞:中国有什么拿得出手的开源软件产品?(整理自本人原创回答)
知乎高赞:中国有什么拿得出手的开源软件产品? 在知乎上,有个问题问“中国有什么拿得出手的开源软件产品(在 GitHub 等社区受欢迎度较好的)?” 事实上,还不少呢~ 本人于2019.7.6进行了较为全面的 回答 - Bravo Yeung,获得该问题下回答中得最高赞(236赞和1枚专业勋章),对这些受欢迎的 Github 开源项目分类整理如下: 分布式计算、云平台相关工具类 1.SkyWalk
相关热词 c# 图片上传 c# gdi 占用内存 c#中遍历字典 c#控制台模拟dos c# 斜率 最小二乘法 c#进程延迟 c# mysql完整项目 c# grid 总行数 c# web浏览器插件 c# xml 生成xsd
立即提问