# JAVA gRPC request error to DAML Hub

**URL:** <https://forum.canton.network/t/java-grpc-request-error-to-daml-hub/3804>\
**Category:** App Development\
**Tags:** damlhub\
**Created:** [January 27, 2022, 8:17pm UTC](https://forum.canton.network/t/java-grpc-request-error-to-daml-hub/3804 "2022-01-27T20:17:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![RyanMedlen](https://avatars.discourse-cdn.com/v4/letter/r/a587f6/32.png) [@RyanMedlen](https://forum.canton.network/u/RyanMedlen)\
**Post date:** [January 27, 2022, 8:17pm UTC](https://forum.canton.network/t/java-grpc-request-error-to-daml-hub/3804/1 "2022-01-27T20:17:19Z")

</div>

I have the IOU sample app deployed to DAML Hub and am trying to use the Java app to interact with it. I am getting a error of “io.grpc.StatusRuntimeException: PERMISSION\_DENIED: An error occurred. Please contact the operator and inquire about the request ” when it tries to make this request

> client  
> .getActiveContractSetClient()  
> .getActiveContracts(iouFilter, true)  
> .blockingForEach(  
> response → {  
> response  
> .getOffset()  
> .ifPresent(offset → acsOffset.set(new LedgerOffset.Absolute(offset)));  
> response.getCreatedEvents().stream()  
> .map(Iou.Contract::fromCreatedEvent)  
> .forEach(  
> contract → {  
> long id = idCounter.getAndIncrement();  
> contracts.put(id, contract.data);  
> idMap.put(id, contract.id);  
> });  
> });

I am connecting as is suggested in another post and it is connecting fine -

> DamlLedgerClient client =  
> DamlLedgerClient.newBuilder(ledgerhost, ledgerport)  
> // use the roots of trust already present on the system,  
> // ledgers running on \*.daml.app domains use certs  
> // provided by Let’s Encrypt  
> .withSslContext(GrpcSslContexts.forClient().build())  
> // on Daml Hub, you will still need an access token;  
> // it can be supplied here or per operation  
> .withAccessToken(accessToken)  
> .build();

My thought is maybe I need to pass the access token on the request as well? I am not finding in the documentation how to try that though.

---

<div class="post-metadata">

**Author:** ![cocreature](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/cocreature/32/36_2.png) [@cocreature](https://forum.canton.network/u/cocreature)\
**Post date:** [January 27, 2022, 8:41pm UTC](https://forum.canton.network/t/java-grpc-request-error-to-daml-hub/3804/2 "2022-01-27T20:41:51Z")

</div>

Hi @RyanMedlen,

I just tested using the Iou sample app on Daml hub using your modifications and it works fine for me.

What I suspect is happening is that you are running as party `Alice` which is the default in the sample app. Daml hub on the other hand allocates different party identifiers so your token is for a different party than `Alice` and your request fails.

To fix that you can edit the party in `pom.xml` or pass it directly on the command line, e.g.

```haskell
mvn compile exec:java@run-quickstart -Dparty=ledger-party-youruuidhere

```

You can find your actual party id in the Daml hub console where you also got your access token.

---

<div class="post-metadata">

**Author:** ![RyanMedlen](https://avatars.discourse-cdn.com/v4/letter/r/a587f6/32.png) [@RyanMedlen](https://forum.canton.network/u/RyanMedlen)\
**Post date:** [January 27, 2022, 9:05pm UTC](https://forum.canton.network/t/java-grpc-request-error-to-daml-hub/3804/3 "2022-01-27T21:05:07Z")

</div>

That was exactly it. Thanks for the help.
