not able to debug play framework 2.6.x application in Scala IDE - scala-ide

I am new to Play, I have installed SBT 1.0.2, Scala IDE 4.6.1, from play documentation downloaded play-scala-starter-example project, i want to debug the project, i did following things.
set environment variables SBT_OPTS to -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=9999
tried to run the project with "sbt -jvm-debug 9999 run" but it gives "Not a valid command: jvm-debug"
ran it with "sbt run" and in Scala IDE, i created following configuration,
and added breakpoints in HomeController of sample project, but when i refresh the page running on port 9000 doesnt stop, and when i use "Scala Debugger (Socket Attach) it gives error "Failed to connect to remote VM. Connection timed out." Scala IDE Configuration

I was having trouble setting the enviroment on windows 10 play 2.6, the way I found for play to start listen to the debug port was adding in projectfolder\sbt-dist\conf\sbtconfig , after #Set the extra SBT options:
-Xdebug
-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=9999
though it will open socket every time you run sbt

1) Add sbt eclipse plugin in you project.sbt
addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "5.2.2")
2) Set the environment as for debugging follow
set SBT_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5555
sbt run
3) Attache debugger to remote application in eclipse as
i) In Eclipse, right-click your project, then choose Debug As -> Debug Configurations...
ii) Right-click Remote Java Application, then click New.
The host should already be set to localhost. Set the port to 5555 (the default port used by the play debug run command).
iii)Click Apply to save, then Debug to connect to your running Play instance

Related

Get frequent chrome driver error: driver config / start failed: chrome server returned empty list from http://localhost:(port) in karate standalone

I used to get frequent chrome driver error in karate UI tests. I have been using karate tests in VS code for the past 5 months. Now, I used to get driver config / start failed: chrome server returned empty list from http://localhost:[port] frequently. Sometimes, I need to run 20 times to run the same test to succeed. All other runs throws either "driver config / start failed: chrome server returned empty list" / "ERROR com.intuit.karate - evaluation of 'karate-config.js' failed: javascript function call failed"
I have installed chrome multiple times but I get the same error. Also I have re-imaged my laptop due this issue and through something went wrong. Even now I used to get the above errors often.
I have installed Chrome 64 bit in windows laptop, it get installed in "C:\Program Files\Google\Chrome\Application\chrome.exe" but karate standalone will always check the Chrome path "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" in runtime which doesn't exists.
Note: I have set the chrome.exe installed path in my system environment PATH but karate not considering the path variable. Please advise me on this.
So I have modified the driver config as given below:-
* configure driver = { type: 'chrome', headless: true }
[To]
* configure driver = { type: 'chrome', executable: 'C:/Program Files/Google/Chrome/Application/chrome.exe', headless: true }
Karate version: 0.9.6.RC3
OS : Windows 10 Home
JDK Version
openjdk version "11" 2018-09-25
OpenJDK Runtime Environment 18.9 (build 11+28)
OpenJDK 64-Bit Server VM 18.9 (build 11+28, mixed mode)
Chrome Driver config
configure driver = { type: 'chrome', executable: 'C:/Program Files/Google/Chrome/Application/chrome.exe', headless: true }
Chrome Driver Errors
testui.feature:8 - driver config / start failed: chrome server returned empty list from http://localhost:54311, options: {type=chrome, executable=C:/Program Files/Google/Chrome/Application/chrome.exe, headless=true, target=null}
ERROR com.intuit.karate - evaluation of 'karate-config.js' failed: javascript function call failed:
[1.1:33] test_page.feature:9 - driver config / start failed: chrome server returned empty list from http://localhost:55676, options: {type=chrome, executable=C:/Program Files/Google/Chrome/Application/chrome.exe, headless=true, target=null}
ERROR com.intuit.karate - evaluation of 'karate-config.js' failed: javascript function call failed:
[1.1:33] test_page.feature:11 - evaluation (js) failed: input('#username', 'admin'), failed to get reply for: [id: 23, method: Input.dispatchKeyEvent, params: {modifier=0, type=keyDown, text=k}]
Please guide me how to resolve this issue.
Thanks,
Chandra
I was same error. Actually its finding chrome.exe in different location where actually its not located.
In default it's looking at "C:/Program Files (x86)/Google/Chrome/Application/chrome.exe"
but actual path was 'C:/Users/ues/AppData/Local/Google/Chrome/Application/chrome.exe'
So check your chrome.exe path.
Hope it's helpful.
I have solved my problem by defining in the config file as;
"karate.configure('driver', { type: 'chrome', port: 9222,
executable: 'C://Program Files//Google//Chrome//Application//chrome.exe' });"
maybe assigning a port help me to solve the issue but one thing to consider here is that u need to use forward slashes in the executable command.
No one else has reported this, so you'll need to figure this out maybe with the help of someone who can troubleshoot your machine. Maybe there are some permission restrictions. Maybe your old processes are still running, so make sure you go to your task manager and kill them etc, this is quite common on Windows.
And please upgrade to 1.0 before trying anything else, because that may help: https://github.com/intuit/karate/wiki/1.0-upgrade-guide
Otherwise we will need your help to maybe debug and suggest changes to the framework. Ideally you should contribute code to Karate, and remember - it is an open source project. If you are able to replicate your problems, follow this process: https://github.com/intuit/karate/wiki/How-to-Submit-an-Issue - but I'm not sure that is possible with the kinds of issues you are describing.
If none of the above options work, you may need to consider switching to some other framework.
EDIT: most teams run on CI + Docker which is much more stable: https://stackoverflow.com/a/62325328/143475

org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:

