# Cannot exercise contract with Java API to DAML Hub

**URL:** <https://forum.canton.network/t/cannot-exercise-contract-with-java-api-to-daml-hub/6023>\
**Category:** App Development\
**Tags:** damlhub\
**Created:** [January 24, 2023, 10:17pm UTC](https://forum.canton.network/t/cannot-exercise-contract-with-java-api-to-daml-hub/6023 "2023-01-24T22:17:17Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Mate\_Varga](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/mate_varga/32/2308_2.png) [@Mate\_Varga](https://forum.canton.network/u/Mate_Varga)\
**Post date:** [January 25, 2023, 7:08am UTC](https://forum.canton.network/t/cannot-exercise-contract-with-java-api-to-daml-hub/6023/2 "2023-01-25T07:08:34Z")

</div>

Hi @mundacho,

Could you please confirm that you are using the same application ID in both your token and the command submission? The only SubmitAndWait submission that I could find in the logs fail with:

```haskell
PERMISSION_DENIED(7,0): Claims are only valid for applicationId 'damlhub', actual applicationId is 'toplBrokerApp'

```

When a command fails, you usually get a rejection (either an error, or timing out), you should implement at least logging of these rejections/responses.

---

_[View the full topic](https://forum.canton.network/t/cannot-exercise-contract-with-java-api-to-daml-hub/6023)._
