Intellij: Run button disabled for tcServer - intellij-idea

I am new to IntelliJ and trying to get my web application to launch using tcServer
I am using a local configuration, and have added a run configuration. See attached screenshots
However, when I attempt to run this, the Run button is disabled.
What am I missing here?

You have edited a default configuration, you did not add a new runnable server configuration. In order to do that click on the green + sign at the top left of the run screen.
You should remove the war from the default configuration and add it in the newly created server.
see attached, screenshot, you can see the difference between a default and a runnable configuration

It seems you have to use the little green "+" in the upper left corner. The one you edited is just the default setting for your spring server. If you add a specific run configuration like that to your project it will appear. Good luck.

Related

Invoke an intelliJ run/debug configuration from command line?

I've got some Run/Debug Configurations defined in my JetBrains IDE, and to run them obviously you'd normally press the green 'play' icon;
However, I want to combine that with scripts I've got on my machine which detect file system changes and re-run some validation steps in the background;
Now what I'd like to do is to say something like 'when the CLI detects that something is stale, start the run/debug configuration in the IDE'.
So in pseudo-bash, something like
# if any "*.rs" file changes, press the green button in intellij;
watch-files *.rs -x "run-intellij-config 'check controlplane'
Is it possible to invoke tasks within IntelliJ like this?
There is no way to do this currently, please vote for IDEA-157076 to be notified on any progress with this feature request

Unable to add External Tool to run Before Configuration Launch IntelliJ

Introduction
I've looked around and haven't seen anyone else having my issue.
Basically, I am wanting to run a start.bat file to start up my server before I start up my debugging session. I currently have my debugging inside of an IntelliJ Configuration and it works well. The problem is that in the options for my configuration I can't seem to add an "External Tools" task to the Before Launch section. I was able to add a maven task here previously. However, when I follow the following steps, the "start.bat" is not added.
First I go into Settings->Tools->External Tools to add my Spigot-Server tool which basically calls the start.bat file inside of a test-server directory.
Snippet of External Tools
Second, I go into my "Debug Spigot" configuration and at the bottom, I see a "Before Launch" Section.
Snippet of Spigot Debug options
I click on the + inside of that section to add a new task, and I click on "External Tools"
Snippet of adding External Tools Task
And then I make sure my Spigot-Server task is selected.
Snippet of select external tool
And then once I hit okay, the window closes but I don't see a new task added to the before launch section. It looks the same it did before I clicked on anything. I also don't see any status message at the bottom of IntelliJ
I basically expect the task "Spigot-Server" to show under the Before Launch section. This would basically start up the server and once the server was completely started, it would then launch the debugging configuration.
I think it may be an issue with IntelliJ's UI. I searched IntelliJ's issue tracker But couldn't find any that matched.
I'm wanting to know if there are any work arounds to get this setup in IntelliJ>
I was able to achieve my goal by doing some workarounds that I discovered with the help of CrazyCoder. I found this stackoverflow question that told me about the batch plugin.
I was able to create a Batch run configuration for a wrapper batch file that gets around the limitation CrazyCoder mentioned. He said that even if I did get my setup where my server runs before my debugging is launched, my debugging would never launch. This is because the terminal process needs to exit before the next task starts.
To get around this this is the wrapper batch file I created.
#echo OFF
START "Spigot-Server" /D C:\Users\rocke\Documents\Programming\Minecraft\Spigot\capture-the-carrot\test-server "start.bat"
ping -n 3 127.0.0.1 >nul
It basically uses the "START" command to run the task asynchronously and then waits 2 seconds. This is because all I need to do is wait for the start.bat command to run the very first part so that it establishes remote debugging. And then the wrapper ends after 2 seconds (the 3 represents the number of seconds I want to wait +1). And this allows the Debugging process to start while also ensuring that the server has setup remote debugging!
I'll just share screenshots of my configuration if anyone wants to do the same.
Maven Build Configuration
Spigot Server Start Configuration
Remote Debugging Configuration
The way this is setup is once I run the Remote Debugging Configuration, it has a "Before Launch" Task of Spigot Server. Spigot Server also has a "Before Launch" Task of Maven Build Project.
So my Maven Build Project runs, then my Spigot Server wrapper runs and after 2 seconds terminates, and then my Debugging Configuration runs!
If you have any questions regarding remote debugging with spigot, use this resource: https://www.spigotmc.org/wiki/intellij-debug-your-plugin/

