-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Getting UnmarshalException #20
Comments
No real idea what is happening here. Does the project contain any XML mapping files for Hibernate? Also, it would be helpful if you can provide an example project with the error. That would be helpful do investigate this error. |
I don't have any XML files, just annotations. But debugging I see Envers creates mapping files on the fly (in memory maybe) and then parses them. Worth noting I'm on Java 9 which needs to have an explicit dependency on |
I've tested the plugin and it works if run with Java 1.8, but it fails with Java 9 throwing that exception. You can test this with just a simple entity annotated with I've also recreated a bare-bone plugin to replicate the issue: https://github.com/heruan/hibernate-ddl-generator but unfortunately I didn't find a solution yet. So currently this plugin does not work with Java 9 if there are Envers entities, maybe you wish to add a note for this in the README. [1] Dependencies needed for the plugin to run with Java 9: <dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.0</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-core</artifactId>
<version>2.3.0</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>2.3.0</version>
</dependency>
<dependency>
<groupId>javax.activation</groupId>
<artifactId>javax.activation-api</artifactId>
<version>1.2.0</version>
</dependency> |
What if you add
To your hbm file? Not sure if Edit I am aware that the hbm file in question is generated by envers. Perhaps we can try to see if we can reproduce the issue for various DTDs? |
Also, the 5.2 plugin is dependent on Hibernate 5.2.10, any post 5.2.10 fixes for Java 9+ support will not be available unless you specify the exact Hibernate artifact as plugin dependency. (you may have to override |
Thanks to HHH-12893 and highsource/jaxb-tools#120 seems the issue is related to the Maven plugin runtime in Java 9 and 10 not binding XML schema. Preloading the bindings as done by void setupBindInfoPackage() {
String nsuri = "http://www.hibernate.org/xsd/orm/hbm";
String packageInfoClassName = "org.hibernate.boot.jaxb.hbm.spi.package-info";
try {
final Class<?> packageInfoClass = Class
.forName(packageInfoClassName);
final XmlSchema xmlSchema = packageInfoClass
.getAnnotation(XmlSchema.class);
if (xmlSchema == null) {
this.getLog().warn(MessageFormat.format(
"Class [{0}] is missing the [{1}] annotation. Processing bindings will probably fail.",
packageInfoClassName, XmlSchema.class.getName()));
} else {
final String namespace = xmlSchema.namespace();
if (nsuri.equals(namespace)) {
this.getLog().warn(MessageFormat.format(
"Namespace of the [{0}] annotation does not match [{1}]. Processing bindings will probably fail.",
XmlSchema.class.getName(), nsuri));
}
}
} catch (ClassNotFoundException cnfex) {
this.getLog().warn(MessageFormat.format(
"Class [{0}] could not be found. Processing bindings will probably fail.",
packageInfoClassName), cnfex);
}
} |
When I try to generate the schema, I get:
but I do not have XML files with that namespace anywhere. Did anyone ever get into this problem?
The text was updated successfully, but these errors were encountered: