## 500: Missing xs-app.json in HTML5 application repository when reading an HTML5 application file from the application router
| Issue    | Serving content from the application router fails with error "Application does not have xs-app.json".          |
|----------|----------------------------------------------------------------------------------------------------------------|
| Cause    | xs-app.json file is missing in HTML5 Application.                                                              |
| Solution | Redeploy the HTML5 Application with xs-app.json file or ask the business service owner to add the xs-app.json. |
## Bearer token invalid
| Term     | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
|----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Issue    | The app-router token exchange with a business service token fails. XSUAA returns the following error: "Bearer token invalid, requesting client does not have grant_type=user_to- ken or no scopes were granted."                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| Cause    | The uaa.user scope in XSUAA instance configuration is miss- ing or the target business service is not subscribed.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| Solution | 1. If missing, add the following to the n xs- security.json file: "scopes": [ { "name": "uaa.user", "description": "UAA" }], "role-templates": [ {"name": "Token_Exchange","de- scription": "UAA","scope-references": ["uaa.user"] } ] 2. Redeploy or update the XSUAA service instance. 3. Make sure that the users have the new role_template, Token_Exchange added to their role_collections in the SAP BTP cockpit Global Account Subaccount Security Role Collections and verify that the cre- ated role's Application Identifier is the same as the xsappname from the xs-security.json. 4. If the roles of the target business service does not ap- pear on the subscriber tenant UI, it means that the tar- get business service subscription failed or it was bound to the application router after the subscription took place. In this case, try to unsubscribe and subscribe again. Make sure that the target business service roles appear on subscriber tenant UI. |
## Caching issue in browser
Term
Issue
Cause
Description
Your application does not work properly after logging out and when you try to log back in, for example, click anywhere
on the application screen, nothing happens.
The main page of your application, that appears after you log in, is cached by the browser. Clicking links does not reach
the backend (application router) and the log in process does not work.
Solution
## Description
Check that the main page is not configured to be cached by the browser in your xs-app.json file. The best practice is to model the cacheControl as follows:
```
{ "routes": [ { "source": "^/ui/index.html", "target": "index.html", "service": "html5-apps-repo-rt", "authenticationType": "xsuaa" "cacheControl": "no-cache, nostore, must-revalidate" } ] }
```
## Running application router after subscribing to it fails
| Term     | Description                                                                                                                                                                                                                                                                                                                                                                |
|----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Issue    | After subscribing to the application router using <subdomain>-<myapprouter>.<scp domain> for- mat, it fails and returns the following error, "route not found."                                                                                                                                                                                                            |
| Cause    | In order to support subscriptions out-of-the-box, create a route using *.<custom-domain> format and map it to the application router. The * host represents a wildcard that during runtime should be replaced by the actual sub- scriber sub-domain. Without a custom domain, this type of route (wildcard host) cannot be created, only a fixed host can be used. Without |
| Solution | If you do not have a custom domain before subscribing to the application router, create a route with the expected sub- scriber sub-domain.                                                                                                                                                                                                                                 |
If the lists don't not contain a solution for your issue, you can create an incident in the SAP Support Portal. For more information, see Getting Support [page 521].
## Related Information
Getting Support [page 521]