常见的包装天鹅绒会导致一个空的罐子 [英] Packaging cygnus-common results in an empty jar

查看:82
本文介绍了常见的包装天鹅绒会导致一个空的罐子的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试按照此指南,但是创建cygnus通用jar(包括依赖项)总是会导致一个空jar. Apache-Flume安装成功,没有任何问题.我已经尝试按照指南增加Maven JVM的内存,但这并没有帮助.

I'm trying to install cygnus-common following this guide but the creation of the cygnus-common jar (incl. dependencies) always results in an empty jar. Apache-Flume installed without any issues. I've tried increasing the memory for the Maven JVM as per the guide but this hasn't helped.

~/fiware-cygnus/cygnus-common$ mvn clean compile exec:exec 
assembly:single
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building cygnus-common 1.1.0
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ cygnus-common ---
[INFO] Deleting /home/cygnus/fiware-cygnus/cygnus-common/target
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ cygnus-common ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 2 resources
[INFO] 
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ cygnus-common ---
[INFO] Compiling 50 source files to /home/cygnus/fiware-cygnus/cygnus-common/target/classes
[INFO] 
[INFO] --- exec-maven-plugin:1.5.0:exec (default-cli) @ cygnus-common ---
[INFO] 
[INFO] --- maven-assembly-plugin:2.6:single (default-cli) @ cygnus-common ---
[INFO] Building jar: /home/cygnus/fiware-cygnus/cygnus-common/target/cygnus-common-1.1.0-jar-with-dependencies.jar
Killed

这是结果文件

~/fiware-cygnus/cygnus-common$ ls -lrth target/
total 12K
drwxrwxr-x 3 cygnus cygnus 4.0K Jun 13 14:57 generated-sources
drwxrwxr-x 3 cygnus cygnus 4.0K Jun 13 14:57 classes
drwxrwxr-x 2 cygnus cygnus 4.0K Jun 13 14:57 archive-tmp
-rw-rw-r-- 1 cygnus cygnus    0 Jun 13 14:58 cygnus-common-1.1.0-jar-with-dependencies.jar

类似的问题之前曾被问到,但未记录任何解决方案.针对该问题给出的唯一建议是缺少磁盘空间,内存或权限.磁盘空间绝对不是问题,我为Maven JVM增加了内存,并且用户具有正确的权限.

A similar question was asked before with no resolution documented. The only suggestions given for that question was either lack of disk space, memory or permissions. Disk space is definitely not an issue, I have increased the memory for the Maven JVM and the user has the correct permissions.

所以我按照@frb的建议在调试模式下运行了mvn compile,这是内存问题

So I ran the mvn compile in debug mode as suggested by @frb and it was memory issue

#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (malloc) failed to allocate 257024000 bytes for committing reserved memory.
# Possible reasons:
#   The system is out of physical RAM or swap space
#   In 32 bit mode, the process size limit was hit
# Possible solutions:
#   Reduce memory load on the system
#   Increase physical memory or swap space
#   Check if swap backing store is full
#   Use 64 bit Java on a 64 bit OS
#   Decrease Java heap size (-Xmx/-Xms)
#   Decrease number of Java threads
#   Decrease Java thread stack sizes (-Xss)
#   Set larger code cache with -XX:ReservedCodeCacheSize=
# This output file may be truncated or incomplete.
#
#  Out of Memory Error (os_linux.cpp:2827), pid=48868, tid=140567873734400

  [1]: http://fiware-cygnus.readthedocs.io/en/latest/cygnus-common/installation_and_administration_guide/install_from_sources/index.html#section3 "guide"

使用top当进程被杀死时,我能够看到内存使用率超过70%.系统具有〜1.7Gb,远高于上述要求,它是64位系统.

using top I was able to see that the memory usage was over 70% when the process got killed. The system has ~1.7Gb which is well above the stated requirements, and it is a 64bit system.

我已将系统内存增加到3Gb,并且构建成功,所以也许应该更新硬件要求?

I had the system memory increased to 3Gb and the build succeeded so perhaps the hardware requirements should be updated?

推荐答案

将系统内存增加到3Gb可以解决此问题,并成功创建了jar.

Increasing the system memory to 3Gb fixed this issue and the jar was created successfully.

这篇关于常见的包装天鹅绒会导致一个空的罐子的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