记录启动Dubbo-admin遇到的问题
dubbo-admin-ui 下载node_modules出现镜像问题
进行dubbo-admin-ui打包操作是在2024-03-11,原域名链接: https://registry.npm.taobao.org/ 在 2022.06.30 号正式下线和停止 DNS 解析,使用下面命令更改:
# 清除镜像源缓存
npm cache clean --force
# 更换镜像源
npm config set registry https://registry.npmjs.org
更换完毕之后发现还是报错,依旧报的是淘宝镜像源过期,好像镜像源没有更换一样,其实这是dubbo-admin-ui在项目中已经规定依赖的下载镜像源,所以上面的全局镜像源修改是不生效的,打开项目中的package-lock.json文件,将所有https://registry.npm.taobao.org 更换成 https://registry.npmjs.org 。
更换前:
"node_modules/@babel/code-frame": {
"version": "7.10.4",
"resolved": "https://registry.npm.taobao.org/@babel/code-frame/-/code-frame-7.10.4.tgz",
"integrity": "sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg==",
"dev": true,
"dependencies": {
"@babel/highlight": "7.10.4"
}
}
更换后:
"node_modules/@babel/code-frame": {
"version": "7.10.4",
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.4.tgz",
"integrity": "sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg==",
"dev": true,
"dependencies": {
"@babel/highlight": "7.10.4"
}
}
打工程包时出现错误
在执行mvn clean package
打包命令时遇到一下错误:
Could not resolve dependencies for project org.apache.dubbo:dubbo-admin-server:jar:0.7.0-SNAPSHOT: org.apache.dubbo:dubbo-admin-ui:jar:0.7.0-SNAPSHOT was not found in https://repository.apache.org/content/repositories/snapshots during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of apache.snapshots.https has elapsed or updates are forced
看到错误原因是dubbo-admin-ui
找不到https://repository.apache.org/content/repositories/snapshots during a previous attempt
,这方面可以参考:https://blog.csdn.net/weixin_51729463/article/details/122444886
实际操作就是注释以下代码,是的maven下载不使用npm:
<goals>
<goal>npm</goal>
</goals>
运行jar包时出现连接不上注册中心
在运行 java -jar xxx.jar
命令时,出现以下错误:
Unable to canonicalize address 127.0.0.1/<unresolved>:2181 because it's not resolvable
百度之后发现我使用的是JDK17,所以和zookeeper连接不上(具体原因不清楚),更换成1.8之后成功