weixin_39725873
2021-01-09 02:29 阅读 15

Error: Could not find or load main class com.yahoo.ycsb.Client

Hello, I am working on benchmarking mysql using cygwin on windows. When I run the workload, I get this error Ash /cygdrive/c/Users/Ash/Downloads/ycsb-0.1.4 $ ./bin/ycsb load jdbc -P workloads/workloada properties.dat -s > mysql1.load.txt Error: Could not find or load main class com.yahoo.ycsb.Client

Please help me out

该提问来源于开源项目:brianfrankcooper/YCSB

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

28条回答 默认 最新

  • weixin_39763033 weixin_39763033 2021-01-09 02:29

    this sounds like the ycsb launcher wasn't able to find our jar files correctly.

    Could you describe what is in the ycsb-0.1.4 directory? Is it the contents of our release download (ref)?

    /cc #246

    点赞 评论 复制链接分享
  • weixin_39725873 weixin_39725873 2021-01-09 02:29

    Thank you for your reply. I have not cloned the YCSB from github. It is a tar file downloaded from one of thre mirrors.

    点赞 评论 复制链接分享
  • weixin_39763033 weixin_39763033 2021-01-09 02:29

    Could you give me the md5 sum of the tarball? I believe cygwin includes the comman 'md5sum' to generate it.

    点赞 评论 复制链接分享
  • weixin_39725873 weixin_39725873 2021-01-09 02:29

    3d2ce22e9245b14e0e6886ba01fcb95a *ycsb-0.1.4.tar.gz

    点赞 评论 复制链接分享
  • weixin_39725873 weixin_39725873 2021-01-09 02:29

    Hello busbey, I have cloned the YCSB on ubuntu 12.04. When I run the workload, I get a syntax error adminuser-VirtualBox:~/YCSB$ bin/ycsb load jdbc -P workloads/workloada properties.dat -s > mysql.load.txt File "bin/ycsb", line 112 ycsb_command = ["java", "-cp","/usr/share/java/mysql-connector-java-5.1.18.jar:" os.pathsep.join(find_jars(ycsb_home, database)), \ ^ SyntaxError: invalid syntax

    This is the classpath I gave in ycsb. ycsb_command = ["java", "-cp","/usr/share/java/mysql-connector-java-5.1.18.jar:" os.pathsep.join(find_jar$ COMMANDS[sys.argv[1]]["main"], "-db", db_classname] + options

    The properties.dat contains threadcount=4 recordcount=100 operationcount=100 target=50 jdbc.driver=com.mysql.jdbc.Driver db.url=jdbc:mysql://localhost/phpmyadmin/emp db.user=' ' db.passwd=' '

    Your reply is much appreciated

    点赞 评论 复制链接分享
  • weixin_39763033 weixin_39763033 2021-01-09 02:29

    Okay, you should definitely abandon the tarball, because I can't figure out what it is.

    
    #source tag
    $ md5 ~/Downloads/YCSB-0.1.4.tar.gz 
    MD5 (/Users/busbey/Downloads/YCSB-0.1.4.tar.gz) = 3f219b72a4441feebdacaa59bd952fcb
    #binary download
    $ md5 ~/Downloads/ycsb-0.1.4.tar.gz 
    MD5 (/Users/busbey/Downloads/ycsb-0.1.4.tar.gz) = 21430deed4fb53f1aa60b4b9e924f6be
    

    If you're going to work from the current github repo, you'll need to build YCSB before you can run anything. you do that by running

    
    $ mvn package
    

    What python version are you running?

    
    $ python --version
    Python 2.7.2
    
    点赞 评论 复制链接分享
  • weixin_39725873 weixin_39725873 2021-01-09 02:29

    Python 2.7.3

    点赞 评论 复制链接分享
  • weixin_39763033 weixin_39763033 2021-01-09 02:29

    one quick question

    This is the classpath I gave in ycsb. ycsb_command = ["java", "-cp","/usr/share/java/mysql-connector-java-5.1.18.jar:" os.pathsep.join(find_jar$ COMMANDS[sys.argv[1]]["main"], "-db", db_classname] + options

    This doesn't look correct. to make this adjustment you need to concatenate the string for the mysql jar and the result of find_jar. you should probably use os.pathsep instead of manually specifying ":" at the end of the jar.

    That said, I'm surprised we don't have a more established way to say "we also need these jars in the classpath." I'll poke around a bit.

    点赞 评论 复制链接分享
  • weixin_39725873 weixin_39725873 2021-01-09 02:29

    I am sorry, I do not know what you mean. How do I get the result for find_jar and concatenate it with the string. Please elaborate.

    点赞 评论 复制链接分享
  • weixin_39763033 weixin_39763033 2021-01-09 02:29

    the method find_jars returns a string that's a java classpath. Something like "lib/somelib.jar:lib/otherlib.jar". You need to combine that string with the one that has the path to the mysql jar.

    Changing to something like

    
    ycsb_command = ["java", "-cp", os.pathsep.join("/usr/share/java/mysql-connector-java-5.1.18.jar", \
                    os.pathsep.join(find_jars(ycsb_home, database))), \
                    COMMANDS[sys.argv[1]]["main"], "-db", db_classname] + options
    

    will make things work for now, but we should have a more sustainable way to pass additional runtime dependencies in on the command line.

    点赞 评论 复制链接分享
  • weixin_39725873 weixin_39725873 2021-01-09 02:29

    sorry to bother you so much. I am still getting a syntax error. File "bin/ycsb", line 112 ycsb_command = ["java", "-cp", os.pathsep.join("/usr/share/java/mysql-connector-java-5.1.18.jar", \ os.pathsep.join(find_jars(ycsb_home, database))), \ ^ SyntaxError: unexpected character after line continuation character

    点赞 评论 复制链接分享
  • weixin_39725873 weixin_39725873 2021-01-09 02:29

    Now the error is: Traceback (most recent call last): File "bin/ycsb", line 113, in os.pathsep.join(find_jars(ycsb_home, database))), \ TypeError: join() takes exactly one argument (2 given)

    点赞 评论 复制链接分享
  • weixin_39763033 weixin_39763033 2021-01-09 02:29

    Oh, of course. Join needs an array. Replace the part for the jar list with:

    
    "/usr/share/java/mysql-connector-java-5.1.18.jar" + os.pathsep + \
    os.pathsep.join(find_jars(ycsb_home, database))
    

    (I'm on a phone, so I can't see a preview. This should be the string for your new jar, then a plus, then the OS' path separater, then a plus, then the original path generator)

    点赞 评论 复制链接分享
  • weixin_39725873 weixin_39725873 2021-01-09 02:29

    Thanks Sean it worked. However after the workload is run, bin/ycsb load jdbc -P workloads/workloada properties.dat -s

    I do not get the expected output, instead: java -cp /usr/share/java/mysql-connector-java-5.1.18.jar:/home/adminuser/YCSB/voldemort/src/main/conf:/home/adminuser/YCSB/nosqldb/src/main/conf:/home/adminuser/YCSB/dynamodb/conf:/home/adminuser/YCSB/infinispan/src/main/conf:/home/adminuser/YCSB/gemfire/src/main/conf:/home/adminuser/YCSB/hbase/src/main/conf:/home/adminuser/YCSB/core/target/core-0.1.4.jar:/home/adminuser/YCSB/accumulo/src/main/conf:/home/adminuser/YCSB/jdbc/src/main/conf:/home/adminuser/YCSB/jdbc/target/jdbc-binding-0.1.4.jar:/home/adminuser/YCSB/jdbc/target/archive-tmp/jdbc-binding-0.1.4.jar com.yahoo.ycsb.Client -db com.yahoo.ycsb.db.JdbcDBClient -P workloads/workloada properties.dat -s -load Usage: java com.yahoo.ycsb.Client [options] Options: -threads n: execute using n threads (default: 1) - can also be specified as the "threadcount" property using -p -target n: attempt to do n operations per second (default: unlimited) - can also be specified as the "target" property using -p -load: run the loading phase of the workload -t: run the transactions phase of the workload (default) -db dbname: specify the name of the DB to use (default: com.yahoo.ycsb.BasicDB) - can also be specified as the "db" property using -p -P propertyfile: load properties from the given file. Multiple files can be specified, and will be processed in the order specified -p name=value: specify a property to be passed to the DB and workloads; multiple properties can be specified, and override any values in the propertyfile -s: show status during run (default: no status) -l label: use label for status (e.g. to label one experiment out of a whole batch)

    Required properties: workload: the name of the workload class to use (e.g. com.yahoo.ycsb.workloads.CoreWorkload)

    To run the transaction phase from multiple servers, start a separate client on each. To run the load phase from multiple servers, start a separate client on each; additionally, use the "insertcount" and "insertstart" properties to divide up the records to be inserted

    The properties.dat contains threadcount=4 recordcount=100 operationcount=100 target=50 jdbc.driver=com.mysql.jdbc.Driver db.url=jdbc:mysql://localhost/phpmyadmin/emp db.user=' ' db.passwd=' '

    点赞 评论 复制链接分享
  • weixin_39725873 weixin_39725873 2021-01-09 02:29

    Hello Sean, I hope you enjoyed your long weekend. I am still facing some trouble(see previous comment) when I run the workloads. But these workloads run fine with Nosql databases.

    Please help me out

    点赞 评论 复制链接分享
  • weixin_39886469 weixin_39886469 2021-01-09 02:29

    What is properties.dat here? If it's another properties file, you need to add a '-P' flag for each properties file.

    On Wed, May 27, 2015 at 2:18 AM, Ash140 notifications.com wrote:

    Hello Sean, I hope you enjoyed your long weekend. I am still facing some trouble(see previous comment) when I run the workloads. But these workloads run fine with Nosql databases.

    Please help me out

    — Reply to this email directly or view it on GitHub https://github.com/brianfrankcooper/YCSB/issues/257#issuecomment-105835050 .

    点赞 评论 复制链接分享
  • weixin_39725873 weixin_39725873 2021-01-09 02:29

    Thank you for the reply but the error still previals,

    $ bin/ycsb load jdbc -s -P workloads/workloada -P properties.dat java -cp /cygdrive/c/Users/Ashwin/Downloads/YCSB-0.1.4/core/target/core-0.1.4.jarC:\ProgramFiles(x86)\MySQL\MySQLConnectorJ/mysql-connector-java-5.1.35-bin.jar/cygdrive/c/Users/Ashwin/Downloads/YCSB-0.1.4/gemfire/src/main/confC:\ProgramFiles(x86)\MySQL\MySQLConnectorJ/mysql-connector-java-5.1.35-bin.jar/cygdrive/c/Users/Ashwin/Downloads/YCSB-0.1.4/hbase/src/main/confC:\ProgramFiles(x86)\MySQL\MySQLConnectorJ/mysql-connector-java-5.1.35-bin.jar/cygdrive/c/Users/Ashwin/Downloads/YCSB-0.1.4/infinispan/src/main/confC:\ProgramFiles(x86)\MySQL\MySQLConnectorJ/mysql-connector-java-5.1.35-bin.jar/cygdrive/c/Users/Ashwin/Downloads/YCSB-0.1.4/jdbc/src/main/confC:\ProgramFiles(x86)\MySQL\MySQLConnectorJ/mysql-connector-java-5.1.35-bin.jar/cygdrive/c/Users/Ashwin/Downloads/YCSB-0.1.4/jdbc/target/jdbc-binding-0.1.4.jarC:\ProgramFiles(x86)\MySQL\MySQLConnectorJ/mysql-connector-java-5.1.35-bin.jar/cygdrive/c/Users/Ashwin/Downloads/YCSB-0.1.4/jdbc/target/archive-tmp/jdbc-binding-0.1.4.jarC:\ProgramFiles(x86)\MySQL\MySQLConnectorJ/mysql-connector-java-5.1.35-bin.jar/cygdrive/c/Users/Ashwin/Downloads/YCSB-0.1.4/nosqldb/src/main/confC:\ProgramFiles(x86)\MySQL\MySQLConnectorJ/mysql-connector-java-5.1.35-bin.jar/cygdrive/c/Users/Ashwin/Downloads/YCSB-0.1.4/voldemort/src/main/conf com.yahoo.ycsb.Client -db com.yahoo.ycsb.db.JdbcDBClient -s -P workloads/workloada -P properties.dat -load Error: Could not find or load main class com.yahoo.ycsb.Client

    点赞 评论 复制链接分享
  • weixin_39886469 weixin_39886469 2021-01-09 02:29

    Did you modify 'bin/ycsb'? Every entry has "C:\ProgramFiles(x86)\MySQL\ MySQLConnectorJ/mysql-connector-java-5.1.35-bin.jar" appended.

    On Thu, May 28, 2015 at 4:38 AM, Ash140 notifications.com wrote:

    Thank you for the reply but the error still previals,

    $ bin/ycsb load jdbc -s -P workloads/workloada -P properties.dat java -cp /cygdrive/c/Users/Ashwin/Downloads/YCSB-0.1.4/core/target/core-0.1.4.jarC:\ProgramFiles(x86)\MySQL\MySQLConnectorJ/mysql-connector-java-5.1.35-bin.jar/cygdrive/c/Users/Ashwin/Downloads/YCSB-0.1.4/gemfire/src/main/confC:\ProgramFiles(x86)\MySQL\MySQLConnectorJ/mysql-connector-java-5.1.35-bin.jar/cygdrive/c/Users/Ashwin/Downloads/YCSB-0.1.4/hbase/src/main/confC:\ProgramFiles(x86)\MySQL\MySQLConnectorJ/mysql-connector-java-5.1.35-bin.jar/cygdrive/c/Users/Ashwin/Downloads/YCSB-0.1.4/infinispan/src/main/confC:\ProgramFiles(x86)\MySQL\MySQLConnectorJ/mysql-connector-java-5.1.35-bin.jar/cygdrive/c/Users/Ashwin/Downloads/YCSB-0.1.4/jdbc/src/main/confC:\ProgramFiles(x86)\MySQL\MySQLConnectorJ/mysql-connector-java-5.1.35-bin.jar/cygdrive/c/Users/Ashwin/Downloads/YCSB-0.1.4/jdbc/target/jdbc-binding-0.1.4.jarC:\ProgramFiles(x86)\MySQL\MySQLConnectorJ/mysql-connector-java-5.1.35-bin.jar/cygdrive/c/Users/Ashwin/Downloads/YCSB-0.1.4/jdbc/target/archive-tmp/jdbc-binding-0.1.4.jarC:\ ProgramF iles(x86)\MySQL\MySQLConnectorJ/mysql-connector-java-5.1.35-bin.jar/cygdrive/c/Users/Ashwin/Downloads/YCSB-0.1.4/nosqldb/src/main/confC:\ProgramFiles(x86)\MySQL\MySQLConnectorJ/mysql-connector-java-5.1.35-bin.jar/cygdrive/c/Users/Ashwin/Downloads/YCSB-0.1.4/voldemort/src/main/conf com.yahoo.ycsb.Client -db com.yahoo.ycsb.db.JdbcDBClient -s -P workloads/workloada -P properties.dat -load Error: Could not find or load main class com.yahoo.ycsb.Client

    — Reply to this email directly or view it on GitHub https://github.com/brianfrankcooper/YCSB/issues/257#issuecomment-106285872 .

    点赞 评论 复制链接分享
  • weixin_39951181 weixin_39951181 2021-01-09 02:29

    There's no separation between the paths. On windows, this is typically a ';'. Also, I see you have a mix of "/cygdrive/c" and "C:\ProgramFiles(x86)". You're using cygwin, I take it. So they should all be "/cygdrive/c".

    I've never had much success using the /bin/ycsb scripts under cygwin on Windows. On Unix, it worked great, but on Windows, I found it easier to just make my own script and run it like any standard Java program.

    点赞 评论 复制链接分享
  • weixin_39725873 weixin_39725873 2021-01-09 02:29

    Hello, Unfortunately, I am using cygwin as a part of uni project.

    I replaced C: with cygdrive/c/ and added ; for separation and its still not working. Please correct me

    cygdrive/c/Program;Files;(x86)/MySQL/MySQL;Connector;J/mysql-connector-java-5.1.35-bin.jar/cygdrive/c/Users/Ashwin/Downloads/YCSB-0.1.4/jdbc/target/archive-tmp/jdbc-binding-0.1.4.jarcygdrive/c/Program;Files;(x86)/MySQL/MySQL;Connector;J/mysql-connector-java-5.1.35-bin.jar/cygdrive/c/Users/Ashwin/Downloads/YCSB-0.1.4/nosqldb/src/main/confcygdrive/c/Program;Files;(x86)/MySQL/MySQL;Connector;J/mysql-connector-java-5.1.35-bin.jar/cygdrive/c/Users/Ashwin/Downloads/YCSB-0.1.4/voldemort/src/main/conf com.yahoo.ycsb.Client -db com.yahoo.ycsb.db.JdbcDBClient -s -P workloads/workloada -P properties.dat -load Error: Could not find or load main class com.yahoo.ycsb.Client

    点赞 评论 复制链接分享
  • weixin_39725873 weixin_39725873 2021-01-09 02:29

    Hello cmccoy Yes, I appended /bin/ycsb to add the path to mysql connector java jar file in ycsb_command.

    点赞 评论 复制链接分享
  • weixin_39725873 weixin_39725873 2021-01-09 02:29

    I some how made it in Ubuntu. I am facing some troubles in database aspect. Although I have a table and some values in it, its throwing this error. Please correct me Error in processing insert to table: usertablejava.sql.SQLException: Column count doesn't match value count at row 1 Error in processing insert to table: usertablejava.sql.SQLException: Column count doesn't match value count at row 1 Error in processing insert to table: usertablejava.sql.SQLException: Column count doesn't match value count at row 1 Error in processing insert to table: usertablejava.sql.SQLException: Column count doesn't match value count at row 1 0 sec: 0 operations; [INSERT AverageLatency(us)=8165]

    点赞 评论 复制链接分享
  • weixin_39763033 weixin_39763033 2021-01-09 02:29

    is that the entire error message? Is there a stack trace present?

    点赞 评论 复制链接分享
  • weixin_39763033 weixin_39763033 2021-01-09 02:29

    are you still working on this? Can you retry using the current codebase and the argument to add to the classpath rather than editing the bin/ycsb file?

    点赞 评论 复制链接分享
  • weixin_39725873 weixin_39725873 2021-01-09 02:29

    thank you. I have completed working on this.

    点赞 评论 复制链接分享
  • weixin_39719476 weixin_39719476 2021-01-09 02:29

    Hi,I get some error like you had,but I don't know how to correct it.Thi error like this:Error in processing insert to table: usertablejava.sql.SQLException: Column count doesn't match value count at row 1 Please help me,thankful!

    点赞 评论 复制链接分享
  • weixin_39574868 weixin_39574868 2021-01-09 02:29

    commenting on a closed ticket doesn't make sense usually. Please open a new issue with some more details like what you have tried so far and what the full error is.

    点赞 评论 复制链接分享
  • weixin_39621185 weixin_39621185 2021-01-09 02:29

    I some how made it in Ubuntu. I am facing some troubles in database aspect. Although I have a table and some values in it, its throwing this error. Please correct me Error in processing insert to table: usertablejava.sql.SQLException: Column count doesn't match value count at row 1 Error in processing insert to table: usertablejava.sql.SQLException: Column count doesn't match value count at row 1 Error in processing insert to table: usertablejava.sql.SQLException: Column count doesn't match value count at row 1 Error in processing insert to table: usertablejava.sql.SQLException: Column count doesn't match value count at row 1 0 sec: 0 operations; [INSERT AverageLatency(us)=8165] How did you solve it

    点赞 评论 复制链接分享