5 你好,我买了您的书,按照您书上的例子使用Java的sdk来查询信息,但是始终报下面的错

D:\java\jdk1.8.0_131\bin\java.exe -javaagent:D:\app\jetBrains\apps\IDEA-U\ch-0\181.5087.20\lib\idea_rt.jar=64286:D:\app\jetBrains\apps\IDEA-U\ch-0\181.5087.20\bin -Dfile.encoding=UTF-8 -classpath D:\java\jdk1.8.0_131\jre\lib\charsets.jar;D:\java\jdk1.8.0_131\jre\lib\deploy.jar;D:\java\jdk1.8.0_131\jre\lib\ext\access-bridge-64.jar;D:\java\jdk1.8.0_131\jre\lib\ext\cldrdata.jar;D:\java\jdk1.8.0_131\jre\lib\ext\dnsns.jar;D:\java\jdk1.8.0_131\jre\lib\ext\jaccess.jar;D:\java\jdk1.8.0_131\jre\lib\ext\jfxrt.jar;D:\java\jdk1.8.0_131\jre\lib\ext\localedata.jar;D:\java\jdk1.8.0_131\jre\lib\ext\nashorn.jar;D:\java\jdk1.8.0_131\jre\lib\ext\sunec.jar;D:\java\jdk1.8.0_131\jre\lib\ext\sunjce_provider.jar;D:\java\jdk1.8.0_131\jre\lib\ext\sunmscapi.jar;D:\java\jdk1.8.0_131\jre\lib\ext\sunpkcs11.jar;D:\java\jdk1.8.0_131\jre\lib\ext\zipfs.jar;D:\java\jdk1.8.0_131\jre\lib\javaws.jar;D:\java\jdk1.8.0_131\jre\lib\jce.jar;D:\java\jdk1.8.0_131\jre\lib\jfr.jar;D:\java\jdk1.8.0_131\jre\lib\jfxswt.jar;D:\java\jdk1.8.0_131\jre\lib\jsse.jar;D:\java\jdk1.8.0_131\jre\lib\management-agent.jar;D:\java\jdk1.8.0_131\jre\lib\plugin.jar;D:\java\jdk1.8.0_131\jre\lib\resources.jar;D:\java\jdk1.8.0_131\jre\lib\rt.jar;F:\workspace\fabricjava\target\classes;E:\maven\repos\org\hyperledger\fabric-sdk-java\fabric-sdk-java\1.0.0\fabric-sdk-java-1.0.0.jar;E:\maven\repos\io\grpc\grpc-netty\1.3.0\grpc-netty-1.3.0.jar;E:\maven\repos\io\grpc\grpc-core\1.3.0\grpc-core-1.3.0.jar;E:\maven\repos\com\google\errorprone\error_prone_annotations\2.0.19\error_prone_annotations-2.0.19.jar;E:\maven\repos\com\google\code\findbugs\jsr305\3.0.0\jsr305-3.0.0.jar;E:\maven\repos\io\grpc\grpc-context\1.3.0\grpc-context-1.3.0.jar;E:\maven\repos\com\google\instrumentation\instrumentation-api\0.3.0\instrumentation-api-0.3.0.jar;E:\maven\repos\io\netty\netty-handler-proxy\4.1.8.Final\netty-handler-proxy-4.1.8.Final.jar;E:\maven\repos\io\netty\netty-transport\4.1.8.Final\netty-transport-4.1.8.Final.jar;E:\maven\repos\io\netty\netty-resolver\4.1.8.Final\netty-resolver-4.1.8.Final.jar;E:\maven\repos\io\netty\netty-codec-socks\4.1.8.Final\netty-codec-socks-4.1.8.Final.jar;E:\maven\repos\io\grpc\grpc-protobuf\1.3.0\grpc-protobuf-1.3.0.jar;E:\maven\repos\com\google\guava\guava\19.0\guava-19.0.jar;E:\maven\repos\com\google\protobuf\protobuf-java-util\3.2.0\protobuf-java-util-3.2.0.jar;E:\maven\repos\com\google\code\gson\gson\2.7\gson-2.7.jar;E:\maven\repos\com\google\api\grpc\grpc-google-common-protos\0.1.6\grpc-google-common-protos-0.1.6.jar;E:\maven\repos\io\grpc\grpc-protobuf-lite\1.3.0\grpc-protobuf-lite-1.3.0.jar;E:\maven\repos\io\grpc\grpc-stub\1.3.0\grpc-stub-1.3.0.jar;E:\maven\repos\io\netty\netty-tcnative-boringssl-static\1.1.33.Fork26\netty-tcnative-boringssl-static-1.1.33.Fork26.jar;E:\maven\repos\io\netty\netty-codec-http2\4.1.8.Final\netty-codec-http2-4.1.8.Final.jar;E:\maven\repos\io\netty\netty-codec-http\4.1.8.Final\netty-codec-http-4.1.8.Final.jar;E:\maven\repos\io\netty\netty-codec\4.1.8.Final\netty-codec-4.1.8.Final.jar;E:\maven\repos\io\netty\netty-handler\4.1.8.Final\netty-handler-4.1.8.Final.jar;E:\maven\repos\io\netty\netty-buffer\4.1.8.Final\netty-buffer-4.1.8.Final.jar;E:\maven\repos\io\netty\netty-common\4.1.8.Final\netty-common-4.1.8.Final.jar;E:\maven\repos\com\google\protobuf\protobuf-java\3.1.0\protobuf-java-3.1.0.jar;E:\maven\repos\org\bouncycastle\bcpkix-jdk15on\1.55\bcpkix-jdk15on-1.55.jar;E:\maven\repos\org\bouncycastle\bcprov-jdk15on\1.55\bcprov-jdk15on-1.55.jar;E:\maven\repos\commons-cli\commons-cli\1.3.1\commons-cli-1.3.1.jar;E:\maven\repos\org\apache\commons\commons-compress\1.12\commons-compress-1.12.jar;E:\maven\repos\commons-io\commons-io\2.4\commons-io-2.4.jar;E:\maven\repos\org\apache\httpcomponents\httpclient\4.5.2\httpclient-4.5.2.jar;E:\maven\repos\org\apache\httpcomponents\httpcore\4.4.4\httpcore-4.4.4.jar;E:\maven\repos\commons-codec\commons-codec\1.9\commons-codec-1.9.jar;E:\maven\repos\org\glassfish\javax.json\1.0.4\javax.json-1.0.4.jar;E:\maven\repos\org\yaml\snakeyaml\1.18\snakeyaml-1.18.jar;E:\maven\repos\org\jacoco\jacoco-maven-plugin\0.7.9\jacoco-maven-plugin-0.7.9.jar;E:\maven\repos\org\apache\maven\maven-plugin-api\2.2.1\maven-plugin-api-2.2.1.jar;E:\maven\repos\org\apache\maven\maven-project\2.2.1\maven-project-2.2.1.jar;E:\maven\repos\org\apache\maven\maven-settings\2.2.1\maven-settings-2.2.1.jar;E:\maven\repos\org\apache\maven\maven-profile\2.2.1\maven-profile-2.2.1.jar;E:\maven\repos\org\apache\maven\maven-model\2.2.1\maven-model-2.2.1.jar;E:\maven\repos\org\apache\maven\maven-artifact-manager\2.2.1\maven-artifact-manager-2.2.1.jar;E:\maven\repos\org\apache\maven\maven-repository-metadata\2.2.1\maven-repository-metadata-2.2.1.jar;E:\maven\repos\org\apache\maven\wagon\wagon-provider-api\1.0-beta-6\wagon-provider-api-1.0-beta-6.jar;E:\maven\repos\backport-util-concurrent\backport-util-concurrent\3.1\backport-util-concurrent-3.1.jar;E:\maven\repos\org\apache\maven\maven-plugin-registry\2.2.1\maven-plugin-registry-2.2.1.jar;E:\maven\repos\org\codehaus\plexus\plexus-interpolation\1.11\plexus-interpolation-1.11.jar;E:\maven\repos\org\apache\maven\maven-artifact\2.2.1\maven-artifact-2.2.1.jar;E:\maven\repos\org\codehaus\plexus\plexus-container-default\1.0-alpha-9-stable-1\plexus-container-default-1.0-alpha-9-stable-1.jar;E:\maven\repos\junit\junit\3.8.1\junit-3.8.1.jar;E:\maven\repos\classworlds\classworlds\1.1-alpha-2\classworlds-1.1-alpha-2.jar;E:\maven\repos\org\codehaus\plexus\plexus-utils\3.0.22\plexus-utils-3.0.22.jar;E:\maven\repos\org\apache\maven\shared\file-management\1.2.1\file-management-1.2.1.jar;E:\maven\repos\org\apache\maven\shared\maven-shared-io\1.1\maven-shared-io-1.1.jar;E:\maven\repos\org\apache\maven\reporting\maven-reporting-api\2.2.1\maven-reporting-api-2.2.1.jar;E:\maven\repos\org\apache\maven\doxia\doxia-sink-api\1.1\doxia-sink-api-1.1.jar;E:\maven\repos\org\apache\maven\doxia\doxia-logging-api\1.1\doxia-logging-api-1.1.jar;E:\maven\repos\org\apache\maven\reporting\maven-reporting-impl\2.1\maven-reporting-impl-2.1.jar;E:\maven\repos\org\apache\maven\doxia\doxia-core\1.1.2\doxia-core-1.1.2.jar;E:\maven\repos\xerces\xercesImpl\2.8.1\xercesImpl-2.8.1.jar;E:\maven\repos\commons-lang\commons-lang\2.4\commons-lang-2.4.jar;E:\maven\repos\commons-httpclient\commons-httpclient\3.1\commons-httpclient-3.1.jar;E:\maven\repos\org\apache\maven\doxia\doxia-site-renderer\1.1.2\doxia-site-renderer-1.1.2.jar;E:\maven\repos\org\apache\maven\doxia\doxia-decoration-model\1.1.2\doxia-decoration-model-1.1.2.jar;E:\maven\repos\org\apache\maven\doxia\doxia-module-xhtml\1.1.2\doxia-module-xhtml-1.1.2.jar;E:\maven\repos\org\apache\maven\doxia\doxia-module-fml\1.1.2\doxia-module-fml-1.1.2.jar;E:\maven\repos\org\codehaus\plexus\plexus-i18n\1.0-beta-7\plexus-i18n-1.0-beta-7.jar;E:\maven\repos\org\codehaus\plexus\plexus-velocity\1.1.7\plexus-velocity-1.1.7.jar;E:\maven\repos\org\apache\velocity\velocity\1.5\velocity-1.5.jar;E:\maven\repos\commons-collections\commons-collections\3.2\commons-collections-3.2.jar;E:\maven\repos\commons-validator\commons-validator\1.2.0\commons-validator-1.2.0.jar;E:\maven\repos\commons-beanutils\commons-beanutils\1.7.0\commons-beanutils-1.7.0.jar;E:\maven\repos\commons-digester\commons-digester\1.6\commons-digester-1.6.jar;E:\maven\repos\oro\oro\2.0.8\oro-2.0.8.jar;E:\maven\repos\xml-apis\xml-apis\1.0.b2\xml-apis-1.0.b2.jar;E:\maven\repos\org\jacoco\org.jacoco.agent\0.7.9\org.jacoco.agent-0.7.9-runtime.jar;E:\maven\repos\org\jacoco\org.jacoco.core\0.7.9\org.jacoco.core-0.7.9.jar;E:\maven\repos\org\ow2\asm\asm-debug-all\5.2\asm-debug-all-5.2.jar;E:\maven\repos\org\jacoco\org.jacoco.report\0.7.9\org.jacoco.report-0.7.9.jar;E:\maven\repos\commons-logging\commons-logging\1.1.1\commons-logging-1.1.1.jar;E:\maven\repos\log4j\log4j\1.2.16\log4j-1.2.16.jar com.pact.hypledger.FabricTest

