Tarin Gamberini

A software engineer and a passionate java programmer

Gradle in Action book review

This autumn I was selected from Manning as one of the technical reviewers of the book “Gradle in Action” by Benjamin Muschko.

Gradle in Action starts with a beautiful introduction to Gradle with the classic “in action” approach.

How to generate DDL with Hibernate 4, Hibernate Tools and Maven

Hibernate Tools is a toolset for Hibernate3 implemented as an integrated suite of Eclipse plugins, together with a unified Ant task for integration into the build cycle.

Working with Maven you can use the hibernate3-maven-plugin. But this is (as the name states) only for Hibernate 3 and does not support Hibernate 4.

As reported by Thomas Letsch [1] the Hibernate tools for Hibernate 4.x is not yet finished, and the obvious solution is to just use the Maven ant-run plugin and execute the hibernate-tools Ant task. So following the Thomas Letsch’s article I have worked out a solution that suits me well.

Spring in Action Book Review

This summer I red “Spring in Action” by Craig Walls.

The book is well written, easy to read, with lots of code fragments which clarify textual descriptions, and with references to Design Pattern and JSR too.

How to validate DocBook 5.0 in Netbeans 7.0.1

This is the DocBook file I’d like to validate:

sample_article.xml
1
2
3
4
5
6
7
8
9
10
<?xml version='1.0' encoding='UTF-8'?>
<article version="5.0" xml:lang="en"
  xmlns="http://docbook.org/ns/docbook"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:xlink="http://www.w3.org/1999/xlink"
  xsi:schemaLocation="
    http://docbook.org/ns/docbook http://docbook.org/xml/5.0/xsd/docbook.xsd">
    <title>Sample article</title>
    <para>This is a very short article.</para>
</article>

I’ve tried validating sample_article.xml In NetBeans:

unfortunately NetBeans logs:

1
2
3
4
5
6
7
8
9
10
11
XML validation started.
Checking file:/C:/sample_article.xml...
Referenced entity at "http://docbook.org/xml/5.0/xsd/docbook.xsd".
Referenced entity at "http://docbook.org/xml/5.0/xsd/xlink.xsd".
Referenced entity at "nbres:/org/netbeans/modules/j2ee/ddloaders/catalog/resources/XMLSchema.dtd".
Referenced entity at "nbres:/org/netbeans/modules/j2ee/ddloaders/catalog/resources/datatypes.dtd".
src-resolve: Cannot resolve the name 'xml:id' to a(n) 'attribute declaration' component. [6] http://docbook.org/xml/5.0/xsd/docbook.xsd
s4s-elt-must-match.1: The content of 'db.common.attributes' must match (annotation?, ((attribute | attributeGroup)*, anyAttribute?)). A problem was found starting at: attribute. [6] http://docbook.org/xml/5.0/xsd/docbook.xsd
cvc-complex-type.3.2.2: Attribute 'version' is not allowed to appear in element 'article'. [6]
cvc-complex-type.3.2.2: Attribute 'xml:lang' is not allowed to appear in element 'article'. [6]
XML validation finished.

complaining it Cannot resolve the name 'xml:id' as defined in the http://docbook.org/xml/5.0/xsd/docbook.xsd.

But wait a moment! Where does NetBeans get such http://docbook.org/xml/5.0/xsd/docbook.xsd?