Wamp server cant enable/disable modules (for apache)

I cant enable APACHE modules on WAMP-Server.
After i click the module name (which is not-checked), then server restarts, but when i go to modules, then module is not still enabled.
I even manually opened httpd.conf and enabled module, restarted server, but module is not still enabled!
Has anyone faced similar problem ? what's solution?
A couple of tips.
WAMPServer must be installed as an Administrator so when you launch the install right click the .exe and select "Run as Administrator"
WAMPServer must also be Run As Administrator
When you attempt to include or exclude a new Apache or PHP extension, WAMPserver will attempt to restart Apache so the changes takes effect. If the changes do not show up, it may just be that the menu just skipped a beat, then try a refresh by doing
right click wampmanager -> refresh
If you install WAMPServer using the "Run as Administrator" but attempt to run WAMPServer without using the "Run As Administrator" it will not have the rights to amend some of its own files. This can cause problems like this one, and many others.
solution seemed to EXIT WampServer, then modify httpd.conf manually, and starting Wamp again.
I has this same issue (drove me crazy for a while!), and in my case I had to increase the memory_limit setting in php.ini (make sure it's the right one - open from Wampmanager - it's actually in the apache folder). I set it to 512M and it worked on 2 of the 3 servers I was having issues with.
For the other one I has to add this line:
ini_set('memory_limit', '-1');
to the top of file:
[drive]/[wamprootfolder]/scripts/refresh.php
And then run the Refresh from Wampmanager (right-click the icon). DON'T FORGET TO COMMENT IT OUT/REMOVE THE LINE ONCE IT COMPLETES. This disables the limit which can cause issues if it loads a script with a memory leak, etc.
The problem is that the refresh.php script is supposed to automatically update the wampmanager.ini file (found in [wamprootfolder]) after each change, or when you run it from Wampmanager itself. With the memory setting too low, it caused the function to exit without changing the .ini file, which is why you keep seeing the same settings, version # (after an update), etc.
To test, you can load the default wamp homepage in a browser to confirm version, and then click on phpinfo() to verify what modules, etc. are actually loading. OR just look at the modified date of your wampmanager.ini file!
Once it's working right, your wampmanager.ini should update itself when you run the Refresh (or make a change).

Debug Yii console application in PHPStorm

PHPStrom is a great IDE. I really like it. But I bumped into an issue. I can't find instructions how to configure debugging for Yii console application.
I set debugging for Yii web application and it works fine.
Any help will be highly appreciated.
Upd1: Actually I figured out that there are 3 cases of the Yii console application.
Standard Yii console application (command files in the protected/commands folder of the webapp)
Standalone Yii console application (independent console aaplication without web application)
[My case] YiiBooster console application (YiiBooster has advanced, but good structure for medium or big projects)
After some period of time I found the solution. In my case it must be split in 2 parts:
Configure XDebug in PHPStorm
Get appropriate Xdebug version. Use this wizard from official xdebug site; just copy&past your phpinfo() response into window and it will tell you which version you must download.
Install it and make sure that XDebug is activated (phpinfo() must return xdebug section in the response). Use the following link for detailed instructions
Set XDebug as debugger for PHP in Project Settings
[The steps below are specific for Yii console application debugging]
Find yiic.php file in your project and Run or Debug it first time.
After this go Run->Edit Config and set name of your command in the arguments with required parameters.
Now set breakpoints in your code and activate "Listen debugger connections” button.
Debugging Yii command actions
If you want to use actions (like actionRebuildIndexes) in the command it needs to call the parent::run method in the run() function.
public function run($args) {
parent::run($args);
return 0;
}
For debugging it needs to specify the action name in the arguments for yiic.php Run Configuration (see image above)
There is article in jetbrains blog about it.
you just set your php.ini and add an parameter in xdebug like this:
xdebug.remote_autostart = 1
then you can debug your console application.

Run a project from jetty in intellij with run time info outputted to a file

I have the following scenario:
I run my application in development mode and use jetty as the web server.Maven is used to build the application. Is it possible to output the run time log to a file instead of in the IntelliJ environment ?That is instead of viewing the information in the window with the red arrow pointing towards it I want to display it in a file.
You have a Logs tab in Jetty Server running configuration where you can choose to save console output to a file.