简体   繁体   English

在使用 openapi Braid 为我的 corda 项目生成 api 时,它在最后一个 steep 中显示了一些错误

[英]while using openapi Braid for generating api for my corda project its showing some error in the last steep

Downloads\bootcamp-openapi-master\bootcamp-openapi-master\build\nodes>openapi-generator generate -i http://localhost:10200/swagger.json -g javascript -o ./code-gen --
api-package io.generated.api --model-package io.generated.model
[main] ERROR io.swagger.v3.parser.util.RemoteUrl - unable to read
java.net.SocketException: Unexpected end of file from server
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
        at java.lang.reflect.Constructor.newInstance(Unknown Source)
        at sun.net.www.protocol.http.HttpURLConnection$10.run(Unknown Source)
        at sun.net.www.protocol.http.HttpURLConnection$10.run(Unknown Source)

I am trying to work on the corda openapi generation project but its showing me above error in the last step.我正在尝试处理 corda openapi 生成项目,但它在最后一步向我显示上述错误。 The project I am trying to work is我正在努力工作的项目是
https://blog.b9lab.com/cordacon-2019-highlights-braid-server-and-openapi-generator-for-corda-flows-api-s-d24179ccb27c and similar https://github.com/corda/openapi-sample https://blog.b9lab.com/cordacon-2019-highlights-braid-server-and-openapi-generator-for-corda-flows-api-s-d24179ccb27c和类似的https://github.com/corda/openapi -样本

But the problem is that I have done same as show in the link but my last step that is generating api is not executing and throwing the above mentioned errors.但问题是我做了与链接中显示相同的操作,但我生成 api 的最后一步没有执行并抛出上述错误。 And one more thing is that my one step is showing different output compared to the one shown in the Git.还有一件事是我的一步显示的输出与 Git 中显示的输出不同。

MY OUTPUT我的输出

10:03:39.328 [main] INFO  io.bluebank.braid.corda.server.BraidCordaStandaloneServer - Starting Braid on port: 10200
10:03:39.718 [braid-startup-threadpool-0] INFO  io.bluebank.braid.corda.BraidVerticle - BraidVerticle.setupRouter starting...
10:03:39.781 [braid-startup-threadpool-0] INFO  io.bluebank.braid.corda.rest.DocsHandlerFactory - activating OpenAPI V3
10:03:39.874 [braid-startup-threadpool-0] INFO  io.bluebank.braid.corda.rest.RestMounter - swagger json bound to https://localhost:10200/swagger.json
10:03:39.890 [braid-startup-threadpool-0] INFO  io.bluebank.braid.corda.rest.RestMounter - Swagger UI bound to https://localhost:10200/
10:03:42.999 [braid-startup-threadpool-0] INFO  io.bluebank.braid.corda.server.BraidCordaStandaloneServer - registering: /cordapps/bootcamp-openapi-master/flows/bootcamp.GetAllTokensFlow
10:03:43.062 [braid-startup-threadpool-0] INFO  io.bluebank.braid.corda.server.BraidCordaStandaloneServer - registering: /cordapps/bootcamp-openapi-master/flows/bootcamp.TokenIssueFlowInitiator
10:03:43.108 [braid-startup-threadpool-0] INFO  io.bluebank.braid.corda.rest.RestMounter - REST end point bound to https://localhost:10200/api/rest
10:03:43.108 [braid-startup-threadpool-0] INFO  io.bluebank.braid.corda.BraidVerticle - BraidVerticle.setupRouter complete -- 3406 msec
10:03:43.889 [vert.x-eventloop-thread-0] INFO  io.bluebank.braid.corda.BraidVerticle - BraidVerticle.setupWebserver complete -- 781 msec
10:03:43.889 [vert.x-eventloop-thread-0] INFO  io.bluebank.braid.corda.BraidVerticle - Braid server started on
10:03:43.905 [vert.x-eventloop-thread-0] INFO  io.bluebank.braid.corda.BraidVerticle - Braid service mounted on https://localhost:10200/api/
10:03:43.905 [vert.x-eventloop-thread-1] INFO  io.bluebank.braid.corda.BraidServer - Braid server started successfully on 10200

Their OUTPUT他们的输出


