Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "PTL-1296: move troubleshooting section in IntelliJ plugin" #1669

Merged
merged 1 commit into from
May 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ item(name = "GenesisKey", value = System.getenv("GENESIS_KEY"))

**DEPLOYED_PRODUCT**: This specifies that the product's generated code is bundled in the product's distribution. This means that remap can skip the code-generation step. This property's value should be the name of the product. To bundle the generated code into the distribution, see [here](../../../database/fields-tables-views/genesisDao/#bundling-generated-code-with-product-distribution).

If you want to enable SSL for your process communication, this is done in the [service definition](../../../server/configuring-runtime/service-definitions/#enabling-ssl-for-processes).
If you want to enable SSL for your process communication, this is done in the [service definition](../../../server/configuring-runtime/service-definitions/#enable-ssl-for-processes).

## Setting system-definition values from environment variables

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ Let's have a look at the different options for configuring this file. You have s

`dataserverPollingTimeout` This setting contains the timeout (in seconds) to expire inactive dataserver subscriptions. Subscription inactivity is determined by the lack of HTTP requests from the client targeting a specific Data Server subscription. Default value is 60 seconds.

`authDisabled` This is a dangerous setting! If set to true, it disables all authentication on the router. Typically, it is used for development mode. If you need to use this for another reason, see our section on [non-authenticated Genesis Routers](../../../server/configuring-runtime/genesis-router/#non-authenticated-routers). Default value is false.
`authDisabled` This is a dangerous setting! If set to true, it disables all authentication on the router. Typically, it is used for development mode. If you need to use this for another reason, see our section on [non-authenticated Genesis Routers](../../../server/configuring-runtime/genesis-router/#non-authenticated-routers/). Default value is false.

`nettyLoggingEnabled` If set to true, this setting enables internal netty logging. Default value false.

Expand Down
106 changes: 17 additions & 89 deletions docs/03_server/12_tooling/02_intellij-plugin.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,23 @@ The Genesis Intellij Plugin enables you to run the full stack of a Genesis appli
![Genesis Tool Window](/img/intellij-plugin/genesis-tool-window.png)

:::tip
If the tool window does not appear in a Genesis project, take a look at the [troubleshooting](#troubleshooting) section.
If the tool window does not appear in a Genesis project, please make sure that you have opened the correct folder.
The plugin will expect your project to have a folder called **server**; it checks the **settings.gradle.kts** file in
that folder for Genesis dependencies:
```
my project/
├─ client/
├─ server/
│ ├─ setting.gradle.kts
```
Sometimes, especially when opening a project extracted from a zip file, there might be a nested project folder:
```
my project/ <-- don't open this folder
├─ my project/ <-- open this folder
│ ├─ client/
│ ├─ server/
│ │ ├─ setting.gradle.kts
```
:::

3. For MacOs specifically, you need to install LMDB locally to start a Genesis data server.
Expand Down Expand Up @@ -195,10 +211,6 @@ To clean up the UI, use the **Services** window for better organisation (only av

### Starting the back end

:::tip
If you have issues starting services, take a look at the [troubleshooting](#troubleshooting) section.
:::

To start all services, click on **Start All Services**.
You can start specific services from the mon Window, and from the Intellij Run Config list:

Expand Down Expand Up @@ -470,87 +482,3 @@ If you are changing a Genesis or Business Component dependency:

1. Click on the **Prepare Local Genesis Application** button.
2. Run **remap**.

## Troubleshooting

### Make sure you have the correct folder

The plugin is only displayed when you have a Genesis project open in IntelliJ.

If the tool window does not appear in a Genesis project, make sure that you have opened the correct folder.
The plugin expects your project to have a folder called **server**; it checks the **settings.gradle.kts** file in
that folder for Genesis dependencies:
```
my project/
├─ client/
├─ server/
│ ├─ setting.gradle.kts
```
Sometimes, especially when opening a project extracted from a zip file, there might be a nested project folder:
```
my project/ <-- don't open this folder
├─ my project/ <-- open this folder
│ ├─ client/
│ ├─ server/
│ │ ├─ setting.gradle.kts
```

### Make sure you have a compatible JVM

In the IntelliJ menu, go to the Project Structure; click on **File** and then **project structure**.
From there, you can set your projects SDK.

- Do **NOT** use Correto 20.
- GraalVm or OpenJDK are good options.

![Gradle Settings](/img/intellij-plugin/intellij-sdk-settings.png)

### Make sure gradle is set to use the Project SDK

1. Open your IntelliJ Settings.
2. Search for **gradle** in the search box.
3. Go to the **Gradle JVM** setting; make sure this is set to **Project SDK**:

![Gradle Settings](/img/intellij-plugin/intellij-settings-gradle.png)

### Process fails to start

If the process fails to start, shows DOWN, and the log exception says **address already in use**:

```log
zeroMQ failed to bind socket to address 'tcp://*:18001', exiting due to critical error.
```

This indicates that 18001 port on your local machine is in use. Most of the time when this happens, it is due to an error in the process; sometimes it does not “giving up” the port when it stops.

The remedy for this if you are using MacOs is:

1. `netstat -vanp tcp | grep *affected port*`

This will output anything associated with the port. Take note of the LISTEN line

```shell
genesis.user@MACBOOK34 simple-create-demo-new % netstat -vanp tcp | grep 18001
tcp4 0 0 192.168.0.50.18001 192.168.0.50.61373 ESTABLISHED 408193 146988 70265 0 00102 00000004 0000000000ebf6f5 20000080 01000800 2 0 000005
tcp4 0 0 192.168.0.50.61373 192.168.0.50.18001 ESTABLISHED 408209 146988 71785 0 00102 00000000 0000000000ebf6f3 20000080 04000800 2 0 000005
tcp4 0 0 192.168.0.50.18001 192.168.0.50.60421 ESTABLISHED 408135 146988 70265 0 00102 00000004 0000000000ebee98 20000080 01000800 2 0 000005
tcp4 0 0 192.168.0.50.60421 192.168.0.50.18001 ESTABLISHED 408209 146988 71778 0 00102 00000000 0000000000ebee97 20000080 04000800 2 0 000005
tcp4 0 0 192.168.0.50.18001 192.168.0.50.60099 ESTABLISHED 407981 146988 70265 0 00102 00000004 0000000000ebebcd 20000080 01000800 2 0 000005
tcp4 0 0 192.168.0.50.60099 192.168.0.50.18001 ESTABLISHED 408209 146988 71774 0 00102 00000000 0000000000ebebcb 20000080 04000800 2 0 000005
tcp4 0 0 192.168.0.50.18001 192.168.0.50.58063 ESTABLISHED 408175 146988 70265 0 00102 00000004 0000000000ebdac8 20000080 01000800 2 0 000005
tcp4 0 0 192.168.0.50.58063 192.168.0.50.18001 ESTABLISHED 408209 146988 71763 0 00102 00000000 0000000000ebdac7 20000080 04000800 2 0 000005
tcp4 0 0 192.168.0.50.18001 192.168.0.50.57375 ESTABLISHED 408171 146988 70265 0 00102 00000004 0000000000ebd4be 20000080 01000800 2 0 000005
tcp4 0 0 192.168.0.50.57375 192.168.0.50.18001 ESTABLISHED 408209 146988 71773 0 00102 00000000 0000000000ebd4bc 20000080 04000800 2 0 000005
tcp4 0 0 192.168.0.50.18001 192.168.0.50.55365 ESTABLISHED 408178 146988 70265 0 00102 00000004 0000000000ebc42e 20000080 01000800 2 0 000005
tcp4 0 0 192.168.0.50.55365 192.168.0.50.18001 ESTABLISHED 408209 146988 71762 0 00102 00000000 0000000000ebc42d 20000080 04000800 2 0 000005
tcp4 0 0 192.168.0.50.18001 192.168.0.50.53163 ESTABLISHED 407986 146988 70265 0 00102 00000004 0000000000ebb096 20000080 01000800 2 0 000005
tcp4 0 0 192.168.0.50.53163 192.168.0.50.18001 ESTABLISHED 408209 146988 71758 0 00102 00000000 0000000000ebb095 20000080 04000800 2 0 000005
tcp4 0 0 192.168.0.50.18001 192.168.0.50.52489 ESTABLISHED 408184 146988 70265 0 00102 00000004 0000000000ebab9f 20000080 01000800 2 0 000005
tcp4 0 0 192.168.0.50.52489 192.168.0.50.18001 ESTABLISHED 408209 146988 71759 0 00102 00000000 0000000000ebab9e 20000080 04000800 2 0 000005
tcp4 0 0 192.168.0.50.18001 192.168.0.50.63839 ESTABLISHED 408145 146988 70265 0 00102 00000004 0000000000e8c707 20000080 01000800 2 0 000005
tcp4 0 0 192.168.0.50.63839 192.168.0.50.18001 ESTABLISHED 408209 146988 70265 0 00102 00000000 0000000000e8c705 20000080 04000800 2 0 000005
tcp46 0 0 *.18001 *.* LISTEN 131072 131072 70265 0 00100 00000006 0000000000e8b4a6 00000000 00000800 1 0 000001
genesis.user@MACBOOK34 simple-create-demo-new % kill -9 70265
```

2. From the LISTEN line, take the PID of the process (in example below, this is 70265) and run `kill -9 *pid of LISTEN process*`.
8 changes: 4 additions & 4 deletions docs/03_server/13_api-reference/04_network-api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ class TestAuthManagerService(@Inject val clientConnectionManager: ClientConnecti
}
```

### Constructor
### Constructor[​](../../../server/api-reference/network-api/#constructordirect-link-to-heading)

GenesisMessageClient(address: String, port: Int, secure: Boolean, configuration: NetworkConfiguration)

### Functions
### Functions[​](../../../server/api-reference/network-api/#functionsdirect-link-to-heading)

| Name | Signature |
| --- | --- |
Expand Down Expand Up @@ -93,11 +93,11 @@ class TestAuthManagerService(@Inject val clientConnectionManager: ClientConnecti
}
```

## GenesisMessageHandler
## GenesisMessageHandler[​](../../../server/api-reference/network-api/#genesismessagehandlerdirect-link-to-heading)

GenesisMessageHandler enables you to attach listeners to servers and clients.

### Functions
### Functions[​](../../../server/api-reference/network-api/#functionsdirect-link-to-heading-1)

| Name | Signature |
| --- | --- |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ tags:

In this page, we look at details of the functions that enable you to interact with the Genesis services that can be specified in the [service-definition.xml](../../../getting-started/learn-the-basics/key-system-files/genesis-system-definitions/) file.

Functions
Functions[​](../../../server/api-reference/service-provider-api/#functionsdirect-link-to-heading)
------------------------------------------------------------------------------------------------------------------------------------

| Name | Signature | Description |
| --- | --- | --- |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ You can access system definition properties in two ways:
- using existing APIs
- using @Named Genesis annotation

## Using existing APIs
## Using existing APIs[​](../../../server/api-reference/system-definition-api/#using-existing-apisdirect-link-to-heading)
-----------------------------------------------------------------------------------------------------------------------------------------------

| name | signature |
| --- | --- |
Expand Down Expand Up @@ -62,7 +63,8 @@ You can access system definition properties in two ways:
| parseProperty | `static <T, R> Optional<R> parseProperty(Supplier<Optional<T>> property, Predicate<? super T> canBeTransformed, Function<? super T, ? extends R> transformer)` |
| parseStringProperty | `static <R> Optional<R> parseStringProperty(Supplier<Optional<String>> property, Function<? super String, ? extends R> transformer)` |

## Using @Named genesis annotation
## Using @Named genesis annotation[​](../../../server/api-reference/system-definition-api/#using-named-genesis-annotationdirect-link-to-heading)
----------------------------------------------------------------------------------------------------------------------------------------------------------------------

### Injectable properties from system definition
Here is an example of a **genesis-system-definition.kts** file:
Expand Down
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ then the generated ID will be `000000000001TRLO1` where "LO" represents Location

**DEPLOYED_PRODUCT**: This specifies that the product's generated code is bundled in the product's distribution. This means that remap skips the code-generation step. This property's value should be the name of the product. To bundle the generated code into the distribution, see [here](../../../database/fields-tables-views/genesisDao/#bundling-generated-code-with-product-distribution).

If you want to enable SSL for your process communication, this is done in the [service definition](../../../server/configuring-runtime/service-definitions/#enabling-ssl-for-processes).
If you want to enable SSL for your process communication, this is done in the [service definition](../../../server/configuring-runtime/service-definitions/#enable-ssl-for-processes).

## Setting system-definition values from environment variables

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ Let's have a look at the different options for configuring this file. You have s

`dataserverPollingTimeout` This setting contains the timeout for polling the data-server resources in the system in seconds. Default value is 60 seconds.

`authDisabled` This is a dangerous setting! If set to true, it disables all authentication on the router. Typically, it is used for development mode. If you need to use this for another reason, see our section on [non-authenticated Genesis Routers](../../../server/configuring-runtime/genesis-router/#non-authenticated-routers). Default value is false.
`authDisabled` This is a dangerous setting! If set to true, it disables all authentication on the router. Typically, it is used for development mode. If you need to use this for another reason, see our section on [non-authenticated Genesis Routers](../../../server/configuring-runtime/genesis-router/#non-authenticated-routers/). Default value is false.

`nettyLoggingEnabled` If set to true, this setting enables internal netty logging. Default value false.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ class TestAuthManagerService(@Inject val clientConnectionManager: ClientConnecti
}
```

### Constructor
### Constructor[​](../../../server/api-reference/network-api/#constructordirect-link-to-heading)

GenesisMessageClient(address: String, port: Int, secure: Boolean, configuration: NetworkConfiguration)

### Functions
### Functions[​](../../../server/api-reference/network-api/#functionsdirect-link-to-heading)

| Name | Signature |
| --- | --- |
Expand Down Expand Up @@ -93,22 +93,22 @@ class TestAuthManagerService(@Inject val clientConnectionManager: ClientConnecti
}
```

## GenesisMessageHandler
## GenesisMessageHandler[​](../../../server/api-reference/network-api/#genesismessagehandlerdirect-link-to-heading)

GenesisMessageHandler enables you to attach listeners to servers and clients.

### Functions
### Functions[​](../../../server/api-reference/network-api/#functionsdirect-link-to-heading-1)

| Name | Signature |
| --- | --- |
| addListener | `fun addListener(listener: GenesisMessageListener<V>)` |
| removeListener | `fun removeListener(listener: GenesisMessageListener<V>)` |

## GenesisMessageListener
## GenesisMessageListener[​](../../../server/api-reference/network-api/#genesismessagelistenerdirect-link-to-heading)

`GenesisMessageListener` is a functional interface with method `onNewMessage`, which listens for any new messages. `@FunctionalInterface public interface GenesisMessageListener<V extends GenesisMessage>`

### onNewMessage
### onNewMessage[​](../../../server/api-reference/network-api/#onnewmessagedirect-link-to-heading)

This method is called when a new message is received.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ tags:

In this page, we look at details of the functions that enable you to interact with the Genesis services that can be specified in the [service-definition.xml](../../../getting-started/learn-the-basics/key-system-files/genesis-system-definitions/) file.

Functions
Functions[​](../../../server/api-reference/service-provider-api/#functionsdirect-link-to-heading)
------------------------------------------------------------------------------------------------------------------------------------

| Name | Signature | Description |
| --- | --- | --- |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ You can access system definition properties in two ways:
- using existing APIs
- using @Named Genesis annotation

## Using existing APIs
## Using existing APIs[​](../../../server/api-reference/system-definition-api/#using-existing-apisdirect-link-to-heading)
-----------------------------------------------------------------------------------------------------------------------------------------------

| name | signature |
| --- | --- |
Expand Down Expand Up @@ -62,7 +63,8 @@ You can access system definition properties in two ways:
| parseProperty | `static <T, R> Optional<R> parseProperty(Supplier<Optional<T>> property, Predicate<? super T> canBeTransformed, Function<? super T, ? extends R> transformer)` |
| parseStringProperty | `static <R> Optional<R> parseStringProperty(Supplier<Optional<String>> property, Function<? super String, ? extends R> transformer)` |

## Using @Named genesis annotation
## Using @Named genesis annotation[​](../../../server/api-reference/system-definition-api/#using-named-genesis-annotationdirect-link-to-heading)
----------------------------------------------------------------------------------------------------------------------------------------------------------------------

### Injectable properties from system definition
Here is an example of a **genesis-system-definition.kts** file:
Expand Down
Loading