Unable to change standalone Jenkins http port on Ubuntu

4,756 views
Skip to first unread message

halcyonCorsair

unread,
Jun 28, 2011, 8:44:05 PM6/28/11
to Jenkins Users, ell...@catalyst.net.nz
Hi,

Can anyone tell me why changing HTTP_PORT in /etc/default/jenkins (on
Ubuntu Lucid) causes this error on jenkins startup:

Running from: /usr/share/jenkins/jenkins.war
[Winstone 2011/06/28 17:11:16] - Container startup failed
java.lang.NullPointerException
at winstone.Launcher.<init>(Launcher.java:127)
at winstone.Launcher.main(Launcher.java:391)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
43)
at java.lang.reflect.Method.invoke(Method.java:616)
at Main._main(Main.java:248)
at Main.main(Main.java:95)

Note, I even tried switching to the jenkins user and starting jenkins
manually, and this works:
java -jar /usr/share/jenkins/jenkins.war --webroot=/var/run/jenkins/
war --httpPort=8081 --ajp13Port=-1

However this doesn't (basically what the init script runs):
/usr/bin/daemon --name=jenkins --inherit --env=JENKINS_HOME=/var/lib/
jenkins --output=/var/log/jenkins/jenkins.log --pidfile=/var/run/
jenkins/jenkins.pid -- /usr/bin/java -jar /usr/share/jenkins/
jenkins.war --webroot=/var/run/jenkins/war --httpPort=8081 --
ajp13Port=-1

In the end I gave up, and added a virtual host to tomcat and ran
jenkins that way, however for simplicity-sake I would have preferred
jenkins to run standalone so that it would need no future effort
during upgrades, other than:
apt-get update; apt-get upgrade

Can anyone shed some light on this issue?

Cheers,

Elliot

Mykola Nikishov

unread,
Jun 29, 2011, 9:29:43 AM6/29/11
to jenkins...@googlegroups.com
On 06/29/2011 03:44 AM, halcyonCorsair wrote:

> Can anyone tell me why changing HTTP_PORT in /etc/default/jenkins (on
> Ubuntu Lucid) causes this error on jenkins startup:
>
> Running from: /usr/share/jenkins/jenkins.war
> [Winstone 2011/06/28 17:11:16] - Container startup failed
> java.lang.NullPointerException
> at winstone.Launcher.<init>(Launcher.java:127)
> at winstone.Launcher.main(Launcher.java:391)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
> 57)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
> 43)
> at java.lang.reflect.Method.invoke(Method.java:616)
> at Main._main(Main.java:248)
> at Main.main(Main.java:95)

I have a VM running Jenkins 1.418 on Debian x86_64. I've cloned this VM,
stopped Jenkins, changed HTTP_PORT in /etc/default/jenkins to 8081 and
started it again. Now Jenkins is responding on
http://192.168.122.31:8081/, so it works.

It's somewhat related to your setup.

--
Mykola

Elliot Pahl

unread,
Jul 3, 2011, 8:08:10 PM7/3/11
to jenkins...@googlegroups.com
What jre are you using?

--
Elliot Pahl
ellio...@gmail.com

Didier Durand

unread,
Jul 4, 2011, 12:30:47 AM7/4/11
to Jenkins Users
Hi,

this is my /etc/default/jenkins on my ubuntu where I changed http port
to 8888 and the home directory. It works (Ubuntu = 10.04)
Hope it helps.
regards

didier

# defaults for jenkins continuous integration server

# pulled in from the init script; makes things easier.
NAME=jenkins

# location of java
JAVA=/usr/bin/java

# arguments to pass to java
#JAVA_ARGS="-Xmx256m"

PIDFILE=/var/run/jenkins/jenkins.pid

# user id to be invoked as (otherwise will run as root; not wise!)
JENKINS_USER=jenkins

# location of the jenkins war file
JENKINS_WAR=/usr/share/jenkins/jenkins.war

