-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
Jenkins 1.572 and lower
Hi. This code:
DescriptorExtensionList<SCM, SCMDescriptor<?>> desc = SubversionSCM.all();
DescriptorImpl ss = (DescriptorImpl) desc.get(DescriptorImpl.class);
StringWriter log = new StringWriter();
PrintWriter logWriter = new PrintWriter(log);
UserProvidedCredential upc =
new UserProvidedCredential(user, password, null,
request.findAncestorObject(AbstractProject.class));
ss.postCredential(url[0], upc, logWriter);
causes:
Caused by: java.lang.NullPointerException
at hudson.scm.SubversionSCM$DescriptorImpl$1.onSuccess(SubversionSCM.java:2249)
at hudson.scm.UserProvidedCredential$AuthenticationManagerImpl.acknowledgeAuthentication(UserProvidedCredential.java:233)
at org.tmatesoft.svn.core.auth.BasicAuthenticationManager.acknowledgeAuthentication(BasicAuthenticationManager.java:56)
at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection._request(HTTPConnection.java:749)
at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:382)
In:
public void postCredential(String url, final UserProvidedCredential upc, PrintWriter logWriter) throws SVNException, IOException {
SVNRepository repository = null;
try {
// the way it works with SVNKit is that
// 1) svnkit calls AuthenticationManager asking for a credential.
// this is when we can see the 'realm', which identifies the user domain.
// 2) DefaultSVNAuthenticationManager returns the username and password we set below
// 3) if the authentication is successful, svnkit calls back acknowledgeAuthentication
// (so we store the password info here)
repository = SVNRepositoryFactory.create(SVNURL.parseURIDecoded(url));
repository.setTunnelProvider( createDefaultSVNOptions() );
AuthenticationManagerImpl authManager = upc.new AuthenticationManagerImpl(logWriter) {
@Override
protected void onSuccess(String realm, Credential cred)
};
authManager.setAuthenticationForced(true);
repository.setAuthenticationManager(authManager);
repository.testConnection();
authManager.checkIfProtocolCompleted();
} finally
}
Because:
credentials is null in "credentials.put(realm, cred);" statement.
version 1.54 works fine