I need to know the mechanisms and flow for starting up Hudson, so I can figure out what's wrong. When you type in
nohup java -jar $HUDSON_WAR > $HUDSON_LOG 2>&1 &
(using real values for those variables, of course), what exactly happens? I've been a software engineer for 10+ years but mostly in embedded, and web services are out of my domain. I don't think it makes a difference, but I'm running Hudson on RHEL 5. It's not using tomcat or apache; it's running as a standalone service. What files are accessed and why?
Here are the specifics of the failure: I downloaded a plugin and after it had finished downloading I stopped and then restarted hudson, as I've done many times before. This time, however, when I try to access the Hudson main page, I get
Error 404
Exception:
Stacktrace:
(none)
I suspected a permissions issue since I noticed some of the things in HUDSON_HOME were owned by root, so I recursively chown and chgrp'd that directory to make hudson own it all. That has not fixed the problem. I tried restoring the previous hudson.war but got the same behavior. One thing I notice is that right after I start it, if I go to the web page, I see Hudson's "starting up" page, and then it switches to the Error 404. I tried starting Hudson with a different port number and got the same behavior. I have no problem accessing a web interface to source control on the same server.
Update: I still suspect a permissions issue. It's possible the last person to restart Hudson did so as root.
Update[2]: Excerpt from hudson.log:
[Winstone 2010/10/21 16:05:17] - Beginning extraction from war file
hudson home directory: /home/hudson
[Winstone 2010/10/21 16:05:17] - HTTP Listener started: port=8080
[Winstone 2010/10/21 16:05:17] - AJP13 Listener started: port=8009
Using one-time self-signed certificate
[Winstone 2010/10/21 16:05:17] - Error starting listener instance
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:44)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:516)
at winstone.Launcher.spawnListener(Launcher.java:232)
at winstone.Launcher.<init>(Launcher.java:205)
at winstone.Launcher.main(Launcher.java:391)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:600)
at Main.main(Main.java:200)
Caused by: java.lang.NoClassDefFoundError: sun.security.x509.CertAndKeyGen
at winstone.ssl.HttpsListener.<init>(HttpsListener.java:111)
... 12 more
Caused by: java.lang.ClassNotFoundException: sun.security.x509.CertAndKeyGen
at java.lang.ClassNotFoundException.<init>(ClassNotFoundException.java:77)
at java.net.URLClassLoader.findClass(URLClassLoader.java:385)
at java.lang.ClassLoader.loadClass(ClassLoader.java:653)
at java.lang.ClassLoader.loadClass(ClassLoader.java:619)
... 13 more