4

So I'm starting to pull my hair out here. IntelliJ just doesn't want to trigger breakpoints, whereas Eclipse works just fine. I never thought I'd say that sentence :|

Here's my example:

mvn archetype:generate -Dappengine-version=1.9.15 -Dapplication-id=your-app-id -Dfilter=com.google.appengine.archetypes:guestbook-archetype

  • Uncomment the suggested lines in the pom.xml to allow remote debugging

        <plugin>
            <groupId>com.google.appengine</groupId>
            <artifactId>appengine-maven-plugin</artifactId>
            <version>1.9.15</version>
            <configuration>
                <enableJarClasses>false</enableJarClasses>
                <!-- Comment in the below snippet to bind to all IPs instead of just localhost -->
                <!-- address>0.0.0.0</address>
                <port>8080</port -->
                <!-- Comment in the below snippet to enable local debugging with a remove debugger
                like those included with Eclipse or IntelliJ -->
                <jvmFlags>
                    <jvmFlag>-agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n</jvmFlag>
                </jvmFlags>
            </configuration>
        </plugin>
    
  • Run the devserver goal (which compiles, tests and runs the GAE environment)

mvn appengine:devserver

(ECLIPSE: WORKING CASE)

  • Fire up Eclipse Juno and import the project as a Maven project.
  • Create a "Remote Java Application" Debug configuration enter image description here
  • Set a breakpoint, Debug the app using the Remote config and BAM, breakpoint hit and app stops. As expected.

(INTELLIJ 14: FAIL CASE)

  • Fire up INTELLIJ and import the project as a Maven project
  • Create a "Remote Java Application" Debug profile enter image description here
  • Set a breakpoint, Debug the app using the Remote config and BAM, breakpoint FAILS to trigger.

Other than the different IDEs, there is no difference in the project setup. This tells me I must be doing something wrong in IntelliJ, but I honestly don't know what.

It just works in Eclipse and doesn't in IntelliJ. :|

Any ideas?

-- Shane

Shane
  • 3,051
  • 3
  • 40
  • 45

3 Answers3

0

I am not sure if this question is still active.

I think you may have had the same problem I had.Intellij debugger does not stop at breakpoints

Are you sure your server is exposing the 8000 port for debugger to listen when it started. You should provide those JVM parameters if it is not.

Community
  • 1
  • 1
datta
  • 521
  • 2
  • 5
  • 16
0

I have managed to get it working as follows:

  • Add JVM flags to Maven/Gradle as suggested by IntelliJ.
  • Do not use remote (as suggested by GAE documentation). Instead, debug appengineRun Gradle task (similar for Maven).
  • Once it is up and running, hit Run/Attach to a Local Process.

BAM! The debugger is attached, breakpoint hit and app suspended

Nikola Mihajlović
  • 2,286
  • 2
  • 19
  • 23
  • 2
    I'm glad you got it working, but your answer isn't particularly helpful. Saying "Add JVM flags to Maven/Gradle as suggested by IntelliJ" begs the question "What did IntelliJ suggest?" I wish I could use this answer, but I need more info. – MiguelMunoz Aug 15 '19 at 02:25
0

it is old question for sure, but this is the answer:

make sure you have in the maven run config -DforkCount=0 -DreuseForks=false

source: https://intellij-support.jetbrains.com/hc/en-us/community/posts/206825095-Breakpoints-don-t-work-when-debugging-maven-project-

Nariman
  • 110
  • 1
  • 10