Problem with initializing Generation

164 views
Skip to first unread message

ivkov...@gmail.com

unread,
Dec 4, 2014, 9:07:37 AM12/4/14
to jooq...@googlegroups.com
I keep getting the same error trying to run Generation tool from eclipse.

2014-12-04 15:03:16 INFO  GenerationTool:334 - Initialising properties  : /library.xml
java.lang.NullPointerException
    at org.jooq.util.GenerationTool.run(GenerationTool.java:294)
    at org.jooq.util.GenerationTool.main(GenerationTool.java:167)
    at org.jooq.util.GenerationTool.main(GenerationTool.java:150)
java.lang.NullPointerException2014-12-04 15:03:18 ERROR GenerationTool:450 - Cannot read /library.xml. Error : null

    at org.jooq.util.GenerationTool.run(GenerationTool.java:294)
    at org.jooq.util.GenerationTool.main(GenerationTool.java:167)
    at org.jooq.util.GenerationTool.main(GenerationTool.java:150)
2014-12-04 15:03:18 ERROR GenerationTool:450 - Usage : GenerationTool <configuration-file>

But,the file is there. Any ideas how to solve it? :)

Lukas Eder

unread,
Dec 4, 2014, 9:10:24 AM12/4/14
to jooq...@googlegroups.com
Hello,

How did you set up your classpath? An Eclipse screenshot would be helpful...

--
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/d/optout.

ivkov...@gmail.com

unread,
Dec 4, 2014, 9:25:06 AM12/4/14
to jooq...@googlegroups.com

Lukas Eder

unread,
Dec 4, 2014, 9:42:03 AM12/4/14
to jooq...@googlegroups.com
That's your project layout. :-)

I mean the classpath of your execution configuration. An example can be seen here:

Eclipse configuration

As seen here:

ivkov...@gmail.com

unread,
Dec 4, 2014, 9:46:35 AM12/4/14
to jooq...@googlegroups.com

Lukas Eder

unread,
Dec 4, 2014, 10:41:59 AM12/4/14
to jooq...@googlegroups.com
Hi there.

Everything looks alright. I'm sorry I was actually going down the wrong path, because of the NullPointerException, which lead to me believing that the file was somehow missing. It isn't missing but JAXB probably couldn't deserialise an element. Can you please post the content of your library.xml File? There must be something wrong in there...

Sorry again about the confusion

Best Regards,
Lukas

ivkov...@gmail.com

unread,
Dec 4, 2014, 1:22:55 PM12/4/14
to jooq...@googlegroups.com
Sorry about late reply. It is like this: 
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<configuration>
  <!-- Configure the database connection here -->
  <jdbc>
    <driver>oracle.jdbc.OracleDriver</driver>
    <url>jdbc:oracle:thin:@aaa:bbb:ccc</url>
    <user>username</user>
    <password>password</password>
  </jdbc>

  <generator>
    <database>
      <name>org.jooq.util.oracle.OracleDatabase</name>
      <includes>.*</includes>
      <excludes></excludes>
      <inputSchema></inputSchema>
    </database>

    <generate>
    </generate>

    <target>
      <packageName>jooq</packageName>
      <directory>home/desktop/work/test/src</directory>
    </target>
  </generator>
</configuration>

Lukas Eder

unread,
Dec 4, 2014, 2:39:25 PM12/4/14
to jooq...@googlegroups.com
Hello,

Thanks for the additional information. I could track down the NullPointerException to be due to your empty <inputSchema/> (see below). I have registered a bug for this issue, which will be fixed soon:

It looks as though before this is fixed, you will have to list all your schemas to have the code generator generate metadata for multiple schemas in Oracle. Instead of using the <inputSchema/> element like you did, try using the following element:

<schemata>
  <schema>
    <inputSchema>SCHEMA 1</inputSchema>
  </schema>
  <schema>
    <inputSchema>SCHEMA 2</inputSchema>
  </schema>
</schemata>

Let me know if this works for you.

Best Regards,
Lukas

ivkov...@gmail.com

unread,
Dec 4, 2014, 3:50:49 PM12/4/14
to jooq...@googlegroups.com
Thanks for the effort, great support :)
I am unable to try now but i will let you know does it work tomorrow when i try it

Lukas Eder

unread,
Dec 5, 2014, 2:45:57 AM12/5/14
to jooq...@googlegroups.com
Well, thank you for letting us know about this bug!

ivkov...@gmail.com

unread,
Dec 5, 2014, 4:17:16 AM12/5/14
to jooq...@googlegroups.com
So,i have to list all schemas available in database for it to work? I tried listing some particular schema and it is not working.
The error i get is kind of strange
2014-12-05 10:16:28 ERROR GenerationTool:450 - Cannot read /library.xml. Error : Error generating code for schema VIEWPOINT
org.jooq.util.GeneratorException: Error generating code for schema VIEWPOINT
    at org.jooq.util.JavaGenerator.generate(JavaGenerator.java:250)
    at org.jooq.util.GenerationTool.run(GenerationTool.java:402)

    at org.jooq.util.GenerationTool.main(GenerationTool.java:167)
    at org.jooq.util.GenerationTool.main(GenerationTool.java:150)
Caused by: org.jooq.util.GeneratorException: Error writing /home/workspace/Test2/src/Viewpoint.java
    at org.jooq.util.GeneratorWriter.close(GeneratorWriter.java:261)
    at org.jooq.util.JavaGenerator.generateSchema(JavaGenerator.java:2356)
    at org.jooq.util.JavaGenerator.generate(JavaGenerator.java:282)
    at org.jooq.util.JavaGenerator.generate(JavaGenerator.java:247)
    ... 3 more
2014-12-05 10:16:28 ERROR GenerationTool:450 - Usage : GenerationTool <configuration-file>

ivkov...@gmail.com

unread,
Dec 5, 2014, 4:27:45 AM12/5/14
to jooq...@googlegroups.com, ivkov...@gmail.com
oh, mine path was wrong :) i managed to generate it :)

Lukas Eder

unread,
Dec 5, 2014, 6:26:41 AM12/5/14
to jooq...@googlegroups.com
Hello,

Thanks for the feedback - I'm glad it works for you, now.
If you detect any further issues, we'll be more than happy to help.

Best Regards,
Lukas
Reply all
Reply to author
Forward
0 new messages