命令行执行,java -jar jenkins.war,报错
-------------------------------
SEVERE: Container startup failed
java.io.IOException: Failed to start a listener: winstone.HttpListener
at winstone.Launcher.spawnListener(Launcher.java:229)
at winstone.Launcher.(Launcher.java:181)
at winstone.Launcher.main(Launcher.java:384)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at Main._main(Main.java:273)
at Main.main(Main.java:98)
Caused by: java.io.IOException: Failed to listen on port 8080
at winstone.HttpListener.getServerSocket(HttpListener.java:122)
at winstone.HttpListener.start(HttpListener.java:75)
at winstone.Launcher.spawnListener(Launcher.java:220)
... 8 more
Caused by: java.net.BindException: Address already in use: JVM_Bind
at java.net.PlainSocketImpl.socketBind(Native Method)
at java.net.PlainSocketImpl.bind(Unknown Source)
at java.net.ServerSocket.bind(Unknown Source)
at java.net.ServerSocket.(Unknown Source)
at java.net.ServerSocket.(Unknown Source)
at winstone.HttpListener.getServerSocket(HttpListener.java:117)
... 10 more
←[0m←[31mMar 14, 2013 2:05:24 AM hudson.WebAppMain$2 run
SEVERE: Failed to initialize Jenkins
java.lang.InterruptedException
at java.lang.Object.wait(Native Method)
at java.lang.Object.wait(Object.java:485)
at org.jvnet.hudson.reactor.Reactor.execute(Reactor.java:244)
at jenkins.InitReactorRunner.run(InitReactorRunner.java:43)
at jenkins.model.Jenkins.executeReactor(Jenkins.java:894)
at jenkins.model.Jenkins.(Jenkins.java:796)
at hudson.model.Hudson.(Hudson.java:81)
at hudson.model.Hudson.(Hudson.java:77)
at hudson.WebAppMain$2.run(WebAppMain.java:214)
←[0mException in thread "pool-2-thread-1" java.lang.NullPointerException
at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:185)
at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:94)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source
)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Exception in thread "pool-2-thread-2" java.lang.NullPointerException
at org.jvnet.hudson.reactor.Reactor$1.run(Reactor.java:153)
at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:94)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source
)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
------------------------------
此错误是由于8080端口被占用,
改变端口再次执行,
java -jar jenkins.war --httpPort=$HTTP_PORT, 例如java -jar jenkins.war --httpPort=1080
启动成功;
后打开浏览器,输入http:/localhost:1080,即可看到jenkins的页面
http://www.2cto.com/kf/201303/195376.html