ClassNotFoundException when running the Benchmark

32 views
Skip to first unread message

Ingo Adler

unread,
Jun 20, 2010, 11:08:50 AM6/20/10
to H2 Database
Hi

I just downloaded H2 and wanted to play with it.

I tried "build benchmark" from the H2 directory and got the following
stacktrace:

Exception in thread "main" java.lang.RuntimeException: Can not read
value org.h2.engine.Constants.getVersion()
at org.h2.build.BuildBase.getStaticValue(BuildBase.java:352)
at org.h2.build.Build.getVersion(Build.java:237)
at org.h2.build.Build.getJarSuffix(Build.java:241)
at org.h2.build.Build.benchmark(Build.java:56)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.h2.build.BuildBase.invoke(BuildBase.java:203)
at org.h2.build.BuildBase.run(BuildBase.java:193)
at org.h2.build.Build.main(Build.java:31)
Caused by: java.lang.ClassNotFoundException: org.h2.engine.Constants
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:
301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:
320)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at org.h2.build.BuildBase.getStaticValue(BuildBase.java:348)
... 10 more

What can I do?

Regards
Ingo

Thomas Mueller

unread,
Jun 20, 2010, 4:30:26 PM6/20/10
to h2-da...@googlegroups.com
Hi,

The 'benchmark' target doesn't call 'compile', I will add that. As a
workaround, you need to call it manually:

built compile benchmark

By the way this will download an old version of HSQLDB; to use a more
recent version, download it manually and add it to the 'ext' directory
as 'hsqldb.jar'. I couldn't HSQLDB 2.0 in a public maven repository.

Regards,
Thomas

Ingo Adler

unread,
Jun 22, 2010, 6:29:14 AM6/22/10
to H2 Database
Thanks, that helped to get a bit further.

Now I get an JdbcSQLException during the H2 test ("Connection is
broken/interrupted"):

C:\tools\H2>build compile benchmark
Target: compile
Deleting temp
Deleting docs
Compiling 519 classes
Copying 1 files to temp
Compiling 374 classes
Copying 14 files to temp
Running org.h2.build.doc.GenerateHelp
Javadoc
Loading source files for package org.h2.tools...
Constructing Javadoc information...
Zip temp/org/h2/util/data.zip (339 KB)
Target: benchmark
java -Xmx128m -cp temp;bin/h2-1.2.137.jar;ext/hsqldb.jar;ext/
hsqldb-1.8.0.10.jar;ext/derby-10.5.3.0_1.jar;ext/derbyclient-10.5.3.0
_1.jar;ext/derbynet-10.5.3.0_1.jar;ext/
postgresql-8.3-603.jdbc3.jar;ext/mysql-connector-java-5.1.6.jar
org.h2.test.bench.TestPerfo
rmance -init -db 1
Testing the performance of H2
H2 1.2.137 (2010-06-06)
Loading item table: 10%
Loading item table: 0%
Statements per second: 61757
java -Xmx128m -cp temp;bin/h2-1.2.137.jar;ext/hsqldb.jar;ext/
hsqldb-1.8.0.10.jar;ext/derby-10.5.3.0_1.jar;ext/derbyclient-10.5.3.0
_1.jar;ext/derbynet-10.5.3.0_1.jar;ext/
postgresql-8.3-603.jdbc3.jar;ext/mysql-connector-java-5.1.6.jar
org.h2.test.bench.TestPerfo
rmance -db 2
Testing the performance of HSQLDB
HSQL Database Engine 1.8.0
Loading item table: 10%
Loading item table: 0%
Statements per second: 3537
java -Xmx128m -cp temp;bin/h2-1.2.137.jar;ext/hsqldb.jar;ext/
hsqldb-1.8.0.10.jar;ext/derby-10.5.3.0_1.jar;ext/derbyclient-10.5.3.0
_1.jar;ext/derbynet-10.5.3.0_1.jar;ext/
postgresql-8.3-603.jdbc3.jar;ext/mysql-connector-java-5.1.6.jar
org.h2.test.bench.TestPerfo
rmance -db 3 -out pe.html
Testing the performance of Derby
Apache Derby 10.5.3.0 - (802917)
Loading item table: 10%
Loading item table: 0%
Statements per second: 7118
java -Xmx128m -cp temp;bin/h2-1.2.137.jar;ext/hsqldb.jar;ext/
hsqldb-1.8.0.10.jar;ext/derby-10.5.3.0_1.jar;ext/derbyclient-10.5.3.0
_1.jar;ext/derbynet-10.5.3.0_1.jar;ext/
postgresql-8.3-603.jdbc3.jar;ext/mysql-connector-java-5.1.6.jar
org.h2.test.bench.TestPerfo
rmance -init -db 4
Testing the performance of H2
Exception in thread "main" org.h2.jdbc.JdbcSQLException: Verbindung
ist unterbrochen: "unexpected status 1090519040"
Connection is broken: "unexpected status 1090519040" [90067-137]
at
org.h2.message.DbException.getJdbcSQLException(DbException.java:327)
at org.h2.message.DbException.get(DbException.java:167)
at org.h2.message.DbException.get(DbException.java:144)
at org.h2.engine.SessionRemote.done(SessionRemote.java:543)
at org.h2.engine.SessionRemote.initTransfer(SessionRemote.java:
114)
at
org.h2.engine.SessionRemote.connectServer(SessionRemote.java:325)
at
org.h2.engine.SessionRemote.connectEmbeddedOrServer(SessionRemote.java:
223)
at
org.h2.engine.SessionRemote.createSession(SessionRemote.java:217)
at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:111)
at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:95)
at org.h2.Driver.connect(Driver.java:58)
at java.sql.DriverManager.getConnection(DriverManager.java:
582)
at java.sql.DriverManager.getConnection(DriverManager.java:
185)
at org.h2.test.bench.Database.openNewConnection(Database.java:
190)
at
org.h2.test.bench.TestPerformance.testAll(TestPerformance.java:223)
at org.h2.test.bench.TestPerformance.test(TestPerformance.java:
116)
at org.h2.test.bench.TestPerformance.main(TestPerformance.java:
49)

What can I do, now?

Regards
Ingo

Thomas Mueller

unread,
Jun 23, 2010, 4:30:06 PM6/23/10
to h2-da...@googlegroups.com
Hi,

From the exception is looks like another server is already running on
that port. However, I wonder why there is no exception message for
that... I will check.

To solve the problem, could you ensure that no application is
listening on port 9092 before you start the benchmark?

Regards,
Thomas

Ingo Adler

unread,
Jun 23, 2010, 5:37:07 PM6/23/10
to H2 Database
Thanks again!

Telnet helped to identify the problem.

There was a mysql daemon running which was installed and used by some
program I use (SqueezeBox). I didn't know that this program would use
mysql and that it would use this port.

Now the benchmark runs and I know that the H2 infrastructure works, so
I can start to test it.

Regards
Ingo
Reply all
Reply to author
Forward
0 new messages