I have the YourKit 12.0.5 plugin configured in my 12.1.4 IntelliJ IDEA. I added a remote Tomcat run configuration with a couple of tasks before server start-up, a simple make and a script that we use to deploy changes to our built-out class files and Web collateral (VM files, CSS, etc.). This copies those files into the web app that's already deployed in Tomcat.
I can't figure out how to get my run configuration to know what the current module is, since my configuration for the deploy script used the $ModuleFileDir$ macro to make the path to $ModuleFileDir$/bin/quick-deploy.bat and, when I try to profile my application, I get an error that it can't find /bin/quick-deploy.bat (so basically $ModuleFileDir$ is ""). I've tried this with the desired module selected in the Project window or files open from the module but it doesn't seem to catch.
That's not what this post is about. That's annoying, but I can just hard-code the path if necessary.
What's weird is that I can start my run configuration, which should:
- Build the code with the make
- Deploy the code and other changes via our deploy script
- Attach to the remote Tomcat server
I'm not really certain how to get the server to reload or redeploy the code, but again, not worried about that just yet.
The problem is that my build has failed because of the missing $ModuleFileDir$ macro and then the Profile option is unavailable for any of my run configurations! I can still run, I can still debug, but the YourKit icon and the Profile 'Config Name' menu item are both disabled, seemingly permanently. The only way I can get them to re-activate is to uninstall the YourKit plugin and reinstall it. That's not very efficient.
So here's what this looks like. The attachment YourKitAvailable.jpg shows how my tool bar looks before I've tried to profile my app. I click that and get the following error (note that this configuration isn't even using the $ModuleFileDir$ macro: it just can't resolve relative paths from the working directory!):
7:23:34 PM Error running Quick Deploy: Cannot run program "bin\quick-deploy.bat" (in directory "D:\Development\XNAT-1.6\xnat_builder_1_6dev"): CreateProcess error=2, The system cannot find the file specified
Now I get the results shown in YourKitUnavailable1.jpg and YourKitUnavailable2.jpg. SUDDEN UPDATE:
I just re-started IntelliJ and the option became available again. So that's progress! I didn't have to un-install. But I had to previously and I'm sure of this because I actually re-started TWO times! Anyway, we have a pretty large application and the re-start can be fairly time-consuming, so it'd be grand to not have to re-start each time.
I know that this may be a YourKit issue, so I'm cross-posting to the YourKit board as well.
Any help or ideas would be greatly appreciated.