wildfly-extras / db-bootstrap Goto Github PK
View Code? Open in Web Editor NEWWildfly Database bootstrap extension
License: Apache License 2.0
Wildfly Database bootstrap extension
License: Apache License 2.0
The section "Configure the module" has wrong example of the db_bootstrap subsystem, it should have listed this :
Seems like if you add a @BootstrapDatabase
annotated class directly in the WAR file (that is in the /WEB-INF/classes
folder), and deploy the WAR file, then the annotated class is not found. (Annotated classes in a JAR file in the /WEB-INF/lib
folder will be found though).
If you add a WAR file to an EAR file, and the WAR file contains a @BootstrapDatabase
annotated class directly in the WAR file (that is in the /WEB-INF/classes
folder), and you include the WAR file in your filter (e.g. filter-on-name="*.jar, *.war"
), then db-bootstrap throws a java.lang.ClassNotFoundException
.
If the filter-on-name
attribute is left out, db-bootstrap will throw the following exception:
10:36:58,289 ERROR [org.jboss.as.server] (Controller Boot Thread) JBAS015956: Caught exception during boot: org.jboss.as.controller.persistence.ConfigurationPersistenceException: JBAS014676: Failed to parse configuration
at org.jboss.as.controller.persistence.XmlConfigurationPersister.load(XmlConfigurationPersister.java:112) [wildfly-controller-8.2.0.Final.jar:8.2.0.Final]
at org.jboss.as.server.ServerService.boot(ServerService.java:331) [wildfly-server-8.2.0.Final.jar:8.2.0.Final]
at org.jboss.as.controller.AbstractControllerService$1.run(AbstractControllerService.java:259) [wildfly-controller-8.2.0.Final.jar:8.2.0.Final]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_25]
Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[363,17]
Message: found: CHARACTERS, expected START_ELEMENT or END_ELEMENT
at com.sun.org.apache.xerces.internal.impl.XMLStreamReaderImpl.nextTag(XMLStreamReaderImpl.java:1254) [rt.jar:1.8.0_25]
at org.jboss.staxmapper.XMLExtendedStreamReaderImpl.nextTag(XMLExtendedStreamReaderImpl.java:152) [staxmapper-1.1.0.Final.jar:1.1.0.Final]
at org.jboss.as.controller.PersistentResourceXMLDescription.parseChildren(PersistentResourceXMLDescription.java:132) [wildfly-controller-8.2.0.Final.jar:8.2.0.Final]
at org.jboss.as.controller.PersistentResourceXMLDescription.parse(PersistentResourceXMLDescription.java:107) [wildfly-controller-8.2.0.Final.jar:8.2.0.Final]
at org.jboss.as.controller.PersistentResourceXMLDescription.parseChildren(PersistentResourceXMLDescription.java:135) [wildfly-controller-8.2.0.Final.jar:8.2.0.Final]
at org.jboss.as.controller.PersistentResourceXMLDescription.parse(PersistentResourceXMLDescription.java:107) [wildfly-controller-8.2.0.Final.jar:8.2.0.Final]
at org.wildfly.extras.db_bootstrap.DbBootstrapSubsystemParser.readElement(DbBootstrapSubsystemParser.java:64)
at org.wildfly.extras.db_bootstrap.DbBootstrapSubsystemParser.readElement(DbBootstrapSubsystemParser.java:38)
at org.jboss.staxmapper.XMLMapperImpl.processNested(XMLMapperImpl.java:110) [staxmapper-1.1.0.Final.jar:1.1.0.Final]
at org.jboss.staxmapper.XMLExtendedStreamReaderImpl.handleAny(XMLExtendedStreamReaderImpl.java:69) [staxmapper-1.1.0.Final.jar:1.1.0.Final]
at org.jboss.as.server.parsing.StandaloneXml.parseServerProfile(StandaloneXml.java:1131) [wildfly-server-8.2.0.Final.jar:8.2.0.Final]
at org.jboss.as.server.parsing.StandaloneXml.readServerElement_1_4(StandaloneXml.java:458) [wildfly-server-8.2.0.Final.jar:8.2.0.Final]
at org.jboss.as.server.parsing.StandaloneXml.readElement(StandaloneXml.java:145) [wildfly-server-8.2.0.Final.jar:8.2.0.Final]
at org.jboss.as.server.parsing.StandaloneXml.readElement(StandaloneXml.java:107) [wildfly-server-8.2.0.Final.jar:8.2.0.Final]
at org.jboss.staxmapper.XMLMapperImpl.processNested(XMLMapperImpl.java:110) [staxmapper-1.1.0.Final.jar:1.1.0.Final]
at org.jboss.staxmapper.XMLMapperImpl.parseDocument(XMLMapperImpl.java:69) [staxmapper-1.1.0.Final.jar:1.1.0.Final]
at org.jboss.as.controller.persistence.XmlConfigurationPersister.load(XmlConfigurationPersister.java:104) [wildfly-controller-8.2.0.Final.jar:8.2.0.Final]
... 3 more`
The @BootstrapDatabase annotation requires a Hibernate configuration XML file.
We claim that the extension supports non-Hibernate boots trappers.
So this attribute should be made optional.
It is likely that modern application developers would strive to depend on JPA only - rather than Hibernate.
It would therefore make sense that we enabled support for standard JPA bootstrapping. Fx by supporting persistence.xml documents. It would be a good start. But later revisions should probably support the "new" JPA EntityManagerFactor bootstrapping API too.
JBoss Tools 4.3.0.Beta2 and newer includes a new feature (always on) that explodes jars in a deployment if the server adaptor supports it. WildFly does.
This means that you now have exploded jars inside an exploded deployment which apparently is a problem for db_bootstrap because it cannot find the classes specified in its configuration.
While the configuration below works with JBoss Tool 4.3.0.Beta1, it breaks in JBoss Tool 4.3.0.Beta2 and newer with a ClassNotFoundException for com.example.Bootstrapper. The difference being that in Beta2, the class is located in some com.example*.jar while in Beta2, the class is exploded in the directory com.example*.jar/com.example. It also fails if the filter-on-name attribute is removed.
<scan name="Myname" filename="MyEar.ear" filter-on-name="com.example*.jar">
<class name="operation" classname="com.example.Bootstrapper" />
</scan>
The JBoss Tools 4.3.0.Beta2 feature: https://issues.jboss.org/browse/JBIDE-15250
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.