Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Intellij debugger does not stop at breakpoints

I must be doing something wrong here. I am new to intellij. Making switch from eclipse. I have a JAX WS application that runs on weblogic. The artifact to deploy is an ear file. I have been struggling to get debugger on intellij working. I have the ultimate edition. I did create a run debug configuration but it just passes through the code and does not stop at my desired location. The debugger shows a red dot without a check or a cross.

Edit - I am running a "local" run/debug configuration.

Here is a screen shot of my run/debug configuration.

enter image description here

Here is the screen shot of startup/Connection

enter image description here

like image 797
datta Avatar asked May 06 '15 21:05

datta


3 Answers

I figured out what my issue was and I think the problem is specific to me and the nature of my application. Actually I should call it a self induced issue. Let me explain the nature of events.

  1. I have been using eclipse to develop and have a local install of weblogic instance. My application needs coherence cache server and I have few other JVM parameters that I pass when starting the domain. Therefore I had added a line at the start of the $DOMAIN_HOME/bin/setDomainEnv.sh file like so

    JAVA_OPTIONS="- Dtangosol.coherence.distributed.localstorage=false -Dtangosol.coherence.wka=devmachine and blah blah blah

  2. I switched to intellij and started working on this project and then configured the weblogic plugin and run configuration etc.

  3. I noticed that intellij adds a JAVA_OPTIONS in the startup/connection tab in Run/Debug Configurations like so

enter image description here

  1. However the JAVA_OPTIONS that was being passed by intellij was not being used by weblogic. I believe it was overridden with what was in the setDomainEnv.sh which is why I saw the following logs.

java version "1.6.0_65" Java(TM) SE Runtime Environment (build 1.6.0_65-b14-466.1-11M4716) Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-466.1, mixed mode) Starting WLS with line: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java -client -Xms512m -Xmx512m -XX:MaxPermSize=256m -Dweblogic.Name=AdminServer -Djava.security.policy=/Users/dparupud/omw/oracle/middleware/weblogic_10.3.6/wlserver_10.3/server/lib/weblogic.policy -Dtangosol.coherence.distributed.localstorage=false -Dtangosol.coherence.wka=devmachine blah blah blah......

  1. When I went and removed the JAVA_OPTIONS from setDomainEnv.sh and restarted the server from intellij I saw the following log

starting weblogic with Java version: java version "1.6.0_65" Java(TM) SE Runtime Environment (build 1.6.0_65-b14-466.1-11M4716) Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-466.1, mixed mode) Starting WLS with line: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java -client -Xms512m -Xmx512m -XX:MaxPermSize=256m -Dweblogic.Name=AdminServer -Djava.security.policy=/Users/dparupud/omw/oracle/middleware/weblogic_10.3.6/wlserver_10.3/server/lib/weblogic.policy - agentlib:jdwp=transport=dt_socket,address=127.0.0.1:65501,suspend=y,server=n

Now the log showed that the jdwp agent was in action. I did notice that I did not see that particular log before I asked the Question on SO but I thought maybe IntelliJ was doing something inside the covers because JAVA_OPTIONS was being passed and intellij does not allow you to mess with that ( it is readonly).

I guess I can either pass all my jvm parameters either from intellij or add the jdwp agent info in the setDomainEnv.sh.

Now I am able to debug.

like image 161
datta Avatar answered Oct 21 '22 08:10

datta


Deleting the configuration and creating a new one solved it for me.

like image 30
Mukundhan Avatar answered Oct 21 '22 09:10

Mukundhan


To setup WebLogic debugging on IntelliJ:

  1. Find the WebLogic Debug Port: this is the port on WebLogic exposed for debugging. The default debug port is 8453 but if it was changed you can find it in the config.xml (under the config folder in your domain home) or the setDomainEnv.sh look for DEBUG_PORT (I assume it is .sh and not .bat as you appear to be using Mac OS X).

  2. Remote Debugger Configuration: go to the configuration and choose new, then select "Remote" ,type in any name that is sensible and under the port (orange block in image) type in the value you found in 1. For host (the green block) type localhost [a side note: you can connect to a remote server by typing that servers host name or IP if the debug port is exposed].

  3. Start debugger: Start the debug configuration you just setup, the debug window will pop up and if the port is correct it will say it has connected to remote host and you are good to go debugging.

IntelliJ remote Debugger

--Edit 1--

Read your question again missed the part about you already having setup the remote config.

It may be missing the breakpoint if your program is multi-threaded the breakpoint may not be hit on the current thread you are on.

There is a drop down in the debugger when you have the remote configuration working where you should be able to select the thread to debug on.

-- Edit 2 --

Added the image for the remote debugger settings

like image 5
8bitme Avatar answered Oct 21 '22 09:10

8bitme