Problems Debugging Javascript Release 2022.2.2
I accidentally submitted a post to EAP Users so am repeating it here to ensure it doesn't get overlooked. I have had many problems with the debugger while debugging JavaScript.
One problem is that once break points are placed inside the javascript, even when you run the app in run mode and NOT debug mode, it still stops at the breakpoints.
The other problem is that sometimes, when debugging it goes into the war file instead of the source code. Once it does this, it seems to get stuck there and any debugging after that goes into the war file. Today I tried everything to clear what might be causing this, such as invalidating the cache and restart. This didn't work so I deleted the .idea folder. This is a pain because I have to reset the configuration. But still when I tried to debug the javascript it went into the war file instead of the source code. If I try stepping over it stops in comment lines so becomes impossible to use. The debugger for javascript is now useless to me.
Yesterday I uploaded my entire project so you can see where it is going into the war file. There is a README.txt file inside the uploaded folder. The upload ID: 2022_10_09_51PjiiSK9ntrfNGp7SMUro
Please help because I just paid a twelve months subscription to get the javascript debugger and now it's not working. My previous submission went to Yaroslav Bedrov who said he was waiting for me to upload the project.
请先登录再写评论。
I am very sorry to have to report that today while debugging the javascript debugger did go into the war file again. It appeared to be working for a while but then it started playing up. It would seem that trying to fix this issue using Live Edit is not good enough. I expect the only way to fix it is to actually fix the code itself rather than trying to do workarounds such as using Live Edit. It isn't working well enough. I know it was a suggestion to at least keep me working with the debugger, but I think you will need to speak to the developers and ask them to provide a more urgent and proper fix to resolve this problem. Workarounds are not working. Please, please, get this fixed. I like intellijIDEA in every other way but the javascript debugger is making my life hell.
Did you press "Update" button in tool window with Tomcat run configuration?
Thanks for your patience Yaroslav. Here is what I did.
1. Inder "Run" dropdown select Edit Configurations.
2. Run/Debug Configurations is displayed.
3. On 'update' action select "Update classes and resources"
4. On frame deactivation select "Update classes and resources".
5. Press OK
Also checkbox "with jabascript debugger" is checked.
Have I missed anything?
When you start debugging there are two configurations running:
1. JavaScript Debug
2. Tomcat Server
If you open the second one (it might be in Run tool window or Services tool window) you can find "Update" button. Please press it after changing code and select "classes and resources".
Thank you Yaroslav. A picture paints a thousand words. Now I know which "update" button you are talking about. I will follow your instructions and let you know.
You are welcome! I'll be waiting.
Hi Yaroslav
I have been working with your solution for a couple of weeks now. I wanted to give it a good bashing to make sure it works.
Yes it works. The only issue is "REMEMBERING" to click on the update button every time I make a change in the code. If I forget then it ends up back in the war file. But for the most part, if I train my memory to click on update, then the solution is working most of the time. On odd occasions a strange thing happened but I didn't record the exact steps to repeat. But a couple of times it suddenly just stopped debugging.
I also found the solution doesn't work for java, only javascript. Or perhaps I missed something to cause this.
Anyway, it is a bit better to work with now. At least we have tracked down that there is a problem and what the likely cause may be. There are definitely problems in the design of integrating the javascript debugger with the java debugger. I think it wasn't properly designed because it was an add on instead of a new design and it hasn't worked very well. Please inform the developers they need to come up with a better design for integrating the javascript debugger with the java debugger. Because without your solution, the javascript debugger is fairly useless. Even with the workaround there are so many things to do and remember it isn't nice to work with.
I look forward to seeing a fix for this in the next release. At least before my subscription renewal is due. Always hoping.
It doesn't work all of the time. On occasion it goes into the war file. I am not always certain if I remembered to press update so when that happens, I stop the server, rebuild the project and restart the server in debug. But it still goes into the war file until I remove the folder in AppData Local. So the solution isn't perfect.
Actually it's not about design. When you change code it should be recompiled and uploaded on application server. Otherwise you have difference in code, so IDE uses artifact data.
You may try to set "Update classes and resources" for "On frame deactivation" in run configuration. If you return to browser after changing, code will be updated automatically and debugger shouldn't jump into the artifact.
I have always had "Update classes and resources" set for " On frame deactivation" in run configuration, which is why I was puzzled.
We have similar case under investigation on YouTrack: https://youtrack.jetbrains.com/issue/IDEA-301601/Tomcat-8-local-Update-resources-on-frame-deactivation-not-working-after-upgrade-to-2022.2
I am relieved to know I am not the only person experiencing problems and getting frustrated with the debugger.
I think it is time for me to give up struggling to find workarounds for all the issues I have encountered with the integration of the javascript debugger into intelliJIDEA. I loved the product when I was only working with Java on a Java app but using it for a web app incorporating javascript has been a big failure when it comes to a complex web app. It is not worth the money and I cannot recommend it.
I hope you will inform your developers that the debugger needs some serious work. I sincerely hope to see a big improvement in the next release and hope it arrives before my next subscription is due. If not, then I will try out Eclipse which is free. No point paying for something that doesn't work.
Thank you Yaroslav for always being courteous and trying your best to find ways to get around the problems. You are a credit to your company, but I think we have reached the limit on what can be done to fix all the problems without some serious effort by the developers to perhaps rewrite the solution for debugging non-trivial web apps.
As a suggestion, if your company want a new release tested I will be happy to do that if they make it available to me free of charge. You couldn't get a cheaper tester. I will hammer it to pieces.
Hi Yaroslav
Do you have an approximate date when all these problems with the javascript debugger might be properly fixed? I still find it going into the war files from time to time. Usually, after making a change in the code, I click on the "update" button before continuing with the debugger. However, sometimes I make a big change so I think it best to restart the server. In these circumstances I shut down the server and restart, thinking it will pick up my changes but often it ends up in the war files. I then have to delete the JetBrains folder and start again. I have done this three times in the last hour and it is an absolute pain. Working with the debugger in its current form us pretty much unusable, which is why I am eager to know when a fix can be expected. I think this is serious enough to be at the top of the priority list.
Sorry for the delay, but we still couldn't reproduce the issue. Also it seems to be some rare individual case as there are no votes/comments on YouTrack issue. Anyway, we'll continue investigation.
Am I got it right, that even if you explicitly run "Update" action IDE steps into WAR file? Could you please share idea.log just after facing it?
We are working on new solution. Meanwhile, may I ask you to add "#com.intellij.javaee.appServers.run.execution.update" into "Help | Diagnostic Tools | Debug Log Settings", restart IDE and provide log just after you face the issue (with approximate timestamp)? So, we could check if there are any issues with "update on frame deactivation" action. Thanks!
Hi Yaroslav
I followed your instructions.
What happened today was after I clicked on the refresh/update button, the debugger appeared to stop working. It wasn't going into the code at all. So I stopped the debugger and the server and restarted everything. It went straight into the war file.
I have attached a screen shot so you can see it is in the war file. I also attach a cut and paste of the contents of the Tomcat Catalina Log. There was nothing in the Tomcat Localhost Log. I hope this is the log you were talking about.
It looks like I can't attach the text file so I will simply copy the contents below the image.
29-Mar-2023 17:06:08.472 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version name: Apache Tomcat/10.1.0-M17
29-Mar-2023 17:06:08.474 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built: Jul 13 2022 18:51:03 UTC
29-Mar-2023 17:06:08.474 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version number: 10.1.0.0
29-Mar-2023 17:06:08.474 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name: Windows 10
29-Mar-2023 17:06:08.474 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version: 10.0
29-Mar-2023 17:06:08.474 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture: amd64
29-Mar-2023 17:06:08.474 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home: C:\Program Files\Java\jdk-14.0.2+12-jre
29-Mar-2023 17:06:08.474 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version: 14.0.2+12
29-Mar-2023 17:06:08.474 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor: AdoptOpenJDK
29-Mar-2023 17:06:08.474 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE: C:\Users\lorna\AppData\Local\JetBrains\IntelliJIdea2023.1\tomcat\d1158bed-3e56-47d0-8630-3f48d9572e26
29-Mar-2023 17:06:08.474 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME: C:\Users\lorna\AppData\Local\apache-tomcat-10.1.0-M17
29-Mar-2023 17:06:08.476 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.base/java.lang=ALL-UNNAMED
29-Mar-2023 17:06:08.476 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.base/java.io=ALL-UNNAMED
29-Mar-2023 17:06:08.477 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.base/java.util=ALL-UNNAMED
29-Mar-2023 17:06:08.477 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.base/java.util.concurrent=ALL-UNNAMED
29-Mar-2023 17:06:08.477 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED
29-Mar-2023 17:06:08.477 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=C:\Users\lorna\AppData\Local\JetBrains\IntelliJIdea2023.1\tomcat\d1158bed-3e56-47d0-8630-3f48d9572e26\conf\logging.properties
29-Mar-2023 17:06:08.477 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
29-Mar-2023 17:06:08.477 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:65449,suspend=y,server=n
29-Mar-2023 17:06:08.477 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -javaagent:C:\Users\lorna\AppData\Local\JetBrains\IntelliJIdea2023.1\captureAgent\debugger-agent.jar
29-Mar-2023 17:06:08.477 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote=
29-Mar-2023 17:06:08.477 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.port=1099
29-Mar-2023 17:06:08.477 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.ssl=false
29-Mar-2023 17:06:08.477 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.password.file=C:\Users\lorna\AppData\Local\JetBrains\IntelliJIdea2023.1\tomcat\d1158bed-3e56-47d0-8630-3f48d9572e26\jmxremote.password
29-Mar-2023 17:06:08.478 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.access.file=C:\Users\lorna\AppData\Local\JetBrains\IntelliJIdea2023.1\tomcat\d1158bed-3e56-47d0-8630-3f48d9572e26\jmxremote.access
29-Mar-2023 17:06:08.478 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.rmi.server.hostname=127.0.0.1
29-Mar-2023 17:06:08.478 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
29-Mar-2023 17:06:08.478 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
29-Mar-2023 17:06:08.478 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=C:\Users\lorna\AppData\Local\JetBrains\IntelliJIdea2023.1\tomcat\d1158bed-3e56-47d0-8630-3f48d9572e26
29-Mar-2023 17:06:08.478 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=C:\Users\lorna\AppData\Local\apache-tomcat-10.1.0-M17
29-Mar-2023 17:06:08.478 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=C:\Users\lorna\AppData\Local\apache-tomcat-10.1.0-M17\temp
29-Mar-2023 17:06:08.481 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent Loaded Apache Tomcat Native library [2.0.1] using APR version [1.7.0].
29-Mar-2023 17:06:08.484 INFO [main] org.apache.catalina.core.AprLifecycleListener.initializeSSL OpenSSL successfully initialized [OpenSSL 3.0.5 5 Jul 2022]
29-Mar-2023 17:06:08.602 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"]
29-Mar-2023 17:06:08.614 INFO [main] org.apache.catalina.startup.Catalina.load Server initialization in [285] milliseconds
29-Mar-2023 17:06:08.645 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
29-Mar-2023 17:06:08.645 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet engine: [Apache Tomcat/10.1.0-M17]
29-Mar-2023 17:06:08.653 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
29-Mar-2023 17:06:08.669 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in [55] milliseconds
29-Mar-2023 17:06:10.381 INFO [RMI TCP Connection(3)-127.0.0.1] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
29-Mar-2023 17:06:18.664 INFO [Catalina-utility-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [C:\Users\lorna\AppData\Local\apache-tomcat-10.1.0-M17\webapps\manager]
29-Mar-2023 17:06:18.708 INFO [Catalina-utility-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [C:\Users\lorna\AppData\Local\apache-tomcat-10.1.0-M17\webapps\manager] has finished in [44] ms
Sorry, my bad. I should mention that I need idea.log ("Help | Show Log in...").
Hi Yaroslav
I was able to replicate the error today. Again, it occurred after I restarted the server and debugger. I had made some changes and clicked on the "update" button but it did not appear to have picked up my changes so stopped the debugger and server and restarted. I have uploaded the idea.log file. Details:
Upload id: 2023_03_30_25NgLoWSGGmhDAi5cEePRJ (file: idea.log)
Hope this helps.
Thanks! I passed logs to developers. We'll try to localise the issue.