Comments (6)
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.
from hibernate5-ddl-maven-plugin.
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 java.xml.bind
, but all works running the app normally and fails only with the plugin. Maybe Hibernate tricks the parsing process somehow?
from hibernate5-ddl-maven-plugin.
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 @Audited
and run the plugin with Java 9 (adding some additional dependencies [1]).
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>
from hibernate5-ddl-maven-plugin.
What if you add
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD//EN"
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
To your hbm file? Not sure if http://www.hibernate.org/xsd/orm/hbm
is a valid DTD uri.
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?
from hibernate5-ddl-maven-plugin.
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 hibernate-entitymanager
as the plugin is dependent on that and not hibernate-core
).
from hibernate5-ddl-maven-plugin.
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 maven-jaxb2-plugin
works around this:
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);
}
}
from hibernate5-ddl-maven-plugin.
Related Issues (20)
- DDL generation fails when cache region factory cannot be found on class path HOT 3
- How to configure plugin for use with model classes under src/test/java ? HOT 2
- Issue with two differentes persistence units inside the persistence.xml HOT 1
- `useEnvers` not available as configuration anymore HOT 1
- Update and support hibernate V 5.3 And Java 9 HOT 2
- @Converter annotated classes are ignored HOT 1
- Pass persistence properties as plugin properties HOT 1
- [Feature Request] Use custom name strategy HOT 2
- scale, precision or @Size for numeric types (ORACLE DIALECTS) HOT 1
- threeten not present error HOT 1
- TypeDef Annotations in package-info.java are ignored HOT 1
- gen-ddl fails after upgrade to 2.4.0 HOT 9
- How can I specify *.hbm.xml mapping files? HOT 1
- Add support for Hibernate ORM 5.6 HOT 1
- @SequenceGenerator allocationSize not considered when generating DDL
- Plugin fails if we have a custom dialect but not a dialect
- omitDialectFromFileName does not work if customDialect is used
- Java9 required after 2.3.0+
- Support for Jakarta EE HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hibernate5-ddl-maven-plugin.