I'm trying to run some simple tests with Grinder. I'm using the JMSReceiver script from the Script Gallery and trying to add some statistics, but my Agent throws an exception when it starts up.
A trivial example is:
from net.grinder.script.Grinder import grinder
from net.grinder.script import Test
grinder.statistics.registerSummaryExpression("foo","(/ userLong0 timedTests)")
Running this throws an exception:
...Parse exception: Unknown token 'timedTests', at character 23 of '(/ userLong0 timedTests)'
I'm using grinder-3.11, jython-2.5.3, and I'm running the above Grinder script with:
CLASSPATH=lib/jython-standalone-2.5.3.jar:lib/grinder.jar
java -classpath $CLASSPATH net.grinder.Grinder etc/grinder.properties
where grinder.properties specifies the script to run.
Java version is "1.7.0_03-icedtea", which I think is JDK 7u60 on Centos 6.3.
About 5 minutes after posting the question, I found this wiki page. I don't know if it's the version of Grinder that I'm using, but in order to get this to work I have to change
grinder.statistics.registerSummaryExpression("foo","(/ userLong0 timedTests)")
to
grinder.statistics.registerSummaryExpression("foo","(/ userLong0 (count timedTests))")
The important difference being the addition of the "count" token. This solves my problem.
Related
I'm just starting out with Scala and have been following its Getting Started instructions. The second part of the instruction involves pulling the hello-world template by running the sbt new scala/hello-world.g8 command.
My problem is that it keeps on giving me this error:
Error: Could not find or load main class Anne
Caused by: java.lang.ClassNotFoundException: Anne
I'd like to know the reason for this, as well as any possible fix I might use.
The following is my insight and attempts on fixing this problem.
Insight:
1. I might have a problem with java installation/scala/sbt installation that needs this class Anne since even with other sbt commands like sbt sbtVersion I get the same error
Attempts:
1. Change command to retrieve from full url:
sbt new https://github.com/scala/hello-world.g8
2.(Edit): Previously I thought the repository scala/hello-world.g8 did not exist and tried getting from other repositories with no luck and with the same error as above. However it was pointed out below that the repository actually exists in this url https://github.com/scala/hello-world.g8, thanks Dmytro Mitin.
I was looking into the incorrect account (sbt) instead of (scala)
(Edit): Day 2
3. Uninstall/Reinstall sbt -- still getting the error
4. Checked if java running properly by compiling sample code and running ( successful )
I was actually running the command in Visual Studio Code's bash terminal. I tried running it with cmd and everything's now working fine.
I work on a project developed with Symfony 1.2 and I can’t use the following propel commands without generating errors :
propel:build-schema, propel:build-model, propel:build-forms.
I use:
Apache 2.4
PHP 5.4.27
Propel as ORM
SfPropelPlugin
When executing the commands “php symfony propel:build-schema” and “php symfony propel:build-model”, I receive this error message :
PHP Strict Standards: Declaration of Win32FileSystem::compare() should be compatible with FileSystem::compare($f1, $f2) in D:\vmd\application\lib\vendor\symfony\lib\plugins\sfPropelPlugin\lib\vendor\phing\system\io\Win32FileSystem.php on line 475
When executing the command “php symfony propel:build-forms”, I receive this message (but the forms could be generated) :
PHP Warning: ob_start(): function '' not found or invalid function name in D:\vmd\application\lib\vendor\symfony\lib\config\sfApplicationConfiguration.class.php on line 157
I looked on the forums, but I found nothing working, as this person before me :
http://forum.symfony-project.org/forum/22/topic/87601.html
Problem with Java 8 ?
I wonder if my problem hasn’t come after I upgraded to Java 8 ...
I have now the jre1.8.0_71 version.
Upgrading to Symfony 1.3 and 1.4 :
I tried to upgrade to Symfony 1.3 and 1.4 and I installed SfPropelORMPlugin, but I had other problems, even more important because I could even not access the homepage of the website, for instance.
Can anybody help me ?
Thanks.
I think the command should be:
symfony propel-build-model
symfony propel-build-schema (given you have correct propel.ini)
symfony cc (to clear cache dont forget this command)
I am running the following script based on the RSelenium Basics CRAN page:
library(RSelenium)
startServer(args = c("-port 4455"), log = FALSE, invisible = FALSE)
remDr <- remoteDriver(browserName = "chrome")
remDr$open()
This produces the following error:
Exception in thread "main" java.net.BindException: Selenium is already running on port 4444. Or some other service is.
at org.openqa.selenium.server.SeleniumServer.start(SeleniumServer.java:492)
at org.openqa.selenium.server.SeleniumServer.boot(SeleniumServer.java:305)
at org.openqa.selenium.server.SeleniumServer.main(SeleniumServer.java:245)
at org.openqa.grid.selenium.GridLauncher.main(GridLauncher.java:64)
Based on the comments from this conversation on GitHub, I've modified my startServer() command like so:
startServer(args = c("-port 4455"), log = FALSE, invisible = FALSE)
I then receive the following error in my console:
Error: Summary: UnknownError
Detail: An unknown server-side error occurred while processing the command.
class: java.lang.IllegalStateException
And this error in the Java prompt that pops up:
14:38:55.098 INFO - Launching a standalone Selenium Server
14:38:55:161 INFO - Java: Oracle Corporation 25.40-b25
14:38:55.161 INFO - OS: Windows 7 6.1 amd64
14:38:55.161 INFO - v2.46.0, with Core v2.46.0. Built from revision 87c69e2
14:38:55.209 INFO - Driver class not found: com.opera.core.systems.OperaDriver
14:38:55.209 INFO - Driver provider com.opera.core.systems.OperaDriver is not registered
14:38:55:289 INFO - RemoteWebDriver instances should connect to: http://127.0.0.1:4455/wd/hub
14:38:55:289 INFO - Selenium Server is up and running
I'm not sure if the lack of an Opera driver is an actual error or just a warning. Regardless, I would like to use Chrome, so it seems like it shouldn't matter. What am I doing wrong?
I was finally able to get RSelenium to work by piecing together information from a number of different sources. I think it would be helpful to have all of this information in one location, so here is the process that I went through to get RSelenium to work on Windows 7 (64-bit) with Chrome as the browser:
Download the 64-bit version of Java. I could not get anything to work with the standard download.
Download ChromeDriver.
Download the Selenium Standalone Server or run checkForServer() from R.
Create a batch file to start the Selenium server. I initially tried to use startServer() from an R script, but it would frequently get stuck and not carry on to the next line in the script. Here is the batch file that I created:
java -jar C:\path\to\selenium-server-standalone.jar -Dwebdriver.chrome.driver=C:\path\to\chromedriver.exe
ChromeDriver can be put in the PATH environmental variable, but I decided to add in the path to ChromeDriver to the batch file (which accomplishes the same goal).
Run the R script. Here is my final script:
library(RSelenium)
shell.exec(paste0("C:\\path\\to\\yourbatchfile.bat"))
Sys.sleep(5)
remDr <- remoteDriver(browserName = "chrome")
remDr$open(silent = TRUE)
remDr$navigate("http://www.google.com")
The Sys.sleep() call was necessary because I would get an error in the remoteDriver() call if it ran before the Selenium Server had finished starting.
It is worth noting that RSelenium has some annoying differences for OSX. The invisible=T/silent=T arguments will not work when you run the yourcommand.command file and the remDr$open() method, respectively. The invisible=T will actually remind you that it only works on Windows. Not a huge deal (and if someone has a workaround I'd appreciate it).
For posterity's sake here's a slight variation for OSX to replace shell.exec using a .command file instead of a .bat with the same contents as above:
yourcommand.command file contents
java -jar /path/to/selenium-server-standalone.jar -Dwebdriver.chrome.driver=/path/to/chromedriver
R script modification
library(RSelenium)
system(paste("open","/path/to/yourcommand.command"))
Sys.sleep(5)
...
So, here's my problem. I've got my ANTLR4 code successfully compiled, without errors and now I want to test it out. The ANTLR4 Documentation tells me, to test my applications, I shall do this:
java org.antlr.v4.runtime.misc.TestRig
I've tried this and got following error:
Error: Main Class org.antlr.v4.runtime.misc.TestRig couldn't be found or load.
I've checked if my CLASSPATH wasn't set, but everything was correctly set as it should be. I also tried moving the file directly to my test folder and opened CMD there and tried it again, I occur the same error. Searching in the Internet didn't help, as no one seemed to have occurred this error with ANTLR4 before.
Specs:
Java 1.7.0.55
ANTLR 4.4
There seems to be something wrong with your classpath, contrary to your belief everything is okay.
When I download the ANTLR 4 JAR and run TestRig:
wget http://www.antlr.org/download/antlr-4.4-complete.jar
...
java -cp antlr-4.4-complete.jar org.antlr.v4.runtime.misc.TestRig
I see the following on my console:
java org.antlr.v4.runtime.misc.TestRig GrammarName startRuleName
[-tokens] [-tree] [-gui] [-ps file.ps] [-encoding encodingname]
[-trace] [-diagnostics] [-SLL]
[input-filename(s)]
Use startRuleName='tokens' if GrammarName is a lexer grammar.
Omitting input-filename makes rig read from stdin.
I'm running Mac OS 10.6, Java 1.6_17, Scala 2.8.1 final. I'm attempting to make a simple Skype call using Skype4Java by doing the following:
$>export JAVA_OPTS=-d32
$>scala -classpath .:./skype/release/skype.jar
scala> com.skype.Skype.makeCall("echotest")
I'm getting the error
"invalid attempt to access memory at location 0x0 ... bus error".
Anybody else experience this and find a solution?
Note: I'm able to use this api perfectly fine by invoking one of the samples when I run it using command line java. Attempting to execute the same sample using command line scala fails with the error above.
Try object Test { def main(args:Array[String]) { ... } }