Bug 1274318

Summary: Remote Java client should provide meaningful unauthorized error message
Product: [Retired] JBoss BPMS Platform 6 Reporter: Kris Verlaenen <kverlaen>
Component: Business CentralAssignee: Shelly McGowan <smcgowan>
Status: CLOSED EOL QA Contact: Lukáš Petrovický <lpetrovi>
Severity: medium Docs Contact:
Priority: high    
Version: 6.1.0   
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-03-27 20:13:27 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Kris Verlaenen 2015-10-22 13:26:57 UTC
In 6.2, a new rest-all role is required to access the REST remote API (and therefor also the remote Java client through REST).  The remote Java client should give a meaningful error message if the user isn't authorized. In 6.2.0.ER4, it is returning:

org.kie.remote.client.api.exception.RemoteCommunicationException: Unable to retrieve content from response
        at org.kie.services.client.api.command.AbstractRemoteCommandObject.execu
teRestCommand(AbstractRemoteCommandObject.java:425)
        at org.kie.services.client.api.command.AbstractRemoteCommandObject.execu
teCommand(AbstractRemoteCommandObject.java:159)
        at org.kie.services.client.api.command.KieSessionClientCommandObject.sta
rtProcess(KieSessionClientCommandObject.java:276)
        at com.redhat.bpms.examples.mortgage.CreateProcesses.populateSamples(Cre
ateProcesses.java:57)
        at com.redhat.bpms.examples.mortgage.CreateProcesses.main(CreateProcesse
s.java:47)
Caused by: org.kie.remote.common.rest.KieRemoteHttpRequestException: Unable to r
etrieve input stream of response
        at org.kie.remote.common.rest.KieRemoteHttpRequest.responseStream(KieRem
oteHttpRequest.java:1378)
        at org.kie.remote.common.rest.KieRemoteHttpRequest.responseBuffer(KieRem
oteHttpRequest.java:1396)
        at org.kie.remote.common.rest.KieRemoteHttpRequest.responseBody(KieRemot
eHttpRequest.java:1338)
        at org.kie.remote.common.rest.KieRemoteHttpRequest.access$2100(KieRemote
HttpRequest.java:117)
        at org.kie.remote.common.rest.KieRemoteHttpRequest$5.body(KieRemoteHttpR
equest.java:1304)
        at org.kie.services.client.api.command.AbstractRemoteCommandObject.execu
teRestCommand(AbstractRemoteCommandObject.java:407)
        ... 4 more
Caused by: java.net.HttpRetryException: cannot retry due to server authenticatio
n, in streaming mode
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLCo
nnection.java:1637)
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCon
nection.java:1440)
        at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:480
)
        at org.kie.remote.common.rest.KieRemoteHttpRequest.responseCode(KieRemot
eHttpRequest.java:1318)
        at org.kie.remote.common.rest.KieRemoteHttpRequest.post(KieRemoteHttpReq
uest.java:719)
        at org.kie.services.client.api.command.AbstractRemoteCommandObject.execu
teRestCommand(AbstractRemoteCommandObject.java:362)
        ... 4 more