Code use:
enter code here
ProfilesIni profile = new ProfilesIni();
FirefoxProfile ffprofile = profile.getProfile("Other");
WebDriver driver = new FirefoxDriver(ffprofile);
driver.get("http://google.com");
:Run the source the Firefox page open but google.com not opening error
org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
reg-app-global","addons":{"fiddlerhook#fiddler2.com":{"descriptor":"C:\\Program Files (x86)\\Fiddler2\\FiddlerHook","mtime":1409222185915,"rdfTime":1406724252000}}},{"name":"app-global","addons":{"{972ce4c6-7e08-4474-a285-3208198ce6fd}":{"descriptor":"C:\\Program Files (x86)\\Mozilla Firefox\\browser\\extensions\\{972ce4c6-7e08-4474-a285-3208198ce6fd}","mtime":1411627483703,"rdfTime":1411627483531}}},{"name":"app-profile","addons":{"fxdriver#googlecode.com":{"descriptor":"C:\\Users\\RT-13\\AppData\\Local\\Temp\\anonymous3444483664614526613webdriver-profile\\extensions\\fxdriver#googlecode.com","mtime":1411630550698,"rdfTime":1411630550495}}}]
1411630550942 addons.xpi-utils DEBUG Opening XPI database C:\Users\RT-13\AppData\Local\Temp\anonymous3444483664614526613enter code herewebdriver-profile\extensions.json
1411630550943 addons.xpi DEBUG New add-on fxdriver#googlecode.com installed in app-profile
*** Blocklist::_loadBlocklistFromFile: block`enter code here`list is disabled
1411630551091 addons.xpi-utils DEBUG Make addon app-profile:fxdriver#googlecode.com visible
1411630551094 DeferredSave.extensions.json DEBUG Save changes
1411630551095 DeferredSave.extensions.json DEBUG Save changes
1411630551095 addons.xpi DEBUG New add-on {972ce4c6-7e08-4474-a285-3208198ce6fd} installed in app-global
1411630551098 addons.xpi-utils DEBUG Make addon app-global:{972ce4c6-7e08-4474-a285-3208198ce6fd} visible
1411630551098 DeferredSave.extensions.json DEBUG Save changes
1411630551098 DeferredSave.extensions.json DEBUG Save changes
1411630551098 addons.xpi DEBUG New add-on fiddlerhook#fiddler2.com installed in winreg-app-global
Please downgrade the Firefox version to 31 and add the latest selenium standalone server 2.43 library into the build path. This is a common issue that every one face at least once in a week:)
Solution -
1) Upgrade your Selenium Server i.e. selenium jar "selenium-server-standalone-2.xx.x.JAR" TO "selenium-server-standalone-2.45.0.JAR"
2) Upgrade your Selenium Client Driver i.e. selenium libs folder "selenium-java-2.xx.x" TO "selenium-java-2.45.0"
3) Check and Install compatible version of Firefox
This will RESOLVE your problem.. Cheers !!
Refer - Download updated selenium libs & jar i.e. Version 2.45.0

IntelliJ IDEA 13.1 debug throws Unable to open debugger port error for Play 2.3.x on Windows 7

We are using Play 2.3.x for our web application. I wanted to debug the server side code, so performed the following
steps on Windows 7 machine
1) Set the JAVA_OPTIONS to "-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=9999"
2) On IntelliJ IDE : Run > Edit Configurations > Created a configuration with name "myserverdebug" with values ( transport : socket , debugger mode : attach , port : 9999 , host : localhost , modules class path : our project) and apply
3) Run > Debug > Select "myserverdebug"
Then the error thrown is :
Error running ServerDebugTests: Unable to open debugger port : java.net.ConnectException "Connection refused: connect**
Can some one tell me how to resolve this connection port error on Windows 7 ( not Linux )?
debugging changed in play 2.3. Just start activator with -jvm-debug 9999.
Afterwards your debug configuration should work.

Could not start Jmeter properly

I am trying to run jmeter on linux machine. Its throwing this warning and jmeter is
not working properly.
[warning] /usr/bin/jmeter: No JAVA_CMD set for run_java, falling back to JAVA_CMD = java
java.lang.Throwable: Could not access /usr/share/jmeter/lib/junit
at org.apache.jmeter.NewDriver.<clinit>(NewDriver.java:97)
I have already installed JUNIT and JDBC.MYSQL Connector.
Also, When i am setting TEST USERS , it is not showing JDBC Configuration window.
I want to know what i am missing.
you may have to create a symbolic link from /usr/share/jmeter/lib/junit to your installation of junit.

xcode: Mysql connector library not work on iphone5 (armv7s) ,any solution?

I built my App using Mysql Connector/C to connect a remote Mysql database, its works fine on the simulator (no errors, no warnings) but when i try to run it on my device (iphone5) i got this error:
No architectures to compile for (ARCHS=armv7 armv7s, VALID_ARCHS=armv7 armv7s)
i tried -as in some answers- to change setting (Architectures - Build Active Architectures- Valid Architectures) but the error still, only when i change the setting (Architectures & Valid Architectures) to "armv6" its build without error but many warnings appears says:
warning: no rule to process file '(my App dir)/main.m' of type sourcecode.c.objc for architecture armv6
and also for all .m files, when i tried to start the App i got message:
Xcode cannot run using selected device
I know that the Connector library need to update , but are there any solution ?
your need compile the connector lib in xcode for iOS (armv6, armv7, armv7s, i386), then use lipo tool to combine output libs.
direct connect your mysql in app is not safe, a suggest way is setup a Apache+PHP+MySQL server, then on iPhone useing ASIHTTPRequest to connect your server.