WeBankBlockchain/WeCross

routerLogin failed for http request failed

HiBo001 opened this issue · 2 comments

启动一个 wecross demo 运行 bash build.sh 后报错

提示:

WeCross booting up ...............................................
Exceed waiting time. Killed. Please try to start WeCross again
Error log
2021-01-04 14:27:34.087 [main] ERROR AdminContext() - routerLogin failed for http request failed, (Please check WeCross-Account-Manager service is available)
2021-01-04 14:27:34.112 [main] ERROR SpringApplication() - Application run failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'XATransactionManagerConfig': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'accountManagerConfig': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'newAdminContext' defined in class path resource [com/webank/wecross/config/AdminContextConfig.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.webank.wecross.account.AdminContext]: Factory method 'newAdminContext' threw exception; nested exception is com.webank.wecross.exception.WeCrossException: routerLogin failed for: http request failed

经确认,是jdk 271版本不支持secp256k1曲线导致,在WeCross和WeCross-Account-Manager已部署目录中的start.sh内java命令增加参数
-Djdk.disabled.namedCurves="" -Djdk.sunec.disableNative="false"
可解决

我这里遇到了同样的问题,已降低jdk版本至jdk8_251,为了防止出问题也禁用了曲线加密。
报错信息
[root@localhost wecross-demo]# ./start.sh
try to start node0
try to start node1
try to start node2
try to start node3
node1 start successfully
node3 start successfully
node0 start successfully
node2 start successfully
[INFO] Starting Fabric demo network...
cli
peer0.org2.example.com
peer0.org1.example.com
peer1.org2.example.com
peer1.org1.example.com
orderer.example.com
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
23d94e4cb1fc 7552e1968c0b "/bin/bash" 2 hours ago Up 6 seconds cli
0580f636709a 9756aed98c6b "peer node start" 2 hours ago Up 3 seconds 0.0.0.0:10051->10051/tcp, :::10051->10051/tcp peer1.org2.example.com
681e8111e6d8 9756aed98c6b "peer node start" 2 hours ago Up 1 second 0.0.0.0:8051->8051/tcp, :::8051->8051/tcp peer1.org1.example.com
323e6f109940 9756aed98c6b "peer node start" 2 hours ago Up 5 seconds 0.0.0.0:9051->9051/tcp, :::9051->9051/tcp peer0.org2.example.com
3c6e1b366e6a 9756aed98c6b "peer node start" 2 hours ago Up 4 seconds 0.0.0.0:7051->7051/tcp, :::7051->7051/tcp peer0.org1.example.com
a309c7d89cef dbc9f65443aa "orderer" 2 hours ago Up Less than a second 0.0.0.0:7050->7050/tcp, :::7050->7050/tcp orderer.example.com
[INFO] Fabric demo network has been started.
Try to start router: 127.0.0.1-8250-25500

Router version: wecross-1.1.1
Stub plugins: [ bcos2-stub-1.1.1 bcos2-stub-gm-1.1.1 fabric1-stub-1.1.1 ]

java version: java version "1.8.0_251"
java major: 1 minor: 8 patch: 0 ext: 251
Java check OK!
WeCross booting up .....
WeCross start failed
See logs/error.log for details
Error log
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:119) ~[spring-beans-5.2.13.RELEASE.jar:5.2.13.RELEASE]
at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessProperties(CommonAnnotationBeanPostProcessor.java:318) ~[spring-context-5.2.13.RELEASE.jar:5.2.13.RELEASE]
... 17 more
2021-06-26 01:14:16.929 [main] ERROR Service() - main, e:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'HTLCManagerConfig': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'accountManagerConfig': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'newAdminContext' defined in class path resource [com/webank/wecross/config/AdminContextConfig.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.webank.wecross.account.AdminContext]: Factory method 'newAdminContext' threw exception; nested exception is com.webank.wecross.exception.WeCrossException: routerLogin failed for: http request failed
at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessProperties(CommonAnnotationBeanPostProcessor.java:321) ~[spring-context-5.2.13.RELEASE.jar:5.2.13.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1425) ~[spring-beans-5.2.13.RELEASE.jar:5.2.13.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:593) ~[spring-beans-5.2.13.RELEASE.jar:5.2.13.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516) ~[spring-beans-5.2.13.RELEASE.jar:5.2.13.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:324) ~[spring-beans-5.2.13.RELEASE.jar:5.2.13.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.2.13.RELEASE.jar:5.2.13.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322) ~[spring-beans-5.2.13.RELEASE.jar:5.2.13.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-5.2.13.RELEASE.jar:5.2.13.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:897) ~[spring-beans-5.2.13.RELEASE.jar:5.2.13.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:879) ~[spring-context-5.2.13.RELEASE.jar:5.2.13.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:551) ~[spring-context-5.2.13.RELEASE.jar:5.2.13.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:758) ~[spring-boot-2.3.9.RELEASE.jar:2.3.9.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:750) ~[spring-boot-2.3.9.RELEASE.jar:2.3.9.RELEASE]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:405) ~[spring-boot-2.3.9.RELEASE.jar:2.3.9.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) ~[spring-boot-2.3.9.RELEASE.jar:2.3.9.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1237) ~[spring-boot-2.3.9.RELEASE.jar:2.3.9.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226) ~[spring-boot-2.3.9.RELEASE.jar:2.3.9.RELEASE]
at com.webank.wecross.Service.main(Service.java:17) [wecross-1.1.1.jar:?]
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'accountManagerConfig': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'newAdminContext' defined in class path resource [com/webank/wecross/config/AdminContextConfig.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.webank.wecross.account.AdminContext]: Factory method 'newAdminContext' threw exception; nested exception is com.webank.wecross.exception.WeCrossException: routerLogin failed for: http request failed

