I'm using the Play2 Maven plugin for one of my project and when I tried to start or run my project using the mvn play2:run command, I get to see that the build was successful, but when I tried to access the application url, I do not see anything (probably a 404). Any ideas as what is wrong?
--- (Running the application from SBT, auto-reloading is enabled) ---
[info] play - Listening for HTTP on /0.0.0.0:9000
(Server started, use Ctrl+D to stop and go back to the console...)
[success] Total time: 1 s, completed Mar 16, 2014 4:55:43 PM
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 8.855s
[INFO] Finished at: Sun Mar 16 16:55:43 CET 2014
[INFO] Final Memory: 11M/114M
[INFO] ------------------------------------------------------------------------
It says to hit Ctrl+D to stop the server, but how can I stop a server that is probably not running? Is this a bug or am I doing something wrong?
Related
I have some tests written in Selenide/Java.
Also I have local Jenkins on my Windows, tests are running under this Jenkins perfectly, but i have problem with tests from same repository running on external Jenkins (Linux)
Logs from Jenkins:
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running [1mTests[m
ERROR StatusLogger No Log4j 2 configuration file found. Using default configuration (logging only errors to the console), or user programmatically provided configurations. Set system property 'log4j2.debug' to show Log4j 2 internal initialization logging. See https://logging.apache.org/log4j/2.x/manual/configuration.html for instructions on how to configure Log4j 2
1491 [main] INFO com.github.javafaker.Faker - Using default locale en
Jul 08, 2019 2:36:49 PM com.codeborne.selenide.drivercommands.LazyDriver getAndCheckWebDriver
INFO: No webdriver is bound to current thread: 1 - let's create a new webdriver
Jul 08, 2019 2:36:49 PM java.util.prefs.FileSystemPreferences$1 run
INFO: Created user preferences directory.
2687 [main] INFO io.github.bonigarcia.wdm.WebDriverManager - Reading https://chromedriver.storage.googleapis.com/ to seek chromedriver
3700 [main] INFO io.github.bonigarcia.wdm.WebDriverManager - Latest version of chromedriver is 76.0.3809.25
3704 [main] INFO io.github.bonigarcia.wdm.Downloader - Downloading https://chromedriver.storage.googleapis.com/76.0.3809.25/chromedriver_linux64.zip
4066 [main] INFO io.github.bonigarcia.wdm.Downloader - Extracting binary from compressed file chromedriver_linux64.zip
4194 [main] INFO io.github.bonigarcia.wdm.WebDriverManager - Exporting webdriver.chrome.driver as /var/lib/jenkins/.m2/repository/webdriver/chromedriver/linux64/76.0.3809.25/chromedriver
Starting ChromeDriver 76.0.3809.25 (a0c95f440512e06df1c9c206f2d79cc20be18bb1-refs/branch-heads/3809#{#271}) on port 28990
Only local connections are allowed.
Please protect ports used by ChromeDriver and related test frameworks to prevent access by malicious code.
Jul 08, 2019 2:36:52 PM com.codeborne.selenide.drivercommands.LazyDriver getAndCheckWebDriver
INFO: No webdriver is bound to current thread: 1 - let's create a new webdriver
Starting ChromeDriver 76.0.3809.25 (a0c95f440512e06df1c9c206f2d79cc20be18bb1-refs/branch-heads/3809#{#271}) on port 30572
Only local connections are allowed.
Please protect ports used by ChromeDriver and related test frameworks to prevent access by malicious code.
[ERROR] [1;31mTests [0;1mrun: [0;1m3[m, [1;31mFailures: [0;1;31m3[m, Errors: 0, Skipped: 0, Time elapsed: 5.878 s[1;31m <<< FAILURE![m - in [1mTests[m
[ERROR] test001_logowanie_programs(Tests) Time elapsed: 3.105 s <<< FAILURE!
java.lang.IllegalStateException: No webdriver is bound to current thread: 1. You need to call open(url) first.
at Tests.test001_logowanie_programs(Tests.java:38)
[ERROR] test002_logowanie_evaluation(Tests) Time elapsed: 0.058 s <<< FAILURE!
java.lang.IllegalStateException: No webdriver is bound to current thread: 1. You need to call open(url) first.
at Tests.test002_logowanie_evaluation(Tests.java:50)
[ERROR] test003_fail(Tests) Time elapsed: 0.159 s <<< FAILURE!
java.lang.IllegalStateException: No webdriver is bound to current thread: 1. You need to call open(url) first.
at Tests.test003_fail(Tests.java:67)
[INFO]
[INFO] Results:
[INFO]
[ERROR] [1;31mFailures: [m
[ERROR] [1;31m Tests.test001_logowanie_programs:38 » IllegalState No webdriver is bound to cu...[m
[ERROR] [1;31m Tests.test002_logowanie_evaluation:50 » IllegalState No webdriver is bound to ...[m
[ERROR] [1;31m Tests.test003_fail:67 » IllegalState No webdriver is bound to current thread: ...[m
[INFO]
[ERROR] [1;31mTests run: 3, Failures: 3, Errors: 0, Skipped: 0[m
[INFO]
[ERROR] There are test failures.
Please refer to /var/lib/jenkins/jobs/nawa_selenide/workspace/target/surefire-reports for the individual test results.
Please refer to dump files (if any exist) [date]-jvmRun[N].dump, [date].dumpstream and [date]-jvmRun[N].dumpstream.
[JENKINS] Recording test results
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 20.071 s
[INFO] Finished at: 2019-07-08T14:36:56+02:00
[INFO] Final Memory: 31M/330M
[INFO] ------------------------------------------------------------------------
Waiting for Jenkins to finish collecting data
[JENKINS] Archiving /var/lib/jenkins/jobs/nawa_selenide/workspace/pom.xml to com/nawa/1.0-SNAPSHOT/nawa-1.0-SNAPSHOT.pom
channel stopped
Finished: UNSTABLE
On every test we have: java.lang.IllegalStateException: No webdriver is bound to current thread:
Do You have experience with similar situation?
Why on local machine tests are done correctly, but on main Jenkins in company there are only failures caused by No webdriver is bound to current thread?
Only operating system is difference.
This is problem with jenkins configuration under Linux?
When I run the tests locally, using Jenkins (with Maven), I get the same message, but the WebDriver is actually created and runs my test cases.
My maven goals are: mvn clean test -Puat
Declaration of Chrome in tests:
#BeforeClass
public void setUp() throws Exception {
Configuration.holdBrowserOpen = false;
Configuration.browser = "chrome";
Configuration.timeout = 10000;
Configuration.headless = true;
SelenideLogger.addListener("AllureSelenide", new AllureSelenide().screenshots(true).savePageSource(true));
objReader.environmentPropertiesLoader();
}
_______________edit
Now i check Start Xvfb before the build, and shut it down after in Jenkins job Build Environment, i read that is very important, maybe xvfb is the cause, i dont know, now in console i have
java.io.IOException: Cannot run program "Xvfb": error=2, No such file or directory
Did anyone answer? You need to call open Url as the error says.
driver.open(URL HERE) at the end of your setup method.
this is my solution:
after open(), store current webDriver, and before use - restore webDriver
WebDriver webDriver;
// constructor
public SelenideCommand() {
Configuration.holdBrowserOpen = true;
Selenide.open("https://www.instagram.com/");
webDriver = WebDriverRunner.getWebDriver();
}
public void login(String userName, String password) {
WebDriverRunner.setWebDriver(webDriver);
Selenide.element(Selectors.byName("username")).setValue(userName);
Selenide.element(Selectors.byName("password")).setValue(password);
Selenide.elements(Selectors.byTagName("button")).get(1).click();
}
I am setting up jenkins foy my selenium scripts and when I am running the
jenkins, It is running the script on headless browser.
When I am running mvn test command on local , it opens the browser and start the scripts.
But on jenkins, It just show the below console without launching a browser
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running TestSuite
1554541558637 mozrunner::runner INFO Running command: "C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe" "-marionette" "-foreground" "-no-remote" "-profile" "C:\\WINDOWS\\TEMP\\rust_mozprofile.T3HA3HnEMbw5"
1554541560097 addons.webextension.screenshots#mozilla.org WARN Loading extension 'screenshots#mozilla.org': Reading manifest: Invalid extension permission: mozillaAddons
1554541560097 addons.webextension.screenshots#mozilla.org WARN Loading extension 'screenshots#mozilla.org': Reading manifest: Invalid extension permission: resource://pdf.js/
1554541560097 addons.webextension.screenshots#mozilla.org WARN Loading extension 'screenshots#mozilla.org': Reading manifest: Invalid extension permission: about:reader*
1554541567733 Marionette INFO Listening on port 58226
[Child 56144, Chrome_ChildThread] WARNING: pipe error: 109: file z:/task_1554038299/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 341
1554541568018 Marionette WARN TLS certificate errors will be ignored for this session
Apr 06, 2019 2:36:08 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: W3C
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 16.171 s - in TestSuite
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 20.523 s
[INFO] Finished at: 2019-04-06T14:36:12+05:30
[INFO] ------------------------------------------------------------------------
Finished: SUCCESS
When running Automation suite on Jenkin, it would not launch Browser physically. Jenkin execute tests in headless mode. You may not be able to see the results on Browser.
'Hello, I am new to Jboss pardon me if i am asking silly question. When I am trying to deploy one of the wildfly quickstart example. But i am facing with this error. If anyone can help me that would be very helpful to me.
Thanks in Advance
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources,
i.e. build is platform dependent!
[INFO] Copying 4 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.6.1:testCompile (default-testCompile) # switc
hyard-bpm-service ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.20:test (default-test) # switchyard-bpm-servi
ce ---
[INFO] Skipping execution of surefire because it has already been run for this c
onfiguration
[INFO]
[INFO] --- maven-bundle-plugin:2.4.0:bundle (default-bundle) # switchyard-bpm-se
rvice ---
[INFO]
[INFO] <<< wildfly-maven-plugin:1.0.2.Final:deploy (default-cli) < package # swi
tchyard-bpm-service <<<
[INFO]
[INFO]
[INFO] --- wildfly-maven-plugin:1.0.2.Final:deploy (default-cli) # switchyard-bp
m-service ---
May 19, 2017 4:22:04 PM org.xnio.Xnio <clinit>
INFO: XNIO version 3.2.2.Final
May 19, 2017 4:22:04 PM org.xnio.nio.NioXnio <clinit>
INFO: XNIO NIO Implementation Version 3.2.2.Final
May 19, 2017 4:22:04 PM org.jboss.remoting3.EndpointImpl <clinit>
INFO: JBoss Remoting version 4.0.3.Final
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 51.304 s
[INFO] Finished at: 2017-05-19T16:22:06+05:30
[INFO] Final Memory: 73M/350M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.wildfly.plugins:wildfly-maven-plugin:1.0.2.Fi
nal:deploy (default-cli) on project switchyard-bpm-service: Could not execute go
al deploy on C:\Company\wildfly-8.0.0.Final\quickstarts\bpm-service\target\switc
hyard-bpm-service.bundle. Reason: I/O Error could not execute operation '{
[ERROR] "operation" => "read-attribute",
[ERROR] "address" => [],
[ERROR] "name" => "launch-type"
[ERROR] }': java.net.ConnectException: JBAS012174: Could not connect to remote:/
/127.0.0.1:9999. The connection failed: Connection refused: no further informati
on
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionE
xception
C:\Company\wildfly-8.0.0.Final\quickstarts\bpm-service>'
I keep getting this errors (error code bellow) when I run jmeter tests through jenkins on remote slave machines :
[INFO] -------------------------------------------------------
[INFO] P E R F O R M A N C E T E S T S
[INFO] -------------------------------------------------------
[INFO]
[INFO]
[info]
[debug] JMeter is called with the following command line arguments: -n -t C:\Performance_Framework\Project\src\test\jmeter\Example.jmx -l C:\Performance_Framework\Project\target\jmeter\results\Example.jtl -d C:\Performance_Framework\Project\target\jmeter -L DEBUG -j C:\Performance_Framework\CMS\target\jmeter\logs\Example.jmx.log -r -R 10.0.20.100,10.0.20.101 -X -Djava.rmi.server.hostname 10.0.20.200 -Dsun.net.http.allowRestrictedHeaders true
[info] Executing test: Example.jmx
[info] Creating summariser <summary>
[info] Created the tree successfully using C:\Performance_Framework\Project\src\test\jmeter\Example.jmx
[info] Configuring remote engine: 10.0.20.100
[info] error unmarshalling return; nested exception is:
[info] java.lang.ClassNotFoundException: org.apache.jmeter.engine.RemoteJMeterEngineImpl_Stub (no security manager: RMI class loader disabled)
[info] Failed to configure 10.0.20.100
[info] Configuring remote engine: 10.0.20.101
[info] error unmarshalling return; nested exception is:
[info] java.lang.ClassNotFoundException: org.apache.jmeter.engine.RemoteJMeterEngineImpl_Stub (no security manager: RMI class loader disabled)
[info] Failed to configure 10.0.20.101
[info] Stopping remote engines
[info] Remote engines have been stopped
[info] Error in NonGUIDriver java.lang.RuntimeException: Following remote engines could not be configured:[10.0.20.100, 10.0.20.101]
[info] Completed Test: Example.jmx
Now my current POM settings for the machines:
<configuration>
--------------------------------
<propertiesSystem>
<java.rmi.server.hostname>10.0.20.200</java.rmi.server.hostname>
</propertiesSystem>
<remoteConfig>
<startServersBeforeTests>true</startServersBeforeTests>
<serverList>10.0.20.100,10.0.20.101</serverList>
<stopServersAfterTests>true</stopServersAfterTests>
</remoteConfig>
</configuration>
If I run the tests from JMETER GUI everything is ok, remote host start and execute the tests successfully.
I think that everything is set correctly, jmeter-server.bat is started before tests run on each slave.
Also there's something that I don't understand from this sentence on from jmeter maven plugin wiki :
runremote command being send to JMeter which will start up any remote
servers you have defined in your jmeter.properties when your first
test starts.
Which jmeter.properties file, of the project ?If yes, then i don't know how that could be defined as always the target folder is cleaned on every test run, that resulting jmeter properties file is derived.
Later Edit: I even created the jmeter.properties file and added in src/test/jmeter dir and defined there the remote hosts, but still nothing.
So what do you suggest guys?
I resolved somehow the issue with the connection by editing the jmeter-server file by adding also the java.rmi.server.hostname.
But what I don't like is the test execution time, it's horrible , even with one thread which is supposed to be be finished in less than 1-2 sec but it's still showing that is trying to receive shutdown message.
[INFO] -------------------------------------------------------
[INFO] P E R F O R M A N C E T E S T S
[INFO] -------------------------------------------------------
[INFO]
[INFO]
[info]
[debug] JMeter is called with the following command line arguments: -n -t C:\Performance_Framework\CMS\src\test\jmeter\Example.jmx -l C:\Performance_Framework\CMS\target\jmeter\results\Example.jtl -d C:\Performance_Framework\CMS\target\jmeter -L DEBUG -q C:\Performance_Framework\CMS\src\test\jmeter\jmeter.properties -j C:\Performance_Framework\CMS\target\jmeter\logs\Example.jmx.log -r -X -Djava.rmi.server.hostname 10.0.20.200 -Dsun.net.http.allowRestrictedHeaders true
[info] Executing test: SearchForModule.jmx
[info] Creating summariser <summary>
[info] Created the tree successfully using C:\Performance_Framework\CMS\src\test\jmeter\SearchForModule.jmx
[info] Configuring remote engine: 10.0.20.100
[info] Configuring remote engine: 10.0.20.101
[info] Starting remote engines
[info] Starting the test # Thu Jul 30 13:48:23 BST 2015 (1438260503717)
[info] Remote engines have been started
[info] Waiting for possible shutdown message on port 4445
Is something that is wrong on jenkins side, tomcat webapp?
First thing you need to fix are the server addresses:
https://github.com/jmeter-maven-plugin/jmeter-maven-plugin/wiki/Remote-Server-Configuration
10.0.x.100,10.0.x.101 are not correct IP addresses. This is what you can see in your error log.
I'am trying to deploy a war with jenkins of CloudBees. Sources are located on the Git repository of CloudBbees.
I can generate an deploy the war with the same sources code on my environment.
On the Jenkins of Cloudbees, the build is successful, but I got the following error at the deployment :
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) # mysite ---
[INFO] Deleting /scratch/jenkins/workspace/Deploy/target
[INFO]
[INFO] --- lutece-maven-plugin:3.0.2:site-assembly (default-cli) # mysite ---
[INFO] Assembly-site lutece-site artifact...
[INFO] Exploding webapp in /scratch/jenkins/workspace/Deploy/target/mysite-1.0.0-SNAPSHOT...
[INFO] Copying webapp files
[INFO] Local configuration directory is /home/jenkins/lutece/conf/mysite
[WARNING] Local configuration directory /home/jenkins/lutece/conf/mysite does not exist
[INFO] Building jar: /scratch/jenkins/workspace/Deploy/target/mysite.war
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 28.993s
[INFO] Finished at: Sat Mar 08 04:26:07 EST 2014
[INFO] Final Memory: 16M/202M
[INFO] ------------------------------------------------------------------------
Waiting for Jenkins to finish collecting data
[JENKINS] Archiving /scratch/jenkins/workspace/Deploy/pom.xml to fr.paris.lutece/mysite/1.0.0-SNAPSHOT/mysite-1.0.0-SNAPSHOT.pom
channel stopped
[cloudbees-deployer] Deploying as (jenkins) to the xxxx-xxxx account
[cloudbees-deployer] Deploying mysite
com.cloudbees.plugins.deployer.exceptions.DeploySourceNotFoundException: Cannot find source for mysite
at com.cloudbees.plugins.deployer.engines.Engine.perform(Engine.java:126)
at com.cloudbees.plugins.deployer.DeployPublisher.perform(DeployPublisher.java:103)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:795)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:767)
at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.post2(MavenModuleSetBuild.java:1030)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:716)
at hudson.model.Run.execute(Run.java:1690)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:519)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:246)
Build step 'Deploy applications' marked build as failure
Finished: FAILURE
The application ID mysite exists and is found in the Jenkins configuration.
What should I do ?
In the logs, I can't see the "archiving" phase of the .war file so I believe that your .war was not properly packaged. Did you define it properly in your pom.xml?
Also, check in your workspace/target if the .war was generated.