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

IntelliJ debug config updates for embedded Tomcat #699

Merged
merged 3 commits into from
Jan 31, 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
13 changes: 13 additions & 0 deletions .idea/runConfigurations/LabKey_Embedded_Tomcat_Dev.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/runConfigurations/templates/LabKeyEmbedded_Dev.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 11 additions & 7 deletions server/embedded/README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
# embedded
LabKey Server can now be started with embedded Tomcat. **This feature is in development phase and not ready for use in production. Free versions of IntelliJ may lack support for Spring boot debug configurations required to run the embedded Tomcat.**
LabKey Server now uses embedded Tomcat, which bundles a fully tested copy of Tomcat and simplifies configuration.
This is the supported way to run LabKey Server as of version 24.3, replacing deploying into a standalone Tomcat installation.

### Setup
1. Within the root-level `gradle.properties` file, uncomment the `useEmbeddedTomcat` and `useLocalBuild` properties. If using SSL, also uncomment the `useSsl` property (and see further instructions below).
2. `gradlew cleanBuild`
3. `gradlew pickPg` or `gradlew pickMSSQL`
4. `gradlew deployApp`
5. Within IntelliJ, do a Gradle Refresh in the Gradle Window
6. To start Tomcat within IntelliJ, select LabKeyEmbedded_Dev from the Run Configurations. (It will appear in a different section of the menu from the other LabKey configurations.)
6. To start Tomcat within IntelliJ, select `Spring Boot LabKey Embedded Tomcat Dev` from the Run Configurations. (It
will appear in a different section of the menu from the other LabKey configurations.) If you are using the free
Community Edition of IntelliJ which doesn't natively support Spring Boot, use the `LabKey Embedded Tomcat Dev`
configuration instead.

#### Embedded tomcat gradle properties explained:
+ `useEmbeddedTomcat` - if present, this will cause the :server:embedded project to be included in your local set of Gradle projects to be built. This also will affect the behavior of the `pickPg`, `pickMSSQL`, and `deployApp` tasks and is required to be present in order to build a distribution with an embedded Tomcat server. This property is present in the root-level `gradle.properties` file, but commented out by default.
Expand Down Expand Up @@ -35,8 +39,8 @@ The following task has been added as well

#### Troubleshooting
+ If starting your server from the LabKeyEmbedded_Dev configuration fails, this is likely due to IntelliJ not being able to find the embedded project on which the configuration depends. There are a few things you should check:
+ Ensure that the `useEmbeddedTomcat` property is uncommented in the root-level `build.gradle` file
+ Within the Gradle window, ensure that the `:server:embedded` project is listed. If it is not, run the task `gradle projects` on the command line to see if it appears in that listing. If it does, try a Gradle refresh within IntelliJ. If it is not in the output from the `projects` command, look at your `settings.gradle` file to see why this might be.
+ From the Configurations menu, choose the "Edit Configurations ..." and then under the Spring Boot section, choose the `LabKeyEmbedded_Dev` configuration.
+ If the there is nothing selected for "Use classpath of module", open the dropdown and choose `<root>.server.embedded.main`, where `<root>` is the name of the root of your enlistment.
+ If there are no options presented for "Use classpath of module" and the embedded module does appear in the Gradle projects listing, try `File -> Invalidate Caches / Restart`
+ Ensure that the `useEmbeddedTomcat` property is uncommented in the root-level `build.gradle` file
+ Within the Gradle window, ensure that the `:server:embedded` project is listed. If it is not, run the task `gradle projects` on the command line to see if it appears in that listing. If it does, try a Gradle refresh within IntelliJ. If it is not in the output from the `projects` command, look at your `settings.gradle` file to see why this might be.
+ From the Configurations menu, choose the "Edit Configurations ..." and then under the Spring Boot section, choose the `LabKeyEmbedded_Dev` configuration.
+ If the there is nothing selected for "Use classpath of module", open the dropdown and choose `<root>.server.embedded.main`, where `<root>` is the name of the root of your enlistment.
+ If there are no options presented for "Use classpath of module" and the embedded module does appear in the Gradle projects listing, try `File -> Invalidate Caches / Restart`