小编bob*_*nux的帖子

Docker.service的docker job失败,因为控制进程退出并显示错误代码

我花了更多的时间在这里和外面学习很多帖子,但我找不到解决方案,所以我来到这里问:

我想在manjaro linux OS上运行docker(像archlinux一样)

uname -a
Linux boblinux-pc 4.1.15-1-MANJARO #1 SMP PREEMPT Tue Dec 15 07:48:44 UTC 2015 x86_64 GNU/Linux
Run Code Online (Sandbox Code Playgroud)

安装docker之后,我想开始它:

sudo systemctl start docker
Failed to start docker.service: Unit docker.socket failed to load: No such file or directory.
Run Code Online (Sandbox Code Playgroud)

所以我有这个问题,所以我做了:

systemctl cat docker
# /etc/systemd/system/docker.service
[Unit]
Description=Docker Application Container Engine
Documentation=https://docs.docker.com
After=network.target docker.socket
Requires=docker.socket

[Service]
Type=notify
ExecStart=/usr/bin/docker daemon -H fd:// --exec-opt native.cgroupdriver=cgroupf
MountFlags=slave
LimitNOFILE=1048576
LimitNPROC=1048576
LimitCORE=infinity

[Install]
WantedBy=multi-user.target

# /etc/systemd/system/docker.service.d/lxc.conf
[Service]
ExecStart=
ExecStart=/usr/bin/docker -d -e lxc
....
Run Code Online (Sandbox Code Playgroud)

我做了:

systemctl cat …
Run Code Online (Sandbox Code Playgroud)

linux service systemd docker

6
推荐指数
1
解决办法
2万
查看次数

无法使用对象集合将hashset转换为treeset

我必须将Hashset转换为TreeSet,但我有错误

// Here, All is ok, Chien is an object.
Set<Chien> animaux = new HashSet<Chien>();
animaux.add(new Chien("non", 10));
animaux.add(new Chien("zoz", 15));
animaux.add(new Chien("non", 10));

// And then i have to convert it to TreeSet 
// IntellJ-Idead says me that's ok...
// But i have an error here
TreeSet<Chien> treseet = new TreeSet<Chien>(animaux);
Run Code Online (Sandbox Code Playgroud)

但是当我尝试编译时:

Exception in thread "main" java.lang.ClassCastException: fr.univtln.arouani277.vertebre.animal.Chien cannot be cast to java.lang.Comparable
    at java.util.TreeMap.put(TreeMap.java:559)
    at java.util.TreeSet.add(TreeSet.java:255)
    at java.util.AbstractCollection.addAll(AbstractCollection.java:322)
    at java.util.TreeSet.addAll(TreeSet.java:312)
    at java.util.TreeSet.<init>(TreeSet.java:160)
    at fr.univtln.arouani277.App.main(App.java:40)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at …
Run Code Online (Sandbox Code Playgroud)

java collections set hashset treeset

2
推荐指数
1
解决办法
1598
查看次数

标签 统计

collections ×1

docker ×1

hashset ×1

java ×1

linux ×1

service ×1

set ×1

systemd ×1

treeset ×1