artifactory-client-java icon indicating copy to clipboard operation
artifactory-client-java copied to clipboard

404 error when calling artifactory.security() or artifactory.system()

Open Absh-Day opened this issue 11 months ago • 0 comments

I am working on creating a jenkins script, that can access artifactory Rest API (version: 7.84.17) Following examples from README, when I make rest calls like:

 ArtifactoryRequest repositoryRequest = new ArtifactoryRequestImpl().apiUrl("access/api/v1/tokens")
        .method(ArtifactoryRequest.Method.GET)
        .responseType(ArtifactoryRequest.ContentType.JSON);
ArtifactoryResponse response = artifactory.restCall(repositoryRequest);
println response.getRawBody()

I get expected response, but when I try to access anything via artifactory.security() or artifactory.system() it always gives me

org.apache.http.client.HttpResponseException: status code: 404, reason phrase: 404 page not found

	at org.jfrog.artifactory.client.impl.ArtifactoryImpl.newHttpResponseException(ArtifactoryImpl.java:257)
	at org.jfrog.artifactory.client.impl.ArtifactoryImpl.get(ArtifactoryImpl.java:287)
	at org.jfrog.artifactory.client.impl.ArtifactoryImpl.get(ArtifactoryImpl.java:270)
	at org.jfrog.artifactory.client.Artifactory$get$0.call(Unknown Source)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:144)
	at org.jfrog.artifactory.client.impl.SecurityImpl.userNames(SecurityImpl.groovy:41)
	at org.jfrog.artifactory.client.Security$userNames.call(Unknown Source)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:120)
	at Script1.run(Script1.groovy:14)

Even system().ping() system().version().getVersion() isn't working. I have tried admin scope token and even admin's identity token but its same result. Can someone please help?

Absh-Day avatar Feb 21 '25 09:02 Absh-Day