Launch Grails 3 app from IntelliJ w/ auto-reloading enabled - intellij-idea

It looks like IntelliJ's (Ultimate EAP 15) support for Grails 3 is in the early stages yet. If I do Run -> Debug 'Grails:My App', I'm able to launch an app from inside IntelliJ, I can set breakpoints and it works as expected.
If I make changes however, I see in the console that the file is recompiled, but when I hit reload in the browser, I don't see the changes reflected there. I have to stop and restart the app in IntelliJ before I see them. Anyone know how I can get the auto-reloading working?

After chasing this for a week, this post finally provided an explanation.
It's actually a Grails issue, not a problem with IntelliJ's Grails integration: spaces in a file's path will break automatic reloading. Renaming my project from Grails Demo to GrailsDemo got everything straighted out. (Storing a project in a folder like My Documents will also cause trouble.) The post's author indicates that this started with version 2.4.4 and it's still happening for me in 3.0.4.

Related

Intellij 2018.2 stops working and exits on MacOs. What might be a problem?

As an daily IntelliJ user you usually concentrate on the projects you are working on and IntelliJ is just a tool. You are not willing to dig into tool's problem itself. But this is what is forced on you by default after IntelliJ installation on MacOS and opening relatively big project(most of the projects nowadays are huge and have thousands of files and use numbers of IntelliJ 3rd party plugins).
Here is a minimal list of actions. IntelliJ must have set MORE RAM to be used by default.
Read: https://intellij-support.jetbrains.com/hc/en-us/articles/207241085-Locating-IDE-log-files .
From IntelliJ open Help / Show log in Finder and open idea.log file with Console.app; In Console.app press "Reload" and "Now" buttons to track "live" what IntelliJ is doing.
If in logs of IntelliJ you find that some of the plugins exit with fatal error, you just uninstall those plugins. For me the one that failed to the moment of this answer was "BashSupport" as example.
Start Terminal.app ; Run command: open -a TextEdit /Applications/IntelliJ\ IDEA.app/Contents/bin/idea.vmoptions ; Change options in idea.vmoptions file to:
-Xms1024m
-Xmx2048m ; Read https://www.jetbrains.com/help/idea/tuning-the-ide.html to see how you can tune IntelliJ for your project. This step is handy when your IntelliJ app doesn't start at all and you want to change properties in a global way.
From IntelliJ open Help / Edit Custom Properties.... Here you can set same properties that will override global and will work only for current OS user.
Also there is also a possibility of underlying OS to do it voodoo magic so the IntelliJ won't work as it should like here - https://intellij-support.jetbrains.com/hc/en-us/community/posts/360000398280-IDEA-Ultimate-2018-2-Unable-to-save-settings-Unable-to-create-file-Windows-10
Make sure your project build output for *.class files is set. Read: https://intellij-support.jetbrains.com/hc/en-us/community/posts/360000000584-Build-does-nothing . In my case when IntelliJ started project build it terminated without warnings shortly after.
Finally in my case none of 6 steps above solved the issue so I found this read: https://intellij-support.jetbrains.com/hc/en-us/community/posts/115000532044-IntelliJ-cannot-build-projects . Basically try reinstall IntelliJ from original distribution again.
I know that you must read https://www.jetbrains.com/help/idea every time you install a new version of IntelliJ, but why not to add some consistency into configuration process of the main java process that runs IntelliJ itself? You can ask how much ram to use during installation of IntelliJ and explain why it is so. Then Help digging won't be necessary in the first place for devs who fed up with changing those default settings that will be always more than 700MB. I think for most devs out there it is at least 10x of that. I bet what makes most devs mad about this is not the fact that you need to do some options changing, but where those options are depending on OS plus the fact that you simply forget why IntelliJ app just exits while you are doing a debugging of your own app. I bet this problem makes us mad since first java based IDEs appeared. User-friendly is the key here and explicit reminders within the app itself would help.

Using IntelliJ IDEA and the Dart plugin, where does the Dart exceptions end up?

I've been playing with Angular2 using IntelliJ IDEA (2016.3.5) and the latest Dart plugin, and I just can't figure out where the errors, exceptions, assert failures etc. ends up.
I am running Dartium with DART_FLAGS="--checked" and pub serve seems to default to debug mode as far as I can read. Dart2js is configured to run in checked mode as well and the analysis server is configured for strong mode. I have also tried using the JetBrains Chrome extension so I get everything shown directly in IDEA, including the console saying Observatory listening at http://127.0.0.1:35517/.
When there are no errors the Angular2 Dart app runs just fine in Dartium but if I add an assert some where in the code, ie. on a button trigger, the app just stops working at that point with no error output anywhere. Same goes if there's some other error somewhere that pub serve didn't detect.
Dart and Dartium are both at the currently latest version, 1.22.1.
This will be fixed in Angular3 beta.x due to be released the next days it seems.

