liquibase -- Cannot unmarshall the beans.xml

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

liquibase -- Cannot unmarshall the beans.xml

djheisterberg
Is anyone using liquibase 3 with OpenEJB?  I wasn't really intending to but discovered that liquibase is CDI-ready (maybe even CDI-demanding!) and found that simply having it in the classpath resulted in an exception when starting the container:

org.apache.openejb.OpenEJBException: Cannot unmarshall the beans.xml
        at org.apache.openejb.config.ReadDescriptors.readBeans(ReadDescriptors.java:552)
        at org.apache.openejb.config.ReadDescriptors.readBeans(ReadDescriptors.java:442)
        at org.apache.openejb.config.ReadDescriptors.deploy(ReadDescriptors.java:75)
        ... and much more ...

The liquibase beans.xml has only some weld-specific excludes.

I tried removing beans.xml from the liquibase jar.  The container came up, but it looks like CDI annotations were still being processed as it failed with unresolved injection points for some liquibase classes.

I do have a small maven project that reproduces this.

djh
Reply | Threaded
Open this post in threaded view
|

Re: liquibase -- Cannot unmarshall the beans.xml

Romain Manni-Bucau
Hi

If beans.xml has specific tags it will not be read.

If it fails once "fixed" it is surely it needs this particular config so
you need the same/equivalent for openejb (for instance using inclusion
config with scan.xml)
Le 12 août 2013 02:48, "djheisterberg" <[hidden email]> a écrit :

> Is anyone using liquibase 3 with OpenEJB?  I wasn't really intending to but
> discovered that liquibase is CDI-ready (maybe even CDI-demanding!) and
> found
> that simply having it in the classpath resulted in an exception when
> starting the container:
>
> org.apache.openejb.OpenEJBException: Cannot unmarshall the beans.xml
>         at
>
> org.apache.openejb.config.ReadDescriptors.readBeans(ReadDescriptors.java:552)
>         at
>
> org.apache.openejb.config.ReadDescriptors.readBeans(ReadDescriptors.java:442)
>         at
> org.apache.openejb.config.ReadDescriptors.deploy(ReadDescriptors.java:75)
>         ... and much more ...
>
> The liquibase beans.xml has only some weld-specific excludes.
>
> I tried removing beans.xml from the liquibase jar.  The container came up,
> but it looks like CDI annotations were still being processed as it failed
> with unresolved injection points for some liquibase classes.
>
> I do have a small maven project that reproduces this.
>
> djh
>
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/liquibase-Cannot-unmarshall-the-beans-xml-tp4664595.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|

Re: liquibase -- Cannot unmarshall the beans.xml

djheisterberg
Wow!  Thanks for the quick response -- go GMT!

This is a third-party jar so "fixing" it is not a long-term option.  The beans.xml contains weld exclusions in their own namespace.  Can't the OpenWebBeans provider simply ignore them?  If the CDI spec doesn't provide for that, or for a provider-neutral include/exclude mechanism, it pretty much excludes third-party jars from an application, does it not?

The beans.xml file is:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://java.sun.com/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:weld="http://jboss.org/schema/weld/beans"
    xsi:schemaLocation="
      http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/beans_1_0.xsd
      http://jboss.org/schema/weld/beans http://jboss.org/schema/weld/beans_1_1.xsd">
    <weld:scan>
        <weld:include name="**"/>
        <weld:exclude name="liquibase.integration.ant.**">
            <weld:if-class-available name="!org.apache.tools.ant.Task"/>
        </weld:exclude>
        <weld:exclude name="liquibase.integration.servlet.**">
            <weld:if-class-available name="!javax.servlet.ServletContext"/>
        </weld:exclude>
        <weld:exclude name="liquibase.integration.spring.**">
            <weld:if-class-available name="!org.springframework.beans.factory.InitializingBean"/>
        </weld:exclude>
    </weld:scan>
</beans>

Ignoring unknown namespaces would be a useful feature.

djh
Reply | Threaded
Open this post in threaded view
|

Re: liquibase -- Cannot unmarshall the beans.xml

Romain Manni-Bucau
Hi

in fact exclusion are standard in next cdi version.

Ignoring a namespace would mean ignoring app config if the user
misconfigured its app so that's not a solution too.

Here i think the liquid packaging should be reworked (it is easy to replace
it by a small custom cdi extension)

*Romain Manni-Bucau*
*Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
*Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/>
*LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
*Github: https://github.com/rmannibucau*



2013/8/12 djheisterberg <[hidden email]>

> Wow!  Thanks for the quick response -- go GMT!
>
> This is a third-party jar so "fixing" it is not a long-term option.  The
> beans.xml contains weld exclusions in their own namespace.  Can't the
> OpenWebBeans provider simply ignore them?  If the CDI spec doesn't provide
> for that, or for a provider-neutral include/exclude mechanism, it pretty
> much excludes third-party jars from an application, does it not?
>
> The beans.xml file is:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="http://java.sun.com/xml/ns/javaee"
>     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>     xmlns:weld="http://jboss.org/schema/weld/beans"
>     xsi:schemaLocation="
>       http://java.sun.com/xml/ns/javaee
> http://java.sun.com/xml/ns/javaee/beans_1_0.xsd
>       http://jboss.org/schema/weld/beans
> http://jboss.org/schema/weld/beans_1_1.xsd">
>     <weld:scan>
>         <weld:include name="**"/>
>         <weld:exclude name="liquibase.integration.ant.**">
>             <weld:if-class-available name="!org.apache.tools.ant.Task"/>
>         </weld:exclude>
>         <weld:exclude name="liquibase.integration.servlet.**">
>             <weld:if-class-available name="!javax.servlet.ServletContext"/>
>         </weld:exclude>
>         <weld:exclude name="liquibase.integration.spring.**">
>             <weld:if-class-available
> name="!org.springframework.beans.factory.InitializingBean"/>
>         </weld:exclude>
>     </weld:scan>
> </beans>
>
> Ignoring unknown namespaces would be a useful feature.
>
> djh
>
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/liquibase-Cannot-unmarshall-the-beans-xml-tp4664595p4664605.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>