# jenkins home location
JENKINS_HOME=/home/jenkins

# set this to false if you don't want Hudson to run by itself
# in this set up, you are expected to provide a servlet container
# to host jenkins.
RUN_STANDALONE=true

# log location. this may be a syslog facility.priority
JENKINS_LOG=/var/log/jenkins/$NAME.log
#HUDSON_LOG=daemon.info

# OS LIMITS SETUP
# comment this out to observe /etc/security/limits.conf
# this is on by default because
http://github.com/jenkinsci/jenkins/commit/2fb288474e980d0e7ff9c4a3b768874835a3e92e
# reported that Ubuntu's PAM configuration doesn't include
pam_limits.so, and as a result the # of file
# descriptors are forced to 1024 regardless of /etc/security/
limits.conf
MAXOPENFILES=8192

# port for HTTP connector (default 8080; disable with -1)
HTTP_PORT=8888

# port for AJP connector (disabled by default)
AJP_PORT=-1

# arguments to pass to jenkins.
# --javahome=$JAVA_HOME
# --httpPort=$HTTP_PORT (default 8080; disable with -1)
# --httpsPort=$HTTP_PORT
# --ajp13Port=$AJP_PORT
# --argumentsRealm.passwd.$ADMIN_USER=[password]
# --argumentsRealm.$ADMIN_USER=admin
# --webroot=~/.jenkins/war
JENKINS_ARGS="--webroot=/var/run/jenkins/war --httpPort=$HTTP_PORT --
ajp13Port=$AJP_PORT"


On Jul 4, 2:08 am, Elliot Pahl <elliot.p...@gmail.com> wrote:
> What jre are you using?
>
> --
> Elliot Pahl
> elliot.p...@gmail.com

Mykola Nikishov

unread,
Jul 4, 2011, 3:14:00 AM7/4/11
to jenkins...@googlegroups.com
On 07/04/2011 03:08 AM, Elliot Pahl wrote:

> What jre are you using?

root@vm11:~# java -version
java version "1.6.0_18"
OpenJDK Runtime Environment (IcedTea6 1.8.7) (6b18-1.8.7-2~squeeze1)
OpenJDK 64-Bit Server VM (build 14.0-b16, mixed mode)

root@vm11:~# update-alternatives --display java
java - auto mode
link currently points to /usr/lib/jvm/java-6-openjdk/jre/bin/java
/usr/lib/jvm/java-6-openjdk/jre/bin/java - priority 1061
slave java.1.gz: /usr/lib/jvm/java-6-openjdk/jre/man/man1/java.1.gz
Current 'best' version is '/usr/lib/jvm/java-6-openjdk/jre/bin/java'.

root@vm11:~# dpkg -S /usr/lib/jvm/java-6-openjdk/jre/bin/java
openjdk-6-jre-headless: /usr/lib/jvm/java-6-openjdk/jre/bin/java

root@vm11:~# apt-cache policy openjdk-6-jre-headless
openjdk-6-jre-headless:
Installed: 6b18-1.8.7-2~squeeze1
Candidate: 6b18-1.8.7-5
Version table:
6b18-1.8.7-5 0
500 http://192.168.122.1/ftp.uk.debian.org/debian/ unstable/main
amd64 Packages
500 http://192.168.122.1/ftp.uk.debian.org/debian/ testing/main
amd64 Packages
*** 6b18-1.8.7-2~squeeze1 0
500 http://192.168.122.1/ftp.uk.debian.org/debian/ squeeze/main
amd64 Packages
500 http://security.debian.org/ squeeze/updates/main amd64 Packages
100 /var/lib/dpkg/status

> I have a VM running Jenkins 1.418 on Debian x86_64. I've cloned this VM,
> stopped Jenkins, changed HTTP_PORT in /etc/default/jenkins to 8081 and
> started it again. Now Jenkins is responding on
> http://192.168.122.31:8081/, so it works.

--
Mykola

Reply all
Reply to author
Forward
0 new messages