10:03:39.328 [main] INFO  io.bluebank.braid.corda.server.BraidCordaStandaloneServer - Starting Braid on port: 10200
10:03:39.718 [braid-startup-threadpool-0] INFO  io.bluebank.braid.corda.BraidVerticle - BraidVerticle.setupRouter starting...
10:03:39.781 [braid-startup-threadpool-0] INFO  io.bluebank.braid.corda.rest.DocsHandlerFactory - activating OpenAPI V2
10:03:39.874 [braid-startup-threadpool-0] INFO  io.bluebank.braid.corda.rest.RestMounter - swagger json bound to http://localhost:10200/swagger.json
10:03:39.890 [braid-startup-threadpool-0] INFO  io.bluebank.braid.corda.rest.RestMounter - Swagger UI bound to http://localhost:10200/
10:03:42.999 [braid-startup-threadpool-0] INFO  io.bluebank.braid.corda.server.BraidCordaStandaloneServer - registering: /cordapps/bootcamp-openapi-master/flows/bootcamp.GetAllTokensFlow
10:03:43.062 [braid-startup-threadpool-0] INFO  io.bluebank.braid.corda.server.BraidCordaStandaloneServer - registering: /cordapps/bootcamp-openapi-master/flows/bootcamp.TokenIssueFlowInitiator
10:03:43.108 [braid-startup-threadpool-0] INFO  io.bluebank.braid.corda.rest.RestMounter - REST end point bound to http://localhost:10200/api/rest
10:03:43.108 [braid-startup-threadpool-0] INFO  io.bluebank.braid.corda.BraidVerticle - BraidVerticle.setupRouter complete -- 3406 msec
10:03:43.889 [vert.x-eventloop-thread-0] INFO  io.bluebank.braid.corda.BraidVerticle - BraidVerticle.setupWebserver complete -- 781 msec
10:03:43.889 [vert.x-eventloop-thread-0] INFO  io.bluebank.braid.corda.BraidVerticle - Braid server started on
10:03:43.905 [vert.x-eventloop-thread-0] INFO  io.bluebank.braid.corda.BraidVerticle - Braid service mounted on https://localhost:10200/api/
10:03:43.905 [vert.x-eventloop-thread-1] INFO  io.bluebank.braid.corda.BraidServer - Braid server started successfully on 10200

The difference is that their don't contains https but I don't think this could raise any error.不同之处在于它们不包含https ,但我认为这不会引发任何错误。

In your Braid server output it says activating OpenAPI V2 meaning your server is generating the API's with OpenAPI Specification version 2 , while your openapi-generator is throwing error ERROR io.swagger.v3.parser.util.RemoteUrl meaning it's looking for v3 (not v2 ) that's why it's unable to parse the file.在您的 Braid 服务器输出中,它表示activating OpenAPI V2意味着您的服务器正在生成具有 OpenAPI 规范版本2的 API,而您的 openapi-generator 正在抛出错误ERROR io.swagger.v3.parser.util.RemoteUrl意味着它正在寻找v3 (不是v2 ) 这就是它无法解析文件的原因。
In my Medium article (and R3 tutorial) we both use v3 .在我的 Medium 文章(和 R3 教程)中,我们都使用v3
From my article (notice the 3 after 10200 :从我的文章(注意10200之后的3

localhost:10004 user1 test 10200 3 “/home/your-user/path-to-project/bootcamp-openapi/build/nodes/PartyA/cordapps”

From R3's article (notice how we both use openapi version 3 ):来自 R3 的文章(注意我们如何使用openapi version 3 ):

Now, find the down triangle to open up the run configuration. At the Program arguments, paste in: 
localhost:10004 user1 test 10200 3 
"/YOUR-PATH-TO-THIS-FOLDER/bootcamp-cordapp/build/nodes/PartyA/cordapps"

RPC connection address: localhost:10004
node login username: user1
node login password: test
Your desired expose port: 10200
openapi version: 3
Cordapp folder to pick up the jar: "YOUR-PATH-TO-THIS-FOLDER/bootcamp-cordapp/build/nodes/PartyA/cordapps"

So I'm not sure why you decided to use version 2 .所以我不确定你为什么决定使用版本2

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 辫子服务器找不到corda jar文件 - Braid server not finding corda jar files Corda:Corda 中的响应者流注释 @InitiatedBy 显示不兼容的类型错误 - Corda : The responder flow annotation @InitiatedBy in Corda showing an incompatible types error 在corda中兑换可替代令牌时出错 - Error while redeeming fungible token in corda 在centOS中使用Hyperledger Composer-rest-server生成REST API时出错 - Error while generating REST api using hyperledger composer-rest-server in centOS 引导 Corda 网络时出现“错误:无效或损坏的 jarfilecorda.jar” - Getting "Error: Invalid or corrupt jarfile corda.jar" while bootstrapping the Corda netwrok 安装测试corda节点时出现安装错误 - Installation error while installing test corda node 使用AWS Corda Enterprise模板在Corda节点之间执行事务时无法连接到Load Balancer - Failed to connect to Load Balancer while performing transactions between Corda nodes using AWS Corda Enterprise template Corda Settler UI-尝试通过API发送问题请求时出现错误404 - Corda Settler UI - Error 404 when trying to send an issue-obligation request via API Corda 项目中的 NoSuchMethodError 异常 - NoSuchMethodError Exception in Corda Project 使用bitcore库生成公共地址时出错 - Error while using bitcore library for generating public addresses
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM