Giter Site home page Giter Site logo

db-bootstrap's People

Contributors

fharms avatar mkjensen avatar moelholm avatar rasmuslund avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

db-bootstrap's Issues

Does not handle WAR files properly.

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.

db_bootstrap incompatible with change in JBoss Tools 4.3.0.Beta2 and newer

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

On the `<scan>` element the `filter-on-name` attribute should be optional, but is actually required

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`

Support JPA @BootstrapDatabase bootstrappers

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.