RemoteSwingLibraryTimeoutError: Agent port not received before timeout - java

I am trying to run a basic robotframework test with RemoteSwingLibrary, but I can't seem to get it to work.
I was able to run the following test just fine with SwingLibrary:
*** Settings ***
Library SwingLibrary
*** Test Cases ***
Foobar Test
Start Application fully.qualified.name.of.my.class
I am running it from within Eclipse via the robot framework standalone jar. I put robotframework-3.0.2.jar and swinglibrary-1.9.7.jar on my class path, created a new run configuration using my projects default classpath with the main class being org.robotframework.RobotFramework. In the arguments, I specify the name of my test file.
So, that seems to work fine. Then I tried to do almost exactly the same thing with RemoteSwingLibrary:
*** Settings ***
Library RemoteSwingLibrary
*** Test Cases ***
Foobar Test
Start Application my_app java fully.qualified.name.of.my.class
I replaced the swinglibrary jar on my classpath with remoteswinglibrary-2.2.1.jar and I ran the same test. The output says:
console: Failed to install '': java.nio.charset.UnsupportedCharsetException: cp0.
==============================================================================
Remotetest
==============================================================================
Foobar Test | FAIL |
RemoteSwingLibraryTimeoutError: Agent port not received before timeout
------------------------------------------------------------------------------
Remotetest | FAIL |
1 critical test, 0 passed, 1 failed
1 test total, 0 passed, 1 failed
==============================================================================
Output: C:\<path>\output.xml
Log: C:\<path>\log.html
Report: C:\<path>\report.html
(note that the "console: Failed to install..." part is normal and I don't think I need to be concerned about it)
When I dig into the report for the Start Application Keyword, it says
13:48:40.070 INFO Link to stdout
13:48:40.070 INFO Link to stderr
13:48:40.070 INFO -javaagent:"C:<pathToProject>\__pyclasspath__"=127.0.0.1:63110
13:48:40.071 INFO Starting process:
java fully.qualified.name.of.my.class
13:49:40.145 INFO Failed to start application: Traceback (most recent call last):
File "__pyclasspath__/RemoteSwingLibrary.py", line 307, in start_application
File "__pyclasspath__/RemoteSwingLibrary.py", line 353, in _application_started
File "__pyclasspath__/RemoteSwingLibrary.py", line 373, in _get_agent_address
RemoteSwingLibraryTimeoutError: Agent port not received before timeout
13:49:40.155 INFO Waiting for process to complete.
13:49:40.165 INFO Process completed.
13:49:40.165 INFO STDOUT: Error occurred during initialization of VM
agent library failed to init: instrument
13:49:40.175 INFO STDERR: Error opening zip file or JAR manifest missing : C:<pathToProject>\__pyclasspath__
Picked up JAVA_TOOL_OPTIONS: -javaagent:"C:<pathToProject>\__pyclasspath__"=127.0.0.1:63110
Picked up _JAVA_OPTIONS: -Djava.security.policy="C:\<UserFolder>\
AppData\Local\Temp\2\grant_all_f_vfit.policy"
13:49:40.195 FAIL RemoteSwingLibraryTimeoutError: Agent port not received before timeout
I'm not sure if this hunch is really founded on anything, but my suspicion is that there's a classpath issue. I would think that when I call the Start Application keyword with "java fully.qualified.name.of.my.class" I would probably have to pass along my classpath. I was hoping that maybe I wouldn't since the non-remote version seems to handle that just fine (probably because its running my app in the same JVM as I launched robot framework in, and that already included everything I needed in my classpath).
So if that's the issue, I can probably fix it by using the -cp option in my java command. However, the classpath for this particular project is actually quite long (my project is dependent on a lot of other projects) and I would rather not have to list it all out. Also, when I add a new dependency down the road, I would rather not have to update the classpath in my test file as well.
Is there some magic way that I can pass the current classpath along to the remote app? Or perhaps some other solution to this problem?
Update
I tried again with -cp and my giant classpath and it gave me the same errors, so its possible that my classpath has nothing to do with whatever is going on.
I also tried specifying the port number explicitly and it gives me slightly different output (though it still doesn't work). I also discovered that there's a debug setting that gives a little more detail. Here's me new setup:
*** Settings ***
Library RemoteSwingLibrary debug=True port=8242
*** Test Cases ***
Foobar Test
Start Application my_app java -cp <classpath> <fully.qualified.name.of.my.class> remote_port=8242
And here is my new output:
13:48:40.070 INFO Link to stdout
13:48:40.070 INFO Link to stderr
13:48:40.070 DEBUG Picked old JAVA_TOOL_OPTIONS=''
13:48:40.070 DEBUG Picked old _JAVA_OPTIONS=''
13:48:40.070 INFO -javaagent:"C:<pathToProject>\__pyclasspath__"=127.0.0.1:51509:DEBUG
13:48:40.070 DEBUG Set JAVA_TOOL_OPTIONS='-javaagent:"C:<pathToProject>\__pyclasspath__"=127.0.0.1:8242:APPORT=8242:DEBUG'
13:48:40.070 DEBUG SET _JAVA_OPTIONS='-Djava.security.policy="C:\<UserFolder>\AppData\Local\Temp\4\grant_all_haud6t.policy"'
13:48:40.071 INFO Starting process:
java -cp <classpath> <fully.qualified.name.of.my.class>
13:48:40.071 DEBUG Process configuration:
cwd: C:<PathToProject>
shell: True
stdout: C:<PathToProject>\<someBigPath>.txt
stderr: C:<PathToProject>\<someBigPath>.txt
alias: my_app
env: None
13:48:40.100 DEBUG Returned old JAVA_TOOL_OPTIONS=''
13:48:40.100 DEBUG Returned old _JAVA_OPTIONS=''
13:48:40.102 INFO connection to started application at 127.0.0.1:8242
13:48:40.120 DEBUG remote swinglibrary instantiated
13:48:40.121 DEBUG remote services instantiated
13:48:40.121 INFO waiting for api at 127.0.0.1:8242
13:49:40.145 INFO Failed to start application: Traceback (most recent call last):
File "__pyclasspath__/RemoteSwingLibrary.py", line 307, in start_application
File "__pyclasspath__/RemoteSwingLibrary.py", line 357, in _application_started
File "__pyclasspath__/RemoteSwingLibrary.py", line 344, in _wait_for_api
RuntimeError: Connecting to api at 127.00.1:8242 has failed: ''
13:49:40.155 INFO Waiting for process to complete.
13:49:40.165 INFO Process completed.
13:49:40.165 INFO STDOUT: Error occurred during initialization of VM
agent library failed to init: instrument
13:49:40.175 INFO STDERR: Error opening zip file or JAR manifest missing : C:<pathToProject>\__pyclasspath__
Picked up JAVA_TOOL_OPTIONS: -javaagent:"C:<pathToProject>\__pyclasspath__"=127.0.0.1:8242:APPORT=8242:DEBUG
Picked up _JAVA_OPTIONS: -Djava.security.policy="C:\<UserFolder>\
AppData\Local\Temp\2\grant_all_f_vfit.policy"
13:49:40.195 FAIL Connecting to api at 127.0.0.1:8242 has failed: ''
13:49:40.195 DEBUG Traceback (most recent call last):
File "__pyclasspath__/RemoteSwingLibrary.py", line 498, in run_keyword
File "__pyclasspath__/RemoteSwingLibrary.py", line 307, in start_application
File "__pyclasspath__/RemoteSwingLibrary.py", line 357, in _application_started
File "__pyclasspath__/RemoteSwingLibrary.py", line 344, in _wait_for_api
Yet another update
I think that this may have something to do with the "__pyclasspath__" that shows up in the error message. I put my java command in a .bat file preceded by a "set" command to list my environment variables. I can run the .bat file from the command line just fine (it launches the java app).
Then I modified my .robot file to do:
Foobar Test
Start Application my_app cd robotframework/tests && Run.bat remote_port=8242
I get essentially the same error output that I got before:
Error opening zip file or JAR manifest missing : C:<pathToProject>\__pyclasspath__
Picked up JAVA_TOOL_OPTIONS: -javaagent:"__pyclasspath__"=127.0.0.1:8242:APPORT=8242:DEBUG
Picked up _JAVA_OPTIONS: -Djava.security.policy="C:\\AppData\Local\Temp\1\grant_all_lgirs7.policy"
The environment that my batch script prints out appears the same except for JAVA_TOOL_OPTIONS and _JAVA_OPTIONS (which match with what the error output says). There is no environment variable called __pyclasspath__ so I'm wondering if that's the issue.
I set JAVA_TOOL_OPTIONS in my cmd environment to match the output that I saw from my robot run and now I get the same error message when I try to run my .bat script from the command line, so that environment variable seems to be the issue.

Well, I came up with a fix, though its definitely not an ideal fix.
I found out that when the framework kicks of my remote app, it sets:
JAVA_TOOL_OPTIONS=-javaagent:"C:\<pathToProject>\__pyclasspath__
But __pyclasspath__ is not actually an environment variable. I figured out that the javaagent has to point to the remote framework library, so I decided to just set it explicitly.
So now I changed my robot file to something like this:
*** Settings ***
Library RemoteSwingLibrary
*** Test Cases ***
Foobar Test
Start Application my_app run.bat remote_port=1234
And then made a file called run.bat that does:
set JAVA_TOOL_OPTIONS=-javaagent:"C:\<pathToProject\lib\remoteswinglibrary-2.2.1.jar"=127.0.0.1:1234:APPORT=1234
java -cp <classPath> fully.qualified.name.of.class
This is obviously sort of a hacky solution and it will take a little work to make it portable (I'll need to get rid of the hardcoded "pathToProject" and also make it support Linux environments as well). It also requires hardcoding in a port, whereas it would be nice if the robotframework could just select a port for me.
So, I would definitely like to see a better solution if anyone can find one, but for now, this will at least work.

Related

WebDriverManager is pulling chrome browser version from a default path regardless of settings

I've tried everything I can think of to get WebDriverManager to detect the correct version of the chrome browser that I can think of, nothing works. I want to detect the browser driver version from the chrome.exe located at C:\Program Files\Google\Chrome Beta\Application. However, no matter what I do it runs the following command to detect the version:
io.github.bonigarcia.wdm.versions.Shell - Running command on the shell: [cmd.exe, /C, wmic, datafile, where, name="%PROGRAMFILES(X86):\=\\%\\Google\\Chrome\\Application\\chrome.exe", get, Version, /value]
I have tried so far:
For all the below:
sBrowserBinaryLocation = "C:\Program Files\Google\Chrome Beta\Application";
setting
options.setBinary(sBrowserBinaryLocation);
WebDriverManager.chromedriver().clearDriverCache().setup();
Setting:
options.setBinary(sBrowserBinaryLocation);
WebDriverManager.chromedriver().clearDriverCache().arch64().setup();
Setting:
options.setBinary(sBrowserBinaryLocation);
WebDriverManager.chromedriver().clearDriverCache().browserVersionDetectionCommand(sBrowserBinaryLocation + " --version").arch64().setup();
Every one of those produced the same
io.github.bonigarcia.wdm.versions.Shell - Running command on the shell: [cmd.exe, /C, wmic, datafile, where, name="%PROGRAMFILES(X86):\=\\%\\Google\\Chrome\\Application\\chrome.exe", get, Version, /value]
Which picked up the non-beta version 99. How do I tell WebDriverManager to use "C:\Program Files\Google\Chrome Beta\Application" rather than "C:\Program Files(x86)\Google\Chrome\Application"?
Although it is tricky, it can be done using the WebDriverManager method browserVersionDetectionCommand(). Supposing that Chrome Beta is in this path:
C:\Program Files\Google\Chrome Beta\Application\chrome.exe
... we need to run the following command in the shell:
cmd.exe /C wmic datafile where name="%PROGRAMFILES:\=\\%\\Google\\Chrome Beta\\Application\\chrome.exe" get Version /value
The problem is that, when running this command in Java, the blank space (in "Chrome Beta" folder) makes this command to be interpreted incorretly. The solution is to find the Windows path name using the ~ sintax. You can discover these names by running dir /X in the Windows shell (e.g, C:\Program Files becomes C:\PROGRA~1).
You can see a test using this feature here. The traces of this test are as follows:
2022-03-23 13:35:00 [main] DEBUG i.g.bonigarcia.wdm.versions.Shell.runAndWaitArray(65) -- Running command on the shell: [cmd.exe, /C, wmic, datafile, where, name="C:\\PROGRA~1\\GOOGLE\\CHROME~1\\APPLIC~1\\CHROME.EXE", get, Version, /value]
2022-03-23 13:35:00 [main] DEBUG i.g.bonigarcia.wdm.versions.Shell.runAndWaitArray(69) -- Result: Version=100.0.4896.46
2022-03-23 13:35:00 [main] DEBUG i.g.b.wdm.versions.VersionDetector.getDriverVersionFromRepository(127) -- Latest version of chromedriver according to https://chromedriver.storage.googleapis.com/LATEST_RELEASE_100 is 100.0.4896.20
2022-03-23 13:35:00 [main] INFO i.g.bonigarcia.wdm.WebDriverManager.resolveDriverVersion(1093) -- Using chromedriver 100.0.4896.20 (resolved driver for Chrome 100)
2022-03-23 13:35:00 [main] DEBUG i.g.b.wdm.cache.ResolutionCache.putValueInResolutionCacheIfEmpty(119) -- Storing resolution chrome=100 in cache (valid until 14:35:00 23/03/2022 CET)
2022-03-23 13:35:00 [main] DEBUG i.g.b.wdm.cache.ResolutionCache.putValueInResolutionCacheIfEmpty(119) -- Storing resolution chrome100=100.0.4896.20 in cache (valid until 13:35:00 24/03/2022 CET)
2022-03-23 13:35:00 [main] DEBUG i.g.bonigarcia.wdm.WebDriverManager.manage(1049) -- Driver chromedriver 100.0.4896.20 found in cache
2022-03-23 13:35:00 [main] INFO i.g.bonigarcia.wdm.WebDriverManager.exportDriver(1148) -- Exporting webdriver.chrome.driver as C:\Users\boni\.cache\selenium\chromedriver\win32\100.0.4896.20\chromedriver.exe

How can I deploy cloudfoundry-uaa as a docker image based on tomcat?

We were using the cf-uaa's gradle tasks to create a docker image but those have been removed in the latest version. I've loaded the war in a recent version, but the service does not seem to be starting correctly.
I've been building the war from the v74 tag, adding it to tomcat:8.5.45-jdk12-openjdk-oracle or tomcat:9.0.24-jdk12-openjdk-oracle, and setting the various env vars that we were passing in to the previous image. I'm not seeing any log entries after the initial tomcat output stating that my war has been deployed and the server startup time.
The Dockerfile is basically just an adaptation of what was being passed in the previous image:
FROM tomcat:8.5.45-jdk12-openjdk-oracle
#FROM tomcat:9.0.24-jdk12-openjdk-oracle
ENV LOGIN_CONFIG_URL WEB-INF/classes/required_configuration.yml
ENV UAA_CONFIG_PATH /uaa
RUN bash -c "rm -r /usr/local/tomcat/webapps/ROOT"
RUN bash -c "rm -r /usr/local/tomcat/webapps/host-manager"
RUN bash -c "rm -r /usr/local/tomcat/webapps/manager"
RUN bash -c "rm -r /usr/local/tomcat/webapps/examples"
RUN bash -c "rm -r /usr/local/tomcat/webapps/docs"
ADD *.war /usr/local/tomcat/webapps/uaa.war
RUN bash -c "echo $LOGIN_CONFIG_URL"
EXPOSE 8080
I would expect to see the service responding to my requests, or some errors in the log indicating that the war failed to deploy. I am not currently getting any log output generated from the application code. When I send a request to the service, the response is a 500 with the an error header from the service.
X-Cf-Uaa-Error:Server failed to start. Possible configuration error.
update: I've located the uaa logs within .../tomcat/logs/uaa.log I'm not seeing anything indicating that the service failed to deploy, but I am also not seeing anything to indicate that it is picking up the env vars I have set in the container. I recreated the service using the war from the original setup which started successfully using the uaa.yml which I mounted as a volume. Comparing the logs, the original setup's first log entry is YamlProcessor which does not show up in the v75 logs at all. In fact, no debug entries show up at all, which suggests to me that my LOG_LEVEL env var is not propagating either.
Update 2: We reverted the image base to FROM tomcat:8.5-jre8 and started seeing flyway errors in the uaa.log. Our previous datasource url format was url: jdbc:postgresql://${POSTGRES_NAME}:5432/${DB}?currentSchema=uaa which caused a flyway exception. After removing the schema reference, it created the tables in the public schema. By creating the uaa schema manually before starting the service, it was able to run with the original format. The flyway version has updated, so perhaps there something new that needs to be set.
The application seems to be running, but when I try to get a token at /uaa/oauth/token I get a 500 with this error in the logs: Caused by: java.lang.NoSuchMethodError: java.nio.CharBuffer.limit(I)Ljava/nio/CharBuffer;
Since Jan 2021, UAA server docker images is now be available on cloudfoundry/uaa dockerhub repository.
docker pull cloudfoundry/uaa:75.0.0
See its Dockerfile for more details.
Can you try following ?
https://github.com/hortonworks/docker-cloudbreak-uaa
This works very well.

552 5.3.4 Error: message file too big

I have created a .bat file i.e. launchMonthlyreport.bat to launch monthly report (2 excel files) email sending using JavaMail in my application.
launchMonthlyreport.bat
java -Xms128m -Xmx256m -Dlog4j.configuration="..\\conf\\log4j_batch_sendmailmonthlyreport.xml" -jar "X.jar" BATCH_REPORT_FR
NOTE: Its working properly by manually running the launchMonthlyreport.bat file on the server.
i.e No JavaMail error (message file too big)
But I need to run the bat file periodically i.e monthly.
So I'm using JENKINS to run the launchMonthlyreport.bat periodically using the cron job
But I'm getting the following error while trying to build the job
ERROR:
D:\PROJ\TEST_FOLDER\test>java -Xms128m -Xmx256m -Dlog4j.configuration="..\\conf\\log4j_batch_sendmailmonthlyreport.xml" -jar "X.jar" BATCH_REPORT_FR
INFO - Start for batch type = BATCH_REPORT_FR
INFO - [MONTHLY_BATCH_REPORT_FR]-[EXECUTE_REPORTS] Report for A attached
INFO - [MONTHLY_BATCH_REPORT_FR]-[EXECUTE_REPORTS] Report for B attached
INFO - [MAIL] - [SENDER] Sender email address: XYZ#gmail.com
INFO - [MAIL] - [RECIPIENT] Recipient email address: xyz#gmail.com
ERROR - sentMail Error
com.sun.mail.smtp.SMTPSendFailedException: 552 5.3.4 Error: message file too big
at com.sun.mail.smtp.SMTPTransport.issueSendCommand(SMTPTransport.java:2057)
at com.sun.mail.smtp.SMTPTransport.finishData(SMTPTransport.java:1862)
at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1100)
at javax.mail.Transport.send0(Transport.java:195)
at javax.mail.Transport.send(Transport.java:124)
at com.lib.service.tool.impl.MailServiceImpl.sentMail(MailServiceImpl.java:39)
at com.batch.general.BatchReportFR.executeReports(BatchReportFR.java:107)
at com.batch.general.BatchReportFR.run(BatchReportFR.java:57)
at com.batch.general.Launcher.main(Launcher.java:16)
It's giving problem only through running through jenkins.
I think that server is telling that the message is too big. If yes, what configuration I need to add to increase the size limit ?
Any suggestions are most welcome.

"Uncaught Could not connect" error when using Openshift to deploy .war for PHP/Java bridge

Problem: Recieve 'Could not connect' error when using Openshift to deploy .war for PHP/Java bridge
Below I describe every step I've taken to get to this error, thanks in advance.
Full error: (IP concealed)
"Fatal error: Uncaught Could not connect to the JEE server W.X.Y.Z:8080. Please start it. Or define('JAVA_HOSTS',9267); define('JAVA_SERVLET',false); before including 'Java.inc' and try again. Error message: Connection refused (111) thrown in /home/stevenw1/public_html/softwareProject/real/inc/Java.inc on line 989"
Players: "Java_Bridge.war" = my java .war file that php will use to call methods from
"W.X.Y.Z" = Unchanging IP address of deployed .war file
"GUIProfile" = a Java class with #WebServlet("/GUIProfile") as public class GUIProfile extends HttpServlet
"tomcattest.php" = test file that calls GUIProfile's static method 'validate'
Deployed Java_Bridge.war and tomcattest.php work fine on my local tomcat, just not yet on Openshift.
Senario:
0. followed command line steps from Openshift 2012 java tomcat application
1. Using Openshift's rhc I have created my first app using "rhc app create -a tomcat6 -t jbossews-1.0"
2. cd ~/tomcat6/; git rm -rf ./src/ pom.xml
3. cp ~/Java_Bridge.war ./webapps/; git add ./webapps/Java_Bridge.war; git commit -m "first try"; git push
//notable output includes:
remote: Stopping jbossews cartridge
remote: Sending SIGTERM to jboss:386662 ...
remote: Skipping Maven build due to absence of pom.xml
remote: Preparing build for deployment
remote: Deployment id is bd83d6eb
remote: Activating deployment
remote: + '[' Java_Bridge.war ']'
remote: Starting jbossews cartridge
remote: Found W.X.Y.Z:8080 listening port //(not actual IP)
remote: Git Post-Receive Result: success
remote: Activation status: success
remote: Deployment completed with status: success
to ssh://thisisnottheactualuser#tomcat6-notthenamehereeither.rhcloud.com
4. Thinking the .war was deployed I ran a tomcattest.php that calls a java method 'validate', from java class GUIProfile that extends httpservlet, using the php/java bridge Java.inc
//of course using the same IP from above...
cat tomcattest.php;
<?php
define("JAVA_HOSTS", "W.X.Y.Z:8080");
define("JAVA_SERVLET", "/Java_Bridge/GUIProfile");
require_once("Java.inc");
$valiationOutput = java_context()->getServlet()->validate("hello");
echo $valiationOutput;
?>
EDIT: later tried this also in all instances: same results exactly
cat alternatetest.php
<?php
define("JAVA_HOSTS", "W.X.Y.Z:8080");
require_once("Java.inc");
echo java("java.lang.System")->getProperties();
?>
The output of calling tomcattest.php is the 'Fatal error' you see at the top.
Double Check:
5. ssh thisisnottheactualuser#tomcat6-notthenamehereeither.rhcloud.com
6. env | grep "IP"
OPENSHIFT_JBOSSEWS_IP=W.X.Y.Z
7. env | grep "PORT"
OPENSHIFT_JBOSSEWS_HTTP_PORT=8080
OPENSHIFT_JBOSSEWS_JPDA_PORT=8787
8. changed port in tomcattest.php to 8787, didn't change a thing of course.
9. restarted from the top, this time keeping ./src/ & pom.xml, same 'Deployment completed with status: success', same error using tomcattest.php with new listening IP...
10. tried solution from 'openshift youtube vid 2012' seemingly outdated. Followed step by step:
onced ssh'ed, no "tomcat" dir, I used cd $OPENSHIFT_DATA_DIR instead to access data dir
wget tomcat, changed ports to >15000, sh startup.sh && tail -f ../logs/*
notable errors in the result include:
SEVERE: Failed to initialize connector [Connector[AJP/1.3-15009]]
org.apache.catalina.LifecycleException: Failed to initialize component
[Connector[AJP/1.3-15009]] SEVERE: Failed to initialize connector
[Connector[AJP/1.3-15009]] org.apache.catalina.LifecycleException:
Failed to initialize component [Connector[AJP/1.3-15009]] SEVERE:
Failed to initialize end point associated with ProtocolHandler
["ajp-bio-15009"] java.net.BindException: Permission denied
:15009 SEVERE: Failed to initialize end point associated with
ProtocolHandler ["ajp-bio-15009"] java.net.BindException: Permission
denied :15009
11. restarted step 6, this time left IP's as they were, changing only localhost to tomcat-stevenwernercs.rhcloud.com, same result but with original IP's
12. ran out of options online, then I posed this question...
13. then I edited it a lot...
14. patiently wait :)
That is everything I have done, I am not sure why php isnt finding Java.
I looked at previous questions didn't find anything helpful.
Open to anything, thank you
Gears in a non-scable application are not allowed to communicate on any non http/ws port. So if your php java bridge is trying to communicate with the tomcat instance on 15009 (from what i see above) that is not going to work. You could only make requests on 80/443/8000/8443. Can you verify what port the java bridge works over?
Alternate solution: https://bitnami.com/cloud
I got it working using Bitnami with Amazon AWS, it provides free service for 1 year, documentation that is easy to follow, and plentiful and up to date, It took less than an hour.
Disclaimer: Using ssh tunnel for port 8080 i configured tomcat as if on localhost, and moved my hosted .php to the
same microserver that also hosted the tomcat. (I gave up on trying to host php and tomcat separately.)
I have hosted tomcat separately before on my university's tomcat server. But that was a node I had full access to.
I would still like to try Openshifts free solution, although the current resources and methods I've seen seem to no longer be valid. And unfortunately the workarounds are not intuitive enough and are currently over my head. Thank you.

jasmine_node failed while running mean-seed

Having trouble running a project generated by yeoman generator called mean-seed. I've been tinkering with it for a few days now and tried a couple things. Where I am having trouble is running the "jasmine_node" task:
Running "jasmine_node" task
>> Error: Unable to access jarfile node_modules/protractor/selenium/selenium-server-standalone-2.39.0.jar
Warning: Done, with errors. Use --force to continue.
Aborted due to warnings.
So I first tried identifying missing npm packages to install
744 npm install && bower update && bower install
755 npm install protractor
760 npm install npm install selenium-standalone
761 npm install -g protractor
765 npm install protractor-tester
767 npm install protractor-selenium-server-vagrant
768 npm install selenium-standalone#2.39.0-2.8.0-2
none of these actually created the file selenium-server-standalone-2.39.0.jar in the node_modules directory. I ran a find to check, however several other jars were install.
$ find . -name "*.jar" -print
./node_modules/grunt-jasmine-node-coverage-validation/node_modules/jasmine-node/node_modules/jasmine-reporters/ext/jline.jar
./node_modules/grunt-jasmine-node-coverage-validation/node_modules/jasmine-node/node_modules/jasmine-reporters/ext/js.jar
./node_modules/selenium-standalone/.selenium/2.39.0/server.jar
I found the selenium server download so I tried downloading and copying it over to the referenced directory which I had to create
https://code.google.com/p/selenium/downloads/detail?name=selenium-server-standalone-2.39.0.jar
I run grunt again. It goes through tasks then runs the jasmine_node task
Running "jasmine_node" task
TEST configFile: /Users/jgs/Projects/mean/app/test/../configs/config.test.json
configFile: ./app/configs/config.test.json
info - socket.io started
waiting for server to be running..
[success] connected to db at localhost:27017/test_temp
>> Feb 01, 2014 3:03:54 PM org.openqa.grid.selenium.GridLauncher main
>> INFO: Launching a standalone server
>> Setting system property webdriver.chrome.driver to node_modules/protractor/selenium/chromedriver
------------------
[ERROR]
Run `node run.js config=test`
Server not connected. Ensure you have a node server running with the `config=test` command line option so this server connects to the TEST database - the same one used here for the tests. Do NOT connect to the live database for doing tests!
------------------
[success] connected to db at localhost:27017/test_temp
all tests - 2526 ms
should test everything - 2525 ms
Failures:
1) all tests should test everything
Message:
Expected 'ERROR - check the logs above to fix the problem then try again' to be false.
Stacktrace:
Error: Expected 'ERROR - check the logs above to fix the problem then try again' to be false.
at /Users/jgs/Projects/mean/app/test/all.spec.js:6:2935
at _rejected (/Users/jgs/Projects/mean/node_modules/q/q.js:808:24)
at /Users/jgs/Projects/mean/node_modules/q/q.js:834:30
at Promise.when (/Users/jgs/Projects/mean/node_modules/q/q.js:1079:31)
at Promise.promise.promiseDispatch (/Users/jgs/Projects/mean/node_modules/q/q.js:752:41)
at /Users/jgs/Projects/mean/node_modules/q/q.js:574:44
at flush (/Users/jgs/Projects/mean/node_modules/q/q.js:108:17)
at process._tickCallback (node.js:415:13)
Finished in 2.53 seconds
1 test, 1 assertion, 1 failure, 0 skipped
Warning: Task "jasmine_node" failed. Use --force to continue.
Aborted due to warnings.
$
Any idea why jasmine task is still failing?
Run ./node_modules/protractor/bin/webdriver-manager update, see here for more info:
https://github.com/jackrabbitsgroup/generator-mean-seed/issues/5
I hadn't yet updated the documentation everywhere yet for the Protractor upgrade, sorry about that!
Here is my solution.
First you need to download both the selenium-server-standalone
https://code.google.com/p/selenium/downloads/detail?name=selenium-server-standalone-2.39.0.jar
and the chromedriver
http://chromedriver.storage.googleapis.com/index.html
copy them to
node_modules/protractor/selenium/
you will want another terminal tab or window to start the node server by runing
node run.js
then you can run the default grunt task
grunt
You will then see the output of the selenium tests in the console and chrome should open and perform the tests automatically.

Categories