Jooq & H2 codegeneration error

401 views
Skip to first unread message

Shyaka Rene

unread,
Oct 24, 2013, 3:11:38 PM10/24/13
to jooq...@googlegroups.com
Hello everyone, (Sorry for my english), I have a problem
with jooq codegeneration with h2 database. I was searching on the internet
but no one have not faced this problem.

I used jooq with mysql when i was learning jooq, now i have to use
jooq with h2 in a client project

I folowed the tutorials on the h2 website how to use h2 with jooq
and I have included all the required jars in the classpath and codegen.xml


here are the details:

codegen.xml



<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<configuration xmlns="http://www.jooq.org/xsd/jooq-codegen-2.3.0.xsd">
<jdbc>
<driver>org.h2.Driver</driver>
<url>jdbc:h2:school/school;CIPHER=AES</url>
<user>sa</user>
<password>reneka10 reneka10</password>
</jdbc>
<generator>
<name>org.jooq.util.DefaultGenerator</name>
<database>
<name>org.jooq.util.h2.H2Database</name>
<includes>.*</includes>
<excludes></excludes>
<inputSchema>school</inputSchema>
</database>
<generate></generate>
<target>
<packageName>org.jooq.h2.generated</packageName>
<directory>./src</directory>
</target>
</generator>
</configuration>



command in windows 7 cmd


C:\eclipse-java\Projects\School-004-server>java -cp jooq-3.2.0.jar;jooq-meta-3.2.0.jar;jooq-codegen-3.2.0.jar;h2-1.3
.172.jar;.org.jooq.util.GenerationTool /codegen.xml




error in cmd



C:\eclipse-java\Projects\School-004-server>java -cp jooq-3.2.0.j
.0.jar;jooq-codegen-3.2.0.jar;.org.jooq.util.GenerationTool /codegen.xml
Exception in thread "main" java.lang.NoClassDefFoundError: /codegen.xml
Caused by: java.lang.ClassNotFoundException: .codegen.xml
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Me
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown So
        at java.lang.ClassLoader.loadClass(Unknown Source)
Could not find the main class: /codegen.xml.  Program will exit.




Thank you any help will appreciated.

Lukas Eder

unread,
Oct 25, 2013, 4:11:57 AM10/25/13
to jooq...@googlegroups.com
Hi,

I suspect that you are simply missing a space between the local directory "." and the "org.jooq.util.GenerationTool". this makes ".org.jooq.util.GenerationTool" part of your classpath, and tries to run "/codegen.xml" as the main Java program.

Cheers
Lukas


2013/10/24 Shyaka Rene <rene...@gmail.com>

--
You received this message because you are subscribed to the Google Groups "jOOQ User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jooq-user+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Shyaka Rene

unread,
Oct 26, 2013, 11:20:14 AM10/26/13
to jooq...@googlegroups.com
Thank you,
I inserted a space between h2-1.3.172.jar; and org.jooq.util.GenerationTool.
It worked perfectly
Thanks again
Message has been deleted

Lukas Eder

unread,
Dec 8, 2013, 3:36:25 AM12/8/13
to jooq...@googlegroups.com

2013/12/8 bruce buchanan <bruce.t....@gmail.com>
so... in the H2 docs they say to use PUBLIC as a default schema name, I see you're using your database name...

did you do something like set the schema name elsewhere in your code?

If you don't specify any schema name, jOOQ will generate code for all schemas that are available
 
did the above actually generate what it was supposed to, or did it just execute w/ no errors?

I'm trying to do the exact same thing but not quite there yet

Are you getting any log output at all?
Reply all
Reply to author
Forward
0 new messages