一个伪linux粉丝的blog

  1. 首页
  2. unix/linux
  3. 正文

Can't execute jar- file: “no main manifest attribute”

5 6 月, 2020 1086点热度 0人点赞 0条评论

客户部署的镜像反馈在容器平台上反复重启,还来不及看日志就开始反复重启了。

.1. 问题定位

  • 查看容器事件

发现一些   exit code 1字样,没有发现有效信息,节点资源使用达到92%以上,一度怀疑与资源有关,降低过资源请求,发现仍然不断重启。

  • 查看容器日志,仅3行

看到 no main manifest attribute, in ****.jar 字样,

1
2
DEBUG 2020-05-28 13:34:12:395 main AgentPackagePath : The beacon <span class="code-keyword">class </span>location is jar:file:/root/myapp/skywalking-agent/skywalking-agent.jar!/org/apache/skywalking/apm/agent/core/boot/AgentPackagePath.class. INFO 2020-05-28 13:34:12:404 main SnifferConfigInitializer : Config file found in /root/myapp/skywalking-agent/config/agent.config.
no main manifest attribute, in pri-****.jar

于是找到了这篇文档  Can't execute jar- file: “no main manifest attribute” (阅读量高达一百四十万,你没看错)

里面有针对用户环境的多种解决方法。

2. 故障根源

jar不可执行时,需要增加插件引用

3. 解决方案

  • 用户pom.xml文件增加插件字段
1
2
3
4
5
6
7
8
<span class="pun">&lt;</span><span class="pln">build</span><span class="pun">&gt;</span>
    <span class="pun">&lt;</span><span class="pln">plugins</span><span class="pun">&gt;</span>
        <span class="pun">&lt;</span><span class="pln">plugin</span><span class="pun">&gt;</span>
            <span class="pun">&lt;</span><span class="pln">groupId</span><span class="pun">&gt;</span><span class="pln">org</span><span class="pun">.</span><span class="pln">springframework</span><span class="pun">.</span><span class="pln">boot</span><span class="pun">&lt;/</span><span class="pln">groupId</span><span class="pun">&gt;</span>
            <span class="pun">&lt;</span><span class="pln">artifactId</span><span class="pun">&gt;</span><span class="pln">spring</span><span class="pun">-</span><span class="pln">boot</span><span class="pun">-</span><span class="pln">maven</span><span class="pun">-</span><span class="pln">plugin</span><span class="pun">&lt;/</span><span class="pln">artifactId</span><span class="pun">&gt;</span>
        <span class="pun">&lt;/</span><span class="pln">plugin</span><span class="pun">&gt;</span>
    <span class="pun">&lt;/</span><span class="pln">plugins</span><span class="pun">&gt;</span>
<span class="pun">&lt;/</span><span class="pln">build</span><span class="pun">&gt;</span>

4. 后续改进

  • 了解maven环境各种引用依赖,而且貌似有版本关联性。

相关文章:

  1. Linux Kernel 5.4 on Debian 10
  2. 另一款翻译插件Wordpress Global Translator Plugin-国际化你的blog
  3. wordpress提速优化
  4. Docker "fork/exec /proc/self/exe: no such file or directory\""
标签: pom.xml
最后更新:5 6 月, 2020

wanjie

这个人很懒,什么都没留下

点赞
< 上一篇
下一篇 >

文章评论

razz evil exclaim smile redface biggrin eek confused idea lol mad twisted rolleyes wink cool arrow neutral cry mrgreen drooling persevering
取消回复

This site uses Akismet to reduce spam. Learn how your comment data is processed.

归档
分类
  • network / 332篇
  • Uncategorized / 116篇
  • unix/linux / 121篇
  • 业界资讯 / 38篇
  • 公司杂事 / 11篇
  • 数码影像 / 12篇
  • 美剧 / 3篇
  • 美图共赏 / 21篇
  • 英语学习 / 3篇
标签聚合
网站运营 dreamhost空间 ldap Ubuntu docker jira kubectl gitlab postgres wget d90 Google Voice 浏览器 kernel k8s squid 虚拟主机 VPS Google debian ssh 邮件归档 Nginx openssl 天翼live google-chrome dreamhost nexus 泰国 deepseek

COPYRIGHT © 2008-2025 wanjie.info. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang