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

Debug Java Web Applications #140

Closed
AlexMAS opened this issue Nov 8, 2017 · 5 comments
Closed

Debug Java Web Applications #140

AlexMAS opened this issue Nov 8, 2017 · 5 comments
Assignees
Labels

Comments

@AlexMAS
Copy link

AlexMAS commented Nov 8, 2017

Hello!

I suppose my question can be quite stupid because I have not enough experience with Java. But anyway. Is there possible to debug Java Web Applications? For example, I have an application which can be hosted on Apache Tomcat and I would like to debug it in VSCode using your extension, like I can debug it in Eclipse or IntelliJ IDEA using an appropriate debug configuration.

@andxu
Copy link
Contributor

andxu commented Nov 8, 2017

Currently, the launch mode cannot support launch web app in web container, but the attach mode should support debug servlet (jsp is not supported) , but we have not tested it yet, I will keep this issue open as the task from supporting web containers, please keep eyes on this issue for updates.

@fbricon
Copy link
Collaborator

fbricon commented Nov 8, 2017

@AlexMAS take a look at this article. Even if you don't use JRebel, you'll see how to attach the debugger to a remote tomcat process.

@andxu andxu self-assigned this Nov 9, 2017
@AlexMAS
Copy link
Author

AlexMAS commented Nov 11, 2017

@fbricon thank you, it works fine!

I have a Gradle project, so I imported the gretty plugin as described comprehensively in this article and configured an appropriate task to run the project:

{
    "taskName": "Run Debug",
    "type": "shell",
    "command": "gradlew appRunDebug",
    "group": "build",
    "problemMatcher": []
}

You also have to configure debug options like next:

allprojects {

    apply plugin: 'org.akhikhl.gretty'

    gretty {

        // Hosting
        servletContainer = 'tomcat8'
        host = 'localhost'
        httpPort = 8080

        // Debug
        debugPort = 5005
        debugSuspend = true
    }
}

And finally the launch configuration:

{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "java",
            "name": "Debug (Attach)",
            "request": "attach",
            "hostName": "localhost",
            "port": 5005
        }
    ]
}

@andxu
Copy link
Contributor

andxu commented Dec 1, 2017

Please take a look at this plugin, we will prepare the tutorials for debug java web apps(jsp is not supported by now) .

@andxu andxu added the backlog label Dec 7, 2017
@andxu andxu closed this as completed Mar 2, 2018
@cvaliere
Copy link

hi @andxu i too have trouble figuring out how to do it
any news on the tutorial?

cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants