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

Run & Debug Multi-Module Dropwizard Application in VSCode #1443

Open
TeddyCr opened this issue Feb 21, 2024 · 0 comments
Open

Run & Debug Multi-Module Dropwizard Application in VSCode #1443

TeddyCr opened this issue Feb 21, 2024 · 0 comments

Comments

@TeddyCr
Copy link

TeddyCr commented Feb 21, 2024

I have the following dropwizard app: https://github.com/open-metadata/OpenMetadata, which I am trying to run in debug mode in VS Code. I have tried a few setup of my launch.json file including a recommendation from this SO post How to debug a java dropwizard app using Visual Studio Code.

My launch.json file is configured as show below.

{
    "type": "java",
    "name": "Debug (Launch)-OpenMetadataApplication<openmetadata-service>",
    "request": "launch",
    "cwd": "${workspaceFolder}",
    "console": "internalConsole",
    "stopOnEntry": false,
    "mainClass": "org.openmetadata.service.OpenMetadataApplication",
    "classPaths": [
        "path/to/OpenMetadata/openmetadata-dist",
    ],
    "projectName": "openmetadata-service",
    "args": ""
},
{
    "type": "java",
    "name": "Debug (Attach)",
    "request": "attach",
    "hostName": "localhost",
    "port": 8000
},

I have also tried a simpler config specifying just the classpath and the main class and trying to launch the app directly from the debugger (vs launching it first with the mvn debugger and then attaching to it through VS Code debugger). This yields the same error.

{
    "type": "java",
    "name": "Debug (Launch)-OpenMetadataApplication<openmetadata-service>",
    "request": "launch",
    "cwd": "${workspaceFolder}",
    "mainClass": "org.openmetadata.service.OpenMetadataApplication",
    "classPaths": [
        "/path/to/OpenMetadata/openmetadata-dist",
    ],
    "projectName": "openmetadata-service",
    "args": ""
},

When running the debugger I get a OpenMetadataApplication class not found error. As comparison I am able to successfully run the app in debug mode using IntelliJ -- see screenshot below for IntelliJ config.

I can also run the simple application from the Getting Started dropwizard documentation.

Questions

  • Is it possible to run this kind of multi-module application in VS Code
  • If yes, what pieces am I missing from my launcher config

Thank you for your help, this would be awesome and allow me to only use VS Code 😊

Environment
  • Operating System: Mac OS Sonoma
  • JDK version: 17 (the screenshot says 11 but the project recently moved to 17)
  • Visual Studio Code version: 1.86.1
  • Java extension version: Extension Pack for Java v0.25.15
  • Java Debugger extension version: v0.56.1
Steps To Reproduce
  1. Clone the repository at https://github.com/open-metadata/OpenMetadata
  2. Setup the launcher.json to start the dropwizard application in debug mode
Current Result

Application fails to start and VS Code throws a OpenMetadataApplication class not found error

Expected Result

Application will start correctly in debug mode allowing me to set brekpoints in the application code.

Additional Informations

Before starting the application you will need to:

  1. compile the project mvn clean install -DskipTests from the root folder
  2. generate Python class from json-schema make generate from the root folder
  3. start the application in docker cd docker/development/ && docker compose up -d --build
  4. stop the server in the compose service and start the server in debug mode from VSCode
@TeddyCr TeddyCr changed the title Run & Debug Multi-Module Dropwizard Application Run & Debug Multi-Module Dropwizard Application in VSCode Feb 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant