2

I'm trying to trigger a job in Jenkins from java server. Jenkins is running on port 80 but when the Preemptive Auth is executing then creds are null because port returning as -1

if (authScheme != null) {
                creds =
                        credsProvider.getCredentials(new AuthScope(
                                targetHost.getHostName(),
                                targetHost.getPort()));
                if (creds == null) {
                    throw new HttpException("No credentials for preemptive authentication");
                }

I saw this link on how to change the port that jenkins is using and also this link2 that explain that when not using a port (because of using https) it should be set to -1.

in the server there is a properties file that holds the Jenkins URL. after editing it to specific call port 80 (instead of just dropping it) then the trigger executed, but because of a mechanism that checking the job status (that it finish running) the next call is getting failed because the port is -1.

is there a way to see the port before changing? what else can I missed?

Community
  • 1
  • 1
soninob
  • 428
  • 11
  • 22

1 Answers1

1

There is a definition of Jenkins URL in Jenkins management, what is the value there? with port 80?

Davai
  • 36
  • 4
  • 1
    Nice catch, there was no port 80 there, so I add it, but still the second call is getting -1. Maybe it will help other though – soninob Sep 04 '14 at 08:50