Intellij IDEA 13 - Can't open Project Structure dialog anymore

as already described in title, i'm not able to open the project structure dialog window in intellij anymore.
neither the shortcut (Ctrl+alt+shift+s) nor the menu element under File -> Project Structure nor the little button in the upper right corner do work.
Clarification: Menu element :
This "bug" occured suddenly as I wrote a web (vaadin/maven) project and tried to set up glassfish, where i often had to switch to the project structure dialog.
Since the first occurence i wasn't able to fix it by restarting intellij or switching projects.
This also happened on my laptop running the same intellij and windows version (Ultimate 13.0.1 Build: 133.331 on Windows 7 x64)
i appreciate any help!
This also happened to me, but removing new plugins etc didn't help.
Nor did nuking my project and rebuilding it from scratch.
In the end I deleted all caches, restarted Intellij and at last I could access the project settings again! By the way, I'm using Intellij 11.1 - mainly because I can't get 13 to start up, but that's another story
Your log shows that it is a bug in IntelliJ IDEA - they are trying to create file passing null pathname. Try to delete project files and reopen project from scratch (maybe you've lost some file) - if it won't help then you should create an issue here: http://youtrack.jetbrains.com/ - You can even copy-paste text from your question and attach stacktrace
I had the same issue...upon further inspection in the log dump...I noticed the following:
ERROR - llij.ide.plugins.PluginManager - com.intellij.openapi.fileChooser.FileChooserDescriptor.setTitle(Ljava/lang/String;)V
java.lang.NoSuchMethodError: com.intellij.openapi.fileChooser.FileChooserDescriptor.setTitle(Ljava/lang/String;)V
at com.jetbrains.python.sdk.PythonSdkType.getHomeChooserDescriptor(PythonSdkType.java:247)
Disabled the latest Python Plugin and restarted and everything is working normal again.
I remembered I had recently update my python plugin and am not using it presently so I was able to disable it without issue.
Hope this helps someone else.
This also happened to me. The comment above helped. I had just added some plugins. Disabled them and it started working again. Not sure exactly which one because I disabled all 4 -- Bean Validation Support, Bitbucket, Jelastic Cloud Platform Integration, and Quick Notes.
For me it has been resolved by switching off FindBugs plugin and restart IDEA. So Project Structure is available for me now.
One of the plugins might be causing it. To disable a plugin, go here:
You'll know for sure if a plugin is bad if you see this Exclamation picture:
Clicking on it will bring up a pop-up. To disable the plugin, click on this:
For me it got resolved just by restarting the intelliJ IDEA. I'm using intelliJ IDEA Ultimate 2018.1 edition.

How to enable hot swap in intelliJ

I want to work on intelliJ on my webapps and I don't know how to hot swap code while working.
For example while I was working in Eclipse when I edited jsp files Eclipse automatically, instantly swapped the file so when I refreshed the page my changes were there
When I change class code in Eclipse it worked a bit longer because he republished the app but did it automatically and instantly.
I saw that intelliJ in the runtime configuration has an option 'how class swap'. I did check it but nothing is happening. I had tried compile, make, save and everything else and nothing is happening. I had to reload the app and I had to do dis manually. Secondly intelliJ reloads EVERY application in my webapp directory. I have them a lot so it taking ages. how can I turn on hot swap?
Hotswap only works in debug mode. So you need to connect to your webserver through a debug configuration. Then, after compile either the project or at least the class with the modifications, IntelliJ tries to hotswap that class.
This only works for minor changes. For example, creating new methods on the fly is not possible using this way.
Hotswap works with exploded artifacts on Update action. If it doesn't work with your project, contact support for help and provide the project to reproduce it.

How to enable hot swapping in debug mode with gradle and jetty?

I'm using jettyRun for running my simple spring application. I wanted to enable hot swapping with Intellij debuger, but looks like jetty doesn't catch the changes.
On http://docs.codehaus.org/display/GRADLE/Gradle+Jetty+Plugin I seen that it should work with:
jettyRun.scanIntervalSeconds=1
On the other hand, there is some inconsistency. On the gradle homepage this parameter is not listed: http://www.gradle.org/jetty_plugin. Anyway, is there any way to enable this on gradle?
Heh, actually found it myself now.
Looks like this parameter is not needed at all. Hot deploy works anyway.
I just wasn't able to seen that because my vaadin application was keeping session even after F5. To restart it properly it's enough to add ?debug&restartApplication to the application url.
So, Ctrl+Shift+F9 in IntelliJ + F5 in the browser (with ?debug&restartApplication) works fine ;)