WeCross/start.sh

run_wecross() {
if [ "$(uname)" == "Darwin" ]; then
# Mac
nohup java -Djava.security.properties=${SECURIY_FILE} -Djdk.disabled.namedCurves="" -Djdk.sunec.disableNative="false" -Djdk.tls.namedGroups="secp256k1,x25519,secp256r1,secp384r1,secp521r1,x448,ffdhe2048,ffdhe3072,ffdhe4096,ffdhe6144,ffdhe8192" -cp ${CLASS_PATH} com.webank.wecross.Service >start.out 2>&1 &
elif [ "$(uname -s | grep MINGW | wc -l)" != "0" ]; then
# Windows
nohup java -Djava.security.properties=${SECURIY_FILE} -Djdk.disabled.namedCurves="" -Djdk.sunec.disableNative="false" -Djdk.tls.namedGroups="secp256k1,x25519,secp256r1,secp384r1,secp521r1,x448,ffdhe2048,ffdhe3072,ffdhe4096,ffdhe6144,ffdhe8192" -cp ${WINDS_CLASS_PATH} com.webank.wecross.Service >start.out 2>&1 &
else
# GNU/Linux
nohup java -Djava.security.properties=${SECURIY_FILE} -Djdk.disabled.namedCurves="" -Djdk.sunec.disableNative="false" -Djdk.tls.namedGroups="secp256k1,x25519,secp256r1,secp384r1,secp521r1,x448,ffdhe2048,ffdhe3072,ffdhe4096,ffdhe6144,ffdhe8192" -cp ${CLASS_PATH} com.webank.wecross.Service >start.out 2>&1 &
fi
}

WeCross-Account-Manager

run_wecross()
{
if [ "$(uname)" == "Darwin" ]; then
# Mac
nohup java -Djava.security.properties=${SECURIY_FILE} -Djdk.disabled.namedCurves="" -Djdk.sunec.disableNative="false" -Djdk.tls.namedGroups="secp256k1,x25519,secp256r1,secp384r1,secp521r1,x448,ffdhe2048,ffdhe3072,ffdhe4096,ffdhe6144,ffdhe8192" -cp ${CLASS_PATH} ${APP_NAME} >start.out 2>&1 &
elif [ "$(uname -s | grep MINGW | wc -l)" != "0" ]; then
# Windows
nohup java -Djava.security.properties=${SECURIY_FILE} -Djdk.disabled.namedCurves="" -Djdk.sunec.disableNative="false" -Djdk.tls.namedGroups="secp256k1,x25519,secp256r1,secp384r1,secp521r1,x448,ffdhe2048,ffdhe3072,ffdhe4096,ffdhe6144,ffdhe8192" -cp ${WINDS_CLASS_PATH} ${APP_NAME} >start.out 2>&1 &
else
# GNU/Linux
nohup java -Djava.security.properties=${SECURIY_FILE} -Djdk.disabled.namedCurves="" -Djdk.sunec.disableNative="false" -Djdk.tls.namedGroups="secp256k1,x25519,secp256r1,secp384r1,secp521r1,x448,ffdhe2048,ffdhe3072,ffdhe4096,ffdhe6144,ffdhe8192" -cp ${CLASS_PATH} ${APP_NAME} >start.out 2>&1 &
fi
}