You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Tuomas Kiviaho (JIRA)" <ji...@apache.org> on 2018/03/23 14:49:00 UTC

[jira] [Commented] (FELIX-5794) maven-bundle-plugin fails to parse meta-persistence

    [ https://issues.apache.org/jira/browse/FELIX-5794?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16411507#comment-16411507 ] 

Tuomas Kiviaho commented on FELIX-5794:
---------------------------------------

This is caused by JpaPlugin. bnd seems to be picky about {{Require-Capability}} ending with ; I consideredd this to be a blocker for whole \{{JpaPlugin}} because {{jpa.xsl}} contains the following {{concat}} that causes this. 

The fix would consist of using http://www.xsltfunctions.com/xsl/fn_string-join.html to mend together interface and attributes + nl

{code:java}
<xsl:template name="service-capability">
<xsl:param name="interface"/>
<xsl:param name="attributes" select="''"/>
<xsl:value-of select="concat('Provide-Capability: osgi.service;effective:=active;',
'objectClass=', $interface, ';',
$attributes,
$nl)"/>
</xsl:template>

<xsl:template name="service-requirement">
<xsl:param name="interface"/>
<xsl:param name="attributes" select="''"/>
<xsl:value-of select="concat('Require-Capability: osgi.service;effective:=active;',
'objectClass=', $interface, ';',
$attributes,
$nl)"/>
</xsl:template>
{code}
 

> maven-bundle-plugin fails to parse meta-persistence
> ---------------------------------------------------
>
>                 Key: FELIX-5794
>                 URL: https://issues.apache.org/jira/browse/FELIX-5794
>             Project: Felix
>          Issue Type: Bug
>          Components: Maven Bundle Plugin
>    Affects Versions: maven-bundle-plugin-3.4.0, maven-bundle-plugin-3.5.0
>            Reporter: Jean-Baptiste Onofré
>            Priority: Major
>
> Since {{maven-bundle-plugin}} 3.4.0 (and the update to bnd 3.4.0), the plugin fails to build bundle containing {{<Meta-Persistence/>}}. NB: the same bundle builds fine with {{maven-bundle-plugin}} 3.3.0.
> The cause is:
> {code}
> [INFO] --- maven-bundle-plugin:3.5.0:bundle (default-bundle) @ karaf-jpa-example-provider ---
> Output: [Provide-Capability: osgi.service;effective:=active;objectClass=javax.persistence.EntityManager;osgi.unit.name="booking", Provide-Capability: osgi.service;effective:=active;objectClass=org.apache.aries.jpa.template.JpaTemplate;osgi.unit.name="booking", Require-Capability: osgi.service;effective:=active;objectClass=javax.sql.DataSource;filter:="(osgi.jndi.service.name=booking)", DynamicImport-Package: org.hibernate.proxy;javassist.util.proxy, Provide-Capability: osgi.service;effective:=active;objectClass=javax.persistence.EntityManagerFactory;osgi.unit.name="booking", Provide-Capability: osgi.service;effective:=active;objectClass=org.apache.aries.jpa.supplier.EmSupplier;osgi.unit.name="booking", Import-Package: org.hibernate.proxy;javassist.util.proxy;resolution:=optional, Require-Capability: osgi.extender;osgi.extender=aries.jpa, Require-Capability: osgi.service;effective:=active;objectClass=javax.persistence.spi.PersistenceProvider;javax.persistence.provider=org.hibernate.jpa.HibernatePersistenceProvider, Require-Capability: osgi.service;effective:=active;objectClass=javax.transaction.TransactionManager;]
> [ERROR] Bundle org.apache.karaf.examples:karaf-jpa-example-provider:bundle:4.2.0-SNAPSHOT : Header contains name field after attribute or directive: null from osgi.service;effective:=active;objectClass=javax.sql.DataSource;filter:="(osgi.jndi.service.name=booking)",osgi.extender;osgi.extender=aries.jpa,osgi.service;effective:=active;objectClass=javax.persistence.spi.PersistenceProvider;javax.persistence.provider=org.hibernate.jpa.HibernatePersistenceProvider,osgi.service;effective:=active;objectClass=javax.transaction.TransactionManager;. Name fields must be consecutive, separated by a ';' like a;b;c;x=3;y=4
> [ERROR] Error(s) found in bundle configuration
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)