Pass credentials to Jenkins slave agent

485 views
Skip to first unread message

Don McNamara

unread,
Jan 23, 2012, 6:16:36 PM1/23/12
to Jenkins Users
Hi,

I'm trying to run a Jenkins slave on a Windows server. The Jenkins
master has security enabled.

If I connect with the browser, log in, and then launch the slave
agent, it works fine.

However, when I try to run the slave agent using either of the command
line options, it fails with a 403 permission denied error.

How can I pass the username/password to the slave agent code?

java -jar slave.jar -jnlpUrl http://myserver/computer/jobname/slave-agent.jnlp
[-username ? -password ? ]

Really, what I want to do is run it as a service and the service is
failing. It looks like the service is just attempting and failing to
run the command line above.

Thanks,
Don

Don McNamara

unread,
Jan 23, 2012, 11:25:28 PM1/23/12
to Jenkins Users
Okay, I found the -jnlpCredentials option, but I'm getting an
exception.

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/
commons/codec/binary/Base64
at hudson.remoting.Launcher.parseJnlpArguments(Launcher.java:221)
at hudson.remoting.Launcher.run(Launcher.java:192)
at hudson.remoting.Launcher.main(Launcher.java:168)
Caused by: java.lang.ClassNotFoundException:
org.apache.commons.codec.binary.Base64
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)

I haven't worked with Java in a very long time. Do I need to download
something? Do I need a classpath?

Thanks,
Don


On Jan 23, 6:16 pm, Don McNamara <don.mcnam...@gmail.com> wrote:
> Hi,
>
> I'm trying to run a Jenkins slave on a Windows server. The Jenkins
> master has security enabled.
>
> If I connect with the browser, log in, and then launch the slave
> agent, it works fine.
>
> However, when I try to run the slave agent using either of the command
> line options, it fails with a 403 permission denied error.
>
> How can I pass the username/password to the slave agent code?
>
> java -jar slave.jar -jnlpUrlhttp://myserver/computer/jobname/slave-agent.jnlp
Reply all
Reply to author
Forward
0 new messages