log4j:WARN No appenders could be found for logger (org.hyperledger.fabric.sdk.helper.Config).

log4j:WARN Please initialize the log4j system properly.

log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.

Exception in thread "main" org.hyperledger.fabric.sdk.exception.TransactionException: java.lang.RuntimeException: Property of sslProvider expected

at org.hyperledger.fabric.sdk.Channel.getConfigurationBlock(Channel.java:938)

at org.hyperledger.fabric.sdk.Channel.parseConfigBlock(Channel.java:826)

at org.hyperledger.fabric.sdk.Channel.initialize(Channel.java:526)

at com.pact.hypledger.FabricTest.main(FabricTest.java:32)

Caused by: java.lang.RuntimeException: Property of sslProvider expected

at org.hyperledger.fabric.sdk.Endpoint.<init>(Endpoint.java:110)

at org.hyperledger.fabric.sdk.Orderer.sendDeliver(Orderer.java:159)

at org.hyperledger.fabric.sdk.Channel.getLatestBlock(Channel.java:1074)

at org.hyperledger.fabric.sdk.Channel.getConfigurationBlock(Channel.java:898)

... 3 more



这是我的代码,别的都和您书上的一样,只是改了证书的地址和peer与order的地址,我用的是1.0.0的jar

attachments-2018-06-LlMWqz2f5b1f8637b472e.png


请先 登录 后评论

1 个回答

admin

由于你的错误信息没有完整的显示,我估计有是你没有在启动变量中设置配置信息  


系统启动的时候通过 -Dorg.hyperledger.fabric.sdk.configuration=/project/javaworkspace/fabric-sdk-java-sample/src/org/hyperledger/fabric/sdk/configuration/config.properties 的方式来指定配置文件



https://github.com/blockchain-technical-practice/fabric_sdk_java_study  这里有本书的详细代码,您可以查看一下。

请先 登录 后评论
  • 2 关注
  • 0 收藏,121 浏览
  • 韦冬冬 提出于 2018-06-12 16:38

相似问题