简体   繁体   中英

SpringSource Tool Suite (Eclipse-based) doesn't stop at breakpoints when remote debugging Java Web Applications using WebLogic 10.3.5

I'm using SpringSource Tool Suite (Version: 2.7.2.RELEASE) and WebLogic 10.3.5; for 2 days, I have been trying to make remote debugging work so that I can debug Java Web applications deployed on WebLogic remotely.
I've searched and read a lot of related topics on Stack Overflow and many other Web sites, after trying hard, I'm still not able to make it work.
I use Windows 7 machine, both SpringSource Tool Suite and WebLogic 10.3.5 are installed on my Windows machine; the Java JVM is jrockit_160_24_D1.1.2-4 which comes with WebLogic 10.3.5.

Here is what I did:

  1. Enable Debugging on the WebLogic Server: In the startWebLogic.cmd script, specify the JAVA OPTIONS with:
    set JAVA_OPTIONS=-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n
    and then start WebLogic server, start node manager;

  2. Set breakpoints in my Java Web application, the application uses Struts and Java EE, set a few breakpoints in Struts Action classes and DAO classes;

  3. Compile and build my Java Web application using Apache Ant script with debug="on" in javac task;

  4. Deploy the Java Web application war file to a managed server on WebLogic 10.3.5, the Status of the deployed web application is "Active"; the managed server is the only managed server on my WebLogic 10.3.5;

  5. In SpringSource Tool Suite, select Run > Debug Configuration ... select Remote Java Application, and then press the + button to create a new configuration, fill in the server info such as hostname (localhost) and port number (8000), select "Standard (Socket Attach)", and then click Debug button;

  6. In SpringSource Tool Suite --> Debug Perspective, saw that Java HotSpot(TM) Client VM[localhost:8000] was connected, which indicates that SpringSource Tool Suite debugger is connected to my remote application and ready to debug; also saw a list of breakpoints on Breakpoints tab;

  7. Go to a browser, access the Java Web application via the URL, perform some transactions, however, SpringSource Tool Suite doesn't stop at breakpoints as expected.

I am really stuck with it, any help would be greatly appreciated!

One thing I can suggest that I found worked well for me in the past is zip up the source code and add it to your "Remote Java Application" config under "Source" > "Add..." explicitly. (And not just rely on having project in there.) I know it's a pain to do this manually every time you wanna debug (that's why i put it in a shell script that gets called whenever i build), but I find that Eclipse often times mixes up project layout and folder layout and sets paths incorrectly. If the source code that the debugger "finds" is not correct, breakpoints won't get installed properly and hence won't get triggered. Other than that try doing "Project" -> "Clean" and attach debugger using

-agentlib:jdwp=transport=dt_socket,address=localhost:9999,server=y,suspend=y

as opposed to -Xdebug syntax that you used.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM