I am trying to debug a Grails 3.x application using grails run-app --debug-fork. But when the application starts it does not wait for the debugger to attach. Any solution on how to debug a Grails 3.x application?
Please use the --debug-jvm flag.
For example: grails --debug-jvm run-app
In IntelliJ you can right click the Gradle task bootRun and select Debug.
The other option is to directly run the Application class located in grails-app/init. It has a static void main and be run as a regular application. You can run it directly from your IDE with a debug profile.
In IntelliJ IDEA 2016.1, I create two configurations. This allows me to make solid use of all the context menus, etc. that IntelliJ IDEA offers. Here's how:
The first configuration is a "Run" configuration. Edit the default
configuration and in the "Command Line" field, enter
run-app --debug-jvm
The second configuration is a "Remote" configuration. On the "Run/Debug" dialog, click the + symbol and select "Remote" from the
list. Name it "Debug" and save.
Select your "Run" config from the config dropdown at the top and then click the green arrow to run the app. Monitor the console
output until you see the message
Listening for transport dt_socket at address: 5005.
Select the remote debug profile you created in step 2 and click the debug button. In a few moments the console output will say
Grails application running at http://localhost:8080 in environment: development.
Success!
Related
I'm using Aptana Studio 3 on Mac OS X (High Sierra). I have imported my Ruby on Rails project. My Project Natures are set up like this
I want to set up my Rails server so I can run it from the IDE (or debug with it). Oddly, the Run/Debug settings only include PHP ...
So how do I create a run configruation to run my server? When I right click my project, select "Run As" -> "Run Configurations", I see a screen like this. Not sure if this is the right screen to configure things or how to do it ...
You can run your server creating a run configuration or just creating a new Rails Server.
Creating a Run Configuration
In "Run Configurations" options, select Ruby Applications > New_configuration and then click in "Browse...". Type 'rails' to search for the rails file and select it inside "Matching resources". Click "Ok".
Then go to Tab "Arguments", set the working directory as the root folder of your project, and inside "Program Arguments" put the value "server" and click "Apply".
Now you can run or debug your application.
Creating a Rails Server
Go to Windows > Preferences > Aptana Studio > Web Servers and click in "New...".
Then select the option "Rails Server", choose the name of your server and click "Ok". If your project nature was not set to "Rails" the option "Project" would be empty here, and you would need to set the Rails nature first.
If you try to run the server like this you will receive an error telling that the program ".../script/rails" does not exist, so first you need to create a folder named "script" inside your project and paste the file "bin/rails" inside it (as explained here).
Now just click with the Right mouse button in your project and select "Run server".
I am getting this error. How to solve this.
Just tick the below checkbox "Allow Unauthorized Certificates" for appium versions 1.6.*
and make sure you are under "Automatic Server" tab
Go to automatic server option and start session . and give the right path of apk file. it is work for me
(appium server 1.7)
After searching and applying lots of solutions finally i did following settings for Successful Android appium app testing on windows machine.
Software:
As of now they have released appium-server and appium-inspector as two seperate softwares. I'm using latest version of repositories.
Appium server 1.22.0
Appium Inspector 2021.9.2
Appium Server Settings
Make sure you have the same settings shown in the images below.
Appium Inspector settings
Steps to start appium:
Start appium server first
Then Start appium Inspector (make sure you add desired capabilities manually otherwise below error msg will arrive if you pasted Json representation manually)
Failed to create session. An unknown server-side error occurred while
processing the command. Original error: You must include a
platformName capability.
After adding Representation it will look like below
{
"platformName": "android",
"deviceName": "emulator-5554",
"appPackage": "com.coswarden",
"appActivity": "ActivityHome"
}
Hope this will solve your error.
You can use UI AutomatorViewer to find the element in the application.
just install jdk8 because appium and uiautomator are compatible with java8 only problem will be solved. And follow below steps:
Right Click on the My Computer and Select the properties
Click on advanced system settings
Click on Environment Variables
Click on new Button of User variables
Type PATH in the Variable name.
Copy the path of bin folder which is installed in JDK folder.
Paste Path of bin folder in Variable value and click on OK Button.
You can follow a similar process to set CLASSPATH.
and restart your PC
Go to command prompt and type javac command and check java8 is installed properly or not.
And see whether android sdk has tools folder in it, In which uiautomator is present
For those who are still struggling to get started, I will add several screenshots to show the complete setup I have for Appium Server GUI, and Appium Inspector.
it's great news that Grails 3.2.1 now comes with an Angular2 profile, but I don't know how to use it.
The profile description tells me that there should be the standard command like create-domain-class, but when I create an app through
grails create-app test-ng --profile angular2
I get a working angular2 project, but it even seems that this project is not recognized as grails app. When I enter the grails cli, I only get the commands like create-app which are available outside of projects.
What am I doing wrong?
your grails create-app test-ng --profile angular2
command should have created three folders in your test-ng-project-folder:
client
gradle
server
change to server and start grails command
now you should have the wellknown grails project.
but i am still on the first steps of examining the new grails-profile. so i hope i could help you.
Nowadays this layout is called "multi-project". Separate 4 the client and server applications. To make things easier, the tasks test, integrationTest, and bootRun have been created in the client application to make executing those tasks easier across the whole application.
Since Gradle executes tasks synchronously, and the bootRun task will never finish, it is important to execute it in parallel. At the root of the project:
./gradlew bootRun --parallel
Opening things also separately by 2 instances of your IDE or preferred text processor.
see the docs
grails list-profiles
show list of available profiles, I suggest you use this because for example now angular2 profile is angular and angular1 is angularJS.
Grails-2.5.0 startup fails if fork mode is disabled.
I've found a workaround at https://jira.grails.org/browse/GRAILS-12129, which says;
Don't use the spring loaded java agent. Removing the following from the command started by IntelliJ is enough
But I cannot find where the command is written.
Run -> Edit Configurations doesn't have any option to disable agent.
Where should I edit?
If you open the run configuration you should see fields like Module, Command Line, VM options and more. So add this to the Command Line field
-noreloading -Ddisable.auto.recompile=true run-app
That should stop Grails from reloading your application.
I encountered several issue in importing grails project
After importing my grails project with GGTS 3.4.0 I can't do anything:
The import action action freezes at 50%, so I stop it.
'Update grails dependencies' action doesn't stop so I deselect the 'Keep external Grails running' option.
Clean and compile action triggered an an exception after a while:
"Problem executing: clean
The command 'C:\Program Files\Java\jdk1.7.0_45\bin\javaw.exe (23 déc. 2013 13:52:45)' was terminated because it didn't produce new output for some time.
See details for the output produced so far.
If you think the command simply needed more time, you can increase the time limit in the Grails preferences page.
See menu Windows >> Preferences >> Grails >> Launch"
It's really frustrating I could not do anything for several hours.
This topic follows this one: Install manually grails
Try with the lower version sts 3.3.0. I know this doesn't resolve the issue which you are facing but for sake of other workaround hope this helps.
http://dist.springsource.com/release/STS/3.3.0/dist/e3.8/groovy-grails-tool-suite-3.3.0.RELEASE-e3.8.2-win32-x86_64-installer.exe
Regards..