# Fixing "401 Unauthorized" Error on /gw After Upgrading to io\\.Connect Desktop 10

**URL:** <https://community.interop.io/t/fixing-401-unauthorized-error-on-gw-after-upgrading-to-io-connect-desktop-10/797>\
**Category:** io.Connect Desktop\
**Created:** [November 26, 2026, 2:52pm UTC](https://community.interop.io/t/fixing-401-unauthorized-error-on-gw-after-upgrading-to-io-connect-desktop-10/797 "2026-11-26T14:52:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![BShopov](https://yyz2.discourse-cdn.com/flex028/user_avatar/community.interop.io/bshopov/32/384_2.png) [@BShopov](https://community.interop.io/u/BShopov)\
**Post date:** [November 26, 2026, 2:52pm UTC](https://community.interop.io/t/fixing-401-unauthorized-error-on-gw-after-upgrading-to-io-connect-desktop-10/797/1 "2026-11-26T14:52:30Z")

</div>

## Summary

After you upgrade to io.Connect Desktop 10, an app that you start **outside** io.Connect Desktop can fail to connect to `ws://127.0.0.1:8385/gw` with **401 Unauthorized**. Typical ways to start an app outside the platform are an IDE, a debugger, a script, a scheduled task or a command line. The same app connected without problems on io.Connect Desktop 9.

A typical error from the Java SDK:

```auto
GatewayWebSocketConnection-1(ws://127.0.0.1:8385/gw) state changed to Disconnected
(Failed to upgrade to websocket: Unexpected HTTP Response Status Code: 401 Unauthorized)

```

**Why it happens:** io.Connect Desktop 10 ships a new Gateway, which accepts connections only on its configured route, the root path `/` by default. The io.Connect Desktop 9 Gateway accepted any path, including `/gw`. The error says _Unauthorized_, but the cause is the path, not your credentials. Changing the user name or password doesn’t help.

**Who is affected:** only apps started outside io.Connect Desktop. Apps that io.Connect Desktop starts receive the correct Gateway URL from the platform and need no changes. This covers apps started from the launcher, as auto-start apps, or through the App Management API.

**Fix:** connect to `ws://127.0.0.1:8385`, which works with both io.Connect Desktop 9 and 10. For Java apps, also upgrade java-glue42 to 1.7.0 or later.

## 1. Confirm that this is your issue

1. Check how the app was started. If io.Connect Desktop started it, this article doesn’t apply.
2. Find the Gateway URL that the app uses. Java apps on java-glue42 **earlier than 1.7.0** use `ws://127.0.0.1:8385/gw` by default.
3. If the URL ends in `/gw`, continue with step 2.

> **Gateway port:** the Gateway listens on port `8385` by default. If your deployment sets a different port in `gw.configuration.port` in `system.json`, use that port in every example below.

## 2. Change the Gateway URL to the root path

Remove `/gw` from the URL:

| Before | After |
| --- | --- |
| `ws://127.0.0.1:8385/gw` | `ws://127.0.0.1:8385` |

The new URL also works with io.Connect Desktop 9, so you can roll it out before the upgrade.

**Java apps:** set the URL in one of these places.

- In `glue.conf` on the app’s classpath (for Maven or Gradle: `src/main/resources`):

```auto
glue {
    gateway.url: "ws://127.0.0.1:8385"
}

```

- As a JVM system property:

```auto
-Dglue.gateway.url=ws://127.0.0.1:8385

```

> **Running more than one io.Connect Desktop instance** (for example, UAT and PROD)? Each instance has its own Gateway port, so use the port of the instance the app should join. If the app uses io.Connect window management (sticky windows), also set that instance’s environment and region. Otherwise its windows can attach to the wrong instance. Take all three values from that instance’s `system.json` (`gw.configuration.port`, `env`, `region`):
> 
> ```auto
> -Dglue.gateway.url=ws://127.0.0.1:<PORT> -Dglue.environment=<ENV> -Dglue.region=<REGION>
> 
> ```

## 3. Java apps: upgrade java-glue42

Upgrade to java-glue42 **1.7.0 or later**. We recommend the latest version, 1.8.0 at the time of writing:

```html
<dependency>
    <groupId>com.glue42</groupId>
    <artifactId>java-glue42-shaded</artifactId>
    <version>1.8.0</version>
</dependency>

```

What 1.7.0 changes:

- **1.7.0 adds support for path updates on the io.Connect Desktop 10 Gateway.** Earlier versions connect once you fix the URL, but they treat path updates as unsupported: `contexts().updatePaths(...)` does nothing and reports no error, and `Context.updatePaths(...)` fails with `ContextPathsNotSupportedException`. Other context operations, such as `update()` and `reset()`, work.
- **From 1.7.0, the default Gateway URL is** `ws://127.0.0.1:8385/`, so a Java app that doesn’t set a URL works with io.Connect Desktop 9 and 10 on port 8385.

A URL set in `glue.conf` or as a system property overrides the default. If your app sets one, make sure it doesn’t end in `/gw`.

## 4. Verify the fix

Start the app outside io.Connect Desktop again and check that:

- The app log shows no `401 Unauthorized` error.
- The app appears in io.Connect Desktop and can use its APIs, such as Interop methods and shared contexts.
- **Java apps:** the log shows `state changed to Connected`. Don’t rely on `Glue.builder().build()` returning, because it returns even when the connection fails.

## If you can’t change the app

As a temporary measure, you can configure the io.Connect Desktop 10 Gateway to listen on `/gw` again. Set the Gateway `route` in `system.json`:

```json
{
    "gw": {
        "configuration": {
            "route": "/gw"
        }
    }
}

```

Contact interop.io support before you use this setting in production.

Before you use this, be aware of the following:

- **The Gateway then accepts connections** on `/gw` only. Apps started outside io.Connect Desktop that connect on the root URL stop working and fail with `Unexpected HTTP Response Status Code: 200 OK`. This includes java-glue42 1.7.0 or later when it uses its default URL.
- Apps that io.Connect Desktop starts aren’t affected, because they receive the Gateway URL from the platform.
- It moves your deployment away from the platform defaults, which adds work on future upgrades. Test all your apps after the change.

Updating the app’s URL (step 2) is the long-term fix.

## Related

- [Interop-enable your apps: Java (changelog 1.7.0: default Gateway URL change)](https://docs.interop.io/desktop/getting-started/how-to/interop-enable-your-apps/java/index.html#changelog-17-170)
- [Configuration: System (Gateway settings and default port)](https://docs.interop.io/desktop/developers/configuration/system/index.html)
