You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@karaf.apache.org by "Uwe Barthel (JIRA)" <ji...@apache.org> on 2012/07/04 10:49:33 UTC

[jira] [Created] (KARAF-1617) Blueprint deployer in combination with maven URL deployer creates wrong OSGi/blueprint/ file

Uwe Barthel created KARAF-1617:
----------------------------------

             Summary: Blueprint deployer in combination with maven URL deployer creates wrong OSGi/blueprint/ file
                 Key: KARAF-1617
                 URL: https://issues.apache.org/jira/browse/KARAF-1617
             Project: Karaf
          Issue Type: Bug
          Components: karaf-core
    Affects Versions: 2.2.8
         Environment: Karaf 2.2.8

* org/apache/karaf/deployer/org.apache.karaf.deployer.blueprint/2.2.8
* org/apache/aries/blueprint/org.apache.aries.blueprint/0.3.2
            Reporter: Uwe Barthel


We are using the Aries JNDI service for providing database-datasources via JNDI.

The datasource definition is a blueprint-XML file like [this one|https://github.com/cschneider/Karaf-Tutorial/blob/master/db/datasource/datasource-derby.xml] and is located in our Maven repository.

I try to install the datasource definition like:

{quote}
bundle:install -s blueprint:mvn:my.product.database/my.product.database.layer//xml/datasource-hsqldb
{quote}

The bundle will be installed but the blueprint service was not created.

The blueprint deployer creates a bundle-JAR file and including a new ZipEntry as blueprint service descriptor into {{OSGi/blueprint/}}.


{code:title=org.apache.karaf.deployer.blueprint.BlueprintTransformer.transform(URL, OutputStream)}
[...]

        String name = url.getPath();
        int idx = name.lastIndexOf('/');
        if (idx >= 0) {
            name = name.substring(idx + 1);
        }

[...]

        e = new ZipEntry("OSGI-INF/blueprint/" + name);
        out.putNextEntry(e);
        // Copy the new DOM
        if (tf == null) {
            tf = TransformerFactory.newInstance();
        }
        tf.newTransformer().transform(new DOMSource(doc), new StreamResult(out));
        out.closeEntry();

[...]
{code}

Based on the {{mvn:}} URL the name of the blueprint descriptor file is {{datasource-hsqldb}} (w/o the {{.xml}} extension).

The blueprint service needs the {{.xml}} file extension.

{code:title=org.apache.aries.blueprint.container.BlueprintExtender.checkBundle(Bundle)}
[...]
           addEntries(bundle, name, "*.xml", pathList);
[...]
{code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Assigned] (KARAF-1617) Blueprint deployer in combination with maven URL deployer creates wrong OSGi/blueprint/ file

Posted by "Freeman Fang (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/KARAF-1617?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Freeman Fang reassigned KARAF-1617:
-----------------------------------

    Assignee: Freeman Fang
    
> Blueprint deployer in combination with maven URL deployer creates wrong OSGi/blueprint/ file
> --------------------------------------------------------------------------------------------
>
>                 Key: KARAF-1617
>                 URL: https://issues.apache.org/jira/browse/KARAF-1617
>             Project: Karaf
>          Issue Type: Bug
>          Components: karaf-core
>    Affects Versions: 2.2.8
>         Environment: Karaf 2.2.8
> * org/apache/karaf/deployer/org.apache.karaf.deployer.blueprint/2.2.8
> * org/apache/aries/blueprint/org.apache.aries.blueprint/0.3.2
>            Reporter: Uwe Barthel
>            Assignee: Freeman Fang
>              Labels: newbie
>
> We are using the Aries JNDI service for providing database-datasources via JNDI.
> The datasource definition is a blueprint-XML file like [this one|https://github.com/cschneider/Karaf-Tutorial/blob/master/db/datasource/datasource-derby.xml] and is located in our Maven repository.
> I try to install the datasource definition like:
> {quote}
> bundle:install -s blueprint:mvn:my.product.database/my.product.database.layer//xml/datasource-hsqldb
> {quote}
> or via Kara feature:
> {quote}
> feature:install datasource-hsqldb
> {quote}
> {code:title=features.xml}
> [...]
>   <feature name="datasource-hsqldb" version="${project.version}" resolver="(obr)">
>     <feature>hsqldb</feature>
>     <bundle >blueprint:mvn:my.product.database/my.product.database.layer/${project.version}/xml/datasource-hsqldb</bundle>
>   </feature>
> [...]
> {code}
> The bundle will be installed but the blueprint service was not created.
> The blueprint deployer creates a bundle-JAR file and including a new ZipEntry as blueprint service descriptor into {{OSGi/blueprint/}}.
> {code:title=org.apache.karaf.deployer.blueprint.BlueprintTransformer.transform(URL, OutputStream)}
> [...]
>         String name = url.getPath();
>         int idx = name.lastIndexOf('/');
>         if (idx >= 0) {
>             name = name.substring(idx + 1);
>         }
> [...]
>         e = new ZipEntry("OSGI-INF/blueprint/" + name);
>         out.putNextEntry(e);
>         // Copy the new DOM
>         if (tf == null) {
>             tf = TransformerFactory.newInstance();
>         }
>         tf.newTransformer().transform(new DOMSource(doc), new StreamResult(out));
>         out.closeEntry();
> [...]
> {code}
> Based on the {{mvn:}} URL the name of the blueprint descriptor file is {{datasource-hsqldb}} (w/o the {{.xml}} extension).
> The blueprint service needs the {{.xml}} file extension.
> {code:title=org.apache.aries.blueprint.container.BlueprintExtender.checkBundle(Bundle)}
> [...]
>            addEntries(bundle, name, "*.xml", pathList);
> [...]
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (KARAF-1617) Blueprint deployer in combination with maven URL deployer creates wrong OSGi/blueprint/ file

Posted by "Freeman Fang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/KARAF-1617?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13409135#comment-13409135 ] 

Freeman Fang commented on KARAF-1617:
-------------------------------------

HI Uwe,

Your patch miss a test file test-fileextension, not a big deal though. I added it.
Thanks for the patch

Freeman
                
> Blueprint deployer in combination with maven URL deployer creates wrong OSGi/blueprint/ file
> --------------------------------------------------------------------------------------------
>
>                 Key: KARAF-1617
>                 URL: https://issues.apache.org/jira/browse/KARAF-1617
>             Project: Karaf
>          Issue Type: Bug
>          Components: karaf-core
>    Affects Versions: 2.2.8
>         Environment: Karaf 2.2.8
> * org/apache/karaf/deployer/org.apache.karaf.deployer.blueprint/2.2.8
> * org/apache/aries/blueprint/org.apache.aries.blueprint/0.3.2
>            Reporter: Uwe Barthel
>            Assignee: Freeman Fang
>              Labels: newbie, patch
>         Attachments: patch_karaf_1617.txt
>
>
> We are using the Aries JNDI service for providing database-datasources via JNDI.
> The datasource definition is a blueprint-XML file like [this one|https://github.com/cschneider/Karaf-Tutorial/blob/master/db/datasource/datasource-derby.xml] and is located in our Maven repository.
> I try to install the datasource definition like:
> {quote}
> bundle:install -s blueprint:mvn:my.product.database/my.product.database.layer//xml/datasource-hsqldb
> {quote}
> or via Kara feature:
> {quote}
> feature:install datasource-hsqldb
> {quote}
> {code:title=features.xml}
> [...]
>   <feature name="datasource-hsqldb" version="${project.version}" resolver="(obr)">
>     <feature>hsqldb</feature>
>     <bundle >blueprint:mvn:my.product.database/my.product.database.layer/${project.version}/xml/datasource-hsqldb</bundle>
>   </feature>
> [...]
> {code}
> The bundle will be installed but the blueprint service was not created.
> The blueprint deployer creates a bundle-JAR file and including a new ZipEntry as blueprint service descriptor into {{OSGi/blueprint/}}.
> {code:title=org.apache.karaf.deployer.blueprint.BlueprintTransformer.transform(URL, OutputStream)}
> [...]
>         String name = url.getPath();
>         int idx = name.lastIndexOf('/');
>         if (idx >= 0) {
>             name = name.substring(idx + 1);
>         }
> [...]
>         e = new ZipEntry("OSGI-INF/blueprint/" + name);
>         out.putNextEntry(e);
>         // Copy the new DOM
>         if (tf == null) {
>             tf = TransformerFactory.newInstance();
>         }
>         tf.newTransformer().transform(new DOMSource(doc), new StreamResult(out));
>         out.closeEntry();
> [...]
> {code}
> Based on the {{mvn:}} URL the name of the blueprint descriptor file is {{datasource-hsqldb}} (w/o the {{.xml}} extension).
> The blueprint service needs the {{.xml}} file extension.
> {code:title=org.apache.aries.blueprint.container.BlueprintExtender.checkBundle(Bundle)}
> [...]
>            addEntries(bundle, name, "*.xml", pathList);
> [...]
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (KARAF-1617) Blueprint deployer in combination with maven URL deployer creates wrong OSGi/blueprint/ file

Posted by "Freeman Fang (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/KARAF-1617?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Freeman Fang resolved KARAF-1617.
---------------------------------

       Resolution: Fixed
    Fix Version/s: 3.0.0
                   2.3.0
                   2.2.9

apply patch on behalf of Uwe Barthel with thanks

http://svn.apache.org/viewvc?rev=1358899&view=rev for trunk
http://svn.apache.org/viewvc?rev=1358900&view=rev for 2.3.x branch
http://svn.apache.org/viewvc?rev=1358898&view=rev for 2.2.x branch

                
> Blueprint deployer in combination with maven URL deployer creates wrong OSGi/blueprint/ file
> --------------------------------------------------------------------------------------------
>
>                 Key: KARAF-1617
>                 URL: https://issues.apache.org/jira/browse/KARAF-1617
>             Project: Karaf
>          Issue Type: Bug
>          Components: karaf-core
>    Affects Versions: 2.2.8
>         Environment: Karaf 2.2.8
> * org/apache/karaf/deployer/org.apache.karaf.deployer.blueprint/2.2.8
> * org/apache/aries/blueprint/org.apache.aries.blueprint/0.3.2
>            Reporter: Uwe Barthel
>            Assignee: Freeman Fang
>              Labels: newbie, patch
>             Fix For: 2.2.9, 2.3.0, 3.0.0
>
>         Attachments: patch_karaf_1617.txt
>
>
> We are using the Aries JNDI service for providing database-datasources via JNDI.
> The datasource definition is a blueprint-XML file like [this one|https://github.com/cschneider/Karaf-Tutorial/blob/master/db/datasource/datasource-derby.xml] and is located in our Maven repository.
> I try to install the datasource definition like:
> {quote}
> bundle:install -s blueprint:mvn:my.product.database/my.product.database.layer//xml/datasource-hsqldb
> {quote}
> or via Kara feature:
> {quote}
> feature:install datasource-hsqldb
> {quote}
> {code:title=features.xml}
> [...]
>   <feature name="datasource-hsqldb" version="${project.version}" resolver="(obr)">
>     <feature>hsqldb</feature>
>     <bundle >blueprint:mvn:my.product.database/my.product.database.layer/${project.version}/xml/datasource-hsqldb</bundle>
>   </feature>
> [...]
> {code}
> The bundle will be installed but the blueprint service was not created.
> The blueprint deployer creates a bundle-JAR file and including a new ZipEntry as blueprint service descriptor into {{OSGi/blueprint/}}.
> {code:title=org.apache.karaf.deployer.blueprint.BlueprintTransformer.transform(URL, OutputStream)}
> [...]
>         String name = url.getPath();
>         int idx = name.lastIndexOf('/');
>         if (idx >= 0) {
>             name = name.substring(idx + 1);
>         }
> [...]
>         e = new ZipEntry("OSGI-INF/blueprint/" + name);
>         out.putNextEntry(e);
>         // Copy the new DOM
>         if (tf == null) {
>             tf = TransformerFactory.newInstance();
>         }
>         tf.newTransformer().transform(new DOMSource(doc), new StreamResult(out));
>         out.closeEntry();
> [...]
> {code}
> Based on the {{mvn:}} URL the name of the blueprint descriptor file is {{datasource-hsqldb}} (w/o the {{.xml}} extension).
> The blueprint service needs the {{.xml}} file extension.
> {code:title=org.apache.aries.blueprint.container.BlueprintExtender.checkBundle(Bundle)}
> [...]
>            addEntries(bundle, name, "*.xml", pathList);
> [...]
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (KARAF-1617) Blueprint deployer in combination with maven URL deployer creates wrong OSGi/blueprint/ file

Posted by "Uwe Barthel (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/KARAF-1617?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Uwe Barthel updated KARAF-1617:
-------------------------------

    Attachment: patch_karaf_1617.txt

Patch of src/main/java/org/apache/karaf/deployer/blueprint/BlueprintTransformer.java and JUnit tests included
                
> Blueprint deployer in combination with maven URL deployer creates wrong OSGi/blueprint/ file
> --------------------------------------------------------------------------------------------
>
>                 Key: KARAF-1617
>                 URL: https://issues.apache.org/jira/browse/KARAF-1617
>             Project: Karaf
>          Issue Type: Bug
>          Components: karaf-core
>    Affects Versions: 2.2.8
>         Environment: Karaf 2.2.8
> * org/apache/karaf/deployer/org.apache.karaf.deployer.blueprint/2.2.8
> * org/apache/aries/blueprint/org.apache.aries.blueprint/0.3.2
>            Reporter: Uwe Barthel
>            Assignee: Freeman Fang
>              Labels: newbie
>         Attachments: patch_karaf_1617.txt
>
>
> We are using the Aries JNDI service for providing database-datasources via JNDI.
> The datasource definition is a blueprint-XML file like [this one|https://github.com/cschneider/Karaf-Tutorial/blob/master/db/datasource/datasource-derby.xml] and is located in our Maven repository.
> I try to install the datasource definition like:
> {quote}
> bundle:install -s blueprint:mvn:my.product.database/my.product.database.layer//xml/datasource-hsqldb
> {quote}
> or via Kara feature:
> {quote}
> feature:install datasource-hsqldb
> {quote}
> {code:title=features.xml}
> [...]
>   <feature name="datasource-hsqldb" version="${project.version}" resolver="(obr)">
>     <feature>hsqldb</feature>
>     <bundle >blueprint:mvn:my.product.database/my.product.database.layer/${project.version}/xml/datasource-hsqldb</bundle>
>   </feature>
> [...]
> {code}
> The bundle will be installed but the blueprint service was not created.
> The blueprint deployer creates a bundle-JAR file and including a new ZipEntry as blueprint service descriptor into {{OSGi/blueprint/}}.
> {code:title=org.apache.karaf.deployer.blueprint.BlueprintTransformer.transform(URL, OutputStream)}
> [...]
>         String name = url.getPath();
>         int idx = name.lastIndexOf('/');
>         if (idx >= 0) {
>             name = name.substring(idx + 1);
>         }
> [...]
>         e = new ZipEntry("OSGI-INF/blueprint/" + name);
>         out.putNextEntry(e);
>         // Copy the new DOM
>         if (tf == null) {
>             tf = TransformerFactory.newInstance();
>         }
>         tf.newTransformer().transform(new DOMSource(doc), new StreamResult(out));
>         out.closeEntry();
> [...]
> {code}
> Based on the {{mvn:}} URL the name of the blueprint descriptor file is {{datasource-hsqldb}} (w/o the {{.xml}} extension).
> The blueprint service needs the {{.xml}} file extension.
> {code:title=org.apache.aries.blueprint.container.BlueprintExtender.checkBundle(Bundle)}
> [...]
>            addEntries(bundle, name, "*.xml", pathList);
> [...]
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (KARAF-1617) Blueprint deployer in combination with maven URL deployer creates wrong OSGi/blueprint/ file

Posted by "Uwe Barthel (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/KARAF-1617?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Uwe Barthel updated KARAF-1617:
-------------------------------

    Description: 
We are using the Aries JNDI service for providing database-datasources via JNDI.

The datasource definition is a blueprint-XML file like [this one|https://github.com/cschneider/Karaf-Tutorial/blob/master/db/datasource/datasource-derby.xml] and is located in our Maven repository.

I try to install the datasource definition like:

{quote}
bundle:install -s blueprint:mvn:my.product.database/my.product.database.layer//xml/datasource-hsqldb
{quote}

or via Kara feature:

{quote}
feature:install datasource-hsqldb
{quote}

{code:title=features.xml}
[...]

  <feature name="datasource-hsqldb" version="${project.version}" resolver="(obr)">
    <feature>hsqldb</feature>
    <bundle >blueprint:mvn:my.product.database/my.product.database.layer/${project.version}/xml/datasource-hsqldb</bundle>
  </feature>

[...]
{code}

The bundle will be installed but the blueprint service was not created.

The blueprint deployer creates a bundle-JAR file and including a new ZipEntry as blueprint service descriptor into {{OSGi/blueprint/}}.


{code:title=org.apache.karaf.deployer.blueprint.BlueprintTransformer.transform(URL, OutputStream)}
[...]

        String name = url.getPath();
        int idx = name.lastIndexOf('/');
        if (idx >= 0) {
            name = name.substring(idx + 1);
        }

[...]

        e = new ZipEntry("OSGI-INF/blueprint/" + name);
        out.putNextEntry(e);
        // Copy the new DOM
        if (tf == null) {
            tf = TransformerFactory.newInstance();
        }
        tf.newTransformer().transform(new DOMSource(doc), new StreamResult(out));
        out.closeEntry();

[...]
{code}

Based on the {{mvn:}} URL the name of the blueprint descriptor file is {{datasource-hsqldb}} (w/o the {{.xml}} extension).

The blueprint service needs the {{.xml}} file extension.

{code:title=org.apache.aries.blueprint.container.BlueprintExtender.checkBundle(Bundle)}
[...]
           addEntries(bundle, name, "*.xml", pathList);
[...]
{code}

  was:
We are using the Aries JNDI service for providing database-datasources via JNDI.

The datasource definition is a blueprint-XML file like [this one|https://github.com/cschneider/Karaf-Tutorial/blob/master/db/datasource/datasource-derby.xml] and is located in our Maven repository.

I try to install the datasource definition like:

{quote}
bundle:install -s blueprint:mvn:my.product.database/my.product.database.layer//xml/datasource-hsqldb
{quote}

The bundle will be installed but the blueprint service was not created.

The blueprint deployer creates a bundle-JAR file and including a new ZipEntry as blueprint service descriptor into {{OSGi/blueprint/}}.


{code:title=org.apache.karaf.deployer.blueprint.BlueprintTransformer.transform(URL, OutputStream)}
[...]

        String name = url.getPath();
        int idx = name.lastIndexOf('/');
        if (idx >= 0) {
            name = name.substring(idx + 1);
        }

[...]

        e = new ZipEntry("OSGI-INF/blueprint/" + name);
        out.putNextEntry(e);
        // Copy the new DOM
        if (tf == null) {
            tf = TransformerFactory.newInstance();
        }
        tf.newTransformer().transform(new DOMSource(doc), new StreamResult(out));
        out.closeEntry();

[...]
{code}

Based on the {{mvn:}} URL the name of the blueprint descriptor file is {{datasource-hsqldb}} (w/o the {{.xml}} extension).

The blueprint service needs the {{.xml}} file extension.

{code:title=org.apache.aries.blueprint.container.BlueprintExtender.checkBundle(Bundle)}
[...]
           addEntries(bundle, name, "*.xml", pathList);
[...]
{code}

    
> Blueprint deployer in combination with maven URL deployer creates wrong OSGi/blueprint/ file
> --------------------------------------------------------------------------------------------
>
>                 Key: KARAF-1617
>                 URL: https://issues.apache.org/jira/browse/KARAF-1617
>             Project: Karaf
>          Issue Type: Bug
>          Components: karaf-core
>    Affects Versions: 2.2.8
>         Environment: Karaf 2.2.8
> * org/apache/karaf/deployer/org.apache.karaf.deployer.blueprint/2.2.8
> * org/apache/aries/blueprint/org.apache.aries.blueprint/0.3.2
>            Reporter: Uwe Barthel
>              Labels: newbie
>
> We are using the Aries JNDI service for providing database-datasources via JNDI.
> The datasource definition is a blueprint-XML file like [this one|https://github.com/cschneider/Karaf-Tutorial/blob/master/db/datasource/datasource-derby.xml] and is located in our Maven repository.
> I try to install the datasource definition like:
> {quote}
> bundle:install -s blueprint:mvn:my.product.database/my.product.database.layer//xml/datasource-hsqldb
> {quote}
> or via Kara feature:
> {quote}
> feature:install datasource-hsqldb
> {quote}
> {code:title=features.xml}
> [...]
>   <feature name="datasource-hsqldb" version="${project.version}" resolver="(obr)">
>     <feature>hsqldb</feature>
>     <bundle >blueprint:mvn:my.product.database/my.product.database.layer/${project.version}/xml/datasource-hsqldb</bundle>
>   </feature>
> [...]
> {code}
> The bundle will be installed but the blueprint service was not created.
> The blueprint deployer creates a bundle-JAR file and including a new ZipEntry as blueprint service descriptor into {{OSGi/blueprint/}}.
> {code:title=org.apache.karaf.deployer.blueprint.BlueprintTransformer.transform(URL, OutputStream)}
> [...]
>         String name = url.getPath();
>         int idx = name.lastIndexOf('/');
>         if (idx >= 0) {
>             name = name.substring(idx + 1);
>         }
> [...]
>         e = new ZipEntry("OSGI-INF/blueprint/" + name);
>         out.putNextEntry(e);
>         // Copy the new DOM
>         if (tf == null) {
>             tf = TransformerFactory.newInstance();
>         }
>         tf.newTransformer().transform(new DOMSource(doc), new StreamResult(out));
>         out.closeEntry();
> [...]
> {code}
> Based on the {{mvn:}} URL the name of the blueprint descriptor file is {{datasource-hsqldb}} (w/o the {{.xml}} extension).
> The blueprint service needs the {{.xml}} file extension.
> {code:title=org.apache.aries.blueprint.container.BlueprintExtender.checkBundle(Bundle)}
> [...]
>            addEntries(bundle, name, "*.xml", pathList);
> [...]
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (KARAF-1617) Blueprint deployer in combination with maven URL deployer creates wrong OSGi/blueprint/ file

Posted by "Uwe Barthel (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/KARAF-1617?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Uwe Barthel updated KARAF-1617:
-------------------------------

    Labels: newbie patch  (was: newbie)
    
> Blueprint deployer in combination with maven URL deployer creates wrong OSGi/blueprint/ file
> --------------------------------------------------------------------------------------------
>
>                 Key: KARAF-1617
>                 URL: https://issues.apache.org/jira/browse/KARAF-1617
>             Project: Karaf
>          Issue Type: Bug
>          Components: karaf-core
>    Affects Versions: 2.2.8
>         Environment: Karaf 2.2.8
> * org/apache/karaf/deployer/org.apache.karaf.deployer.blueprint/2.2.8
> * org/apache/aries/blueprint/org.apache.aries.blueprint/0.3.2
>            Reporter: Uwe Barthel
>            Assignee: Freeman Fang
>              Labels: newbie, patch
>         Attachments: patch_karaf_1617.txt
>
>
> We are using the Aries JNDI service for providing database-datasources via JNDI.
> The datasource definition is a blueprint-XML file like [this one|https://github.com/cschneider/Karaf-Tutorial/blob/master/db/datasource/datasource-derby.xml] and is located in our Maven repository.
> I try to install the datasource definition like:
> {quote}
> bundle:install -s blueprint:mvn:my.product.database/my.product.database.layer//xml/datasource-hsqldb
> {quote}
> or via Kara feature:
> {quote}
> feature:install datasource-hsqldb
> {quote}
> {code:title=features.xml}
> [...]
>   <feature name="datasource-hsqldb" version="${project.version}" resolver="(obr)">
>     <feature>hsqldb</feature>
>     <bundle >blueprint:mvn:my.product.database/my.product.database.layer/${project.version}/xml/datasource-hsqldb</bundle>
>   </feature>
> [...]
> {code}
> The bundle will be installed but the blueprint service was not created.
> The blueprint deployer creates a bundle-JAR file and including a new ZipEntry as blueprint service descriptor into {{OSGi/blueprint/}}.
> {code:title=org.apache.karaf.deployer.blueprint.BlueprintTransformer.transform(URL, OutputStream)}
> [...]
>         String name = url.getPath();
>         int idx = name.lastIndexOf('/');
>         if (idx >= 0) {
>             name = name.substring(idx + 1);
>         }
> [...]
>         e = new ZipEntry("OSGI-INF/blueprint/" + name);
>         out.putNextEntry(e);
>         // Copy the new DOM
>         if (tf == null) {
>             tf = TransformerFactory.newInstance();
>         }
>         tf.newTransformer().transform(new DOMSource(doc), new StreamResult(out));
>         out.closeEntry();
> [...]
> {code}
> Based on the {{mvn:}} URL the name of the blueprint descriptor file is {{datasource-hsqldb}} (w/o the {{.xml}} extension).
> The blueprint service needs the {{.xml}} file extension.
> {code:title=org.apache.aries.blueprint.container.BlueprintExtender.checkBundle(Bundle)}
> [...]
>            addEntries(bundle, name, "*.xml", pathList);
> [...]
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Closed] (KARAF-1617) Blueprint deployer in combination with maven URL deployer creates wrong OSGi/blueprint/ file

Posted by "Uwe Barthel (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/KARAF-1617?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Uwe Barthel closed KARAF-1617.
------------------------------


Tested with 2.2.9-SNAPSHOT. Works fine. Thx.
                
> Blueprint deployer in combination with maven URL deployer creates wrong OSGi/blueprint/ file
> --------------------------------------------------------------------------------------------
>
>                 Key: KARAF-1617
>                 URL: https://issues.apache.org/jira/browse/KARAF-1617
>             Project: Karaf
>          Issue Type: Bug
>          Components: karaf-core
>    Affects Versions: 2.2.8
>         Environment: Karaf 2.2.8
> * org/apache/karaf/deployer/org.apache.karaf.deployer.blueprint/2.2.8
> * org/apache/aries/blueprint/org.apache.aries.blueprint/0.3.2
>            Reporter: Uwe Barthel
>            Assignee: Freeman Fang
>              Labels: newbie, patch
>             Fix For: 2.2.9, 2.3.0, 3.0.0
>
>         Attachments: patch_karaf_1617.txt
>
>
> We are using the Aries JNDI service for providing database-datasources via JNDI.
> The datasource definition is a blueprint-XML file like [this one|https://github.com/cschneider/Karaf-Tutorial/blob/master/db/datasource/datasource-derby.xml] and is located in our Maven repository.
> I try to install the datasource definition like:
> {quote}
> bundle:install -s blueprint:mvn:my.product.database/my.product.database.layer//xml/datasource-hsqldb
> {quote}
> or via Kara feature:
> {quote}
> feature:install datasource-hsqldb
> {quote}
> {code:title=features.xml}
> [...]
>   <feature name="datasource-hsqldb" version="${project.version}" resolver="(obr)">
>     <feature>hsqldb</feature>
>     <bundle >blueprint:mvn:my.product.database/my.product.database.layer/${project.version}/xml/datasource-hsqldb</bundle>
>   </feature>
> [...]
> {code}
> The bundle will be installed but the blueprint service was not created.
> The blueprint deployer creates a bundle-JAR file and including a new ZipEntry as blueprint service descriptor into {{OSGi/blueprint/}}.
> {code:title=org.apache.karaf.deployer.blueprint.BlueprintTransformer.transform(URL, OutputStream)}
> [...]
>         String name = url.getPath();
>         int idx = name.lastIndexOf('/');
>         if (idx >= 0) {
>             name = name.substring(idx + 1);
>         }
> [...]
>         e = new ZipEntry("OSGI-INF/blueprint/" + name);
>         out.putNextEntry(e);
>         // Copy the new DOM
>         if (tf == null) {
>             tf = TransformerFactory.newInstance();
>         }
>         tf.newTransformer().transform(new DOMSource(doc), new StreamResult(out));
>         out.closeEntry();
> [...]
> {code}
> Based on the {{mvn:}} URL the name of the blueprint descriptor file is {{datasource-hsqldb}} (w/o the {{.xml}} extension).
> The blueprint service needs the {{.xml}} file extension.
> {code:title=org.apache.aries.blueprint.container.BlueprintExtender.checkBundle(Bundle)}
> [...]
>            addEntries(bundle, name, "*.xml", pathList);
> [...]
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Work started] (KARAF-1617) Blueprint deployer in combination with maven URL deployer creates wrong OSGi/blueprint/ file

Posted by "Freeman Fang (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/KARAF-1617?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Work on KARAF-1617 started by Freeman Fang.

> Blueprint deployer in combination with maven URL deployer creates wrong OSGi/blueprint/ file
> --------------------------------------------------------------------------------------------
>
>                 Key: KARAF-1617
>                 URL: https://issues.apache.org/jira/browse/KARAF-1617
>             Project: Karaf
>          Issue Type: Bug
>          Components: karaf-core
>    Affects Versions: 2.2.8
>         Environment: Karaf 2.2.8
> * org/apache/karaf/deployer/org.apache.karaf.deployer.blueprint/2.2.8
> * org/apache/aries/blueprint/org.apache.aries.blueprint/0.3.2
>            Reporter: Uwe Barthel
>            Assignee: Freeman Fang
>              Labels: newbie, patch
>         Attachments: patch_karaf_1617.txt
>
>
> We are using the Aries JNDI service for providing database-datasources via JNDI.
> The datasource definition is a blueprint-XML file like [this one|https://github.com/cschneider/Karaf-Tutorial/blob/master/db/datasource/datasource-derby.xml] and is located in our Maven repository.
> I try to install the datasource definition like:
> {quote}
> bundle:install -s blueprint:mvn:my.product.database/my.product.database.layer//xml/datasource-hsqldb
> {quote}
> or via Kara feature:
> {quote}
> feature:install datasource-hsqldb
> {quote}
> {code:title=features.xml}
> [...]
>   <feature name="datasource-hsqldb" version="${project.version}" resolver="(obr)">
>     <feature>hsqldb</feature>
>     <bundle >blueprint:mvn:my.product.database/my.product.database.layer/${project.version}/xml/datasource-hsqldb</bundle>
>   </feature>
> [...]
> {code}
> The bundle will be installed but the blueprint service was not created.
> The blueprint deployer creates a bundle-JAR file and including a new ZipEntry as blueprint service descriptor into {{OSGi/blueprint/}}.
> {code:title=org.apache.karaf.deployer.blueprint.BlueprintTransformer.transform(URL, OutputStream)}
> [...]
>         String name = url.getPath();
>         int idx = name.lastIndexOf('/');
>         if (idx >= 0) {
>             name = name.substring(idx + 1);
>         }
> [...]
>         e = new ZipEntry("OSGI-INF/blueprint/" + name);
>         out.putNextEntry(e);
>         // Copy the new DOM
>         if (tf == null) {
>             tf = TransformerFactory.newInstance();
>         }
>         tf.newTransformer().transform(new DOMSource(doc), new StreamResult(out));
>         out.closeEntry();
> [...]
> {code}
> Based on the {{mvn:}} URL the name of the blueprint descriptor file is {{datasource-hsqldb}} (w/o the {{.xml}} extension).
> The blueprint service needs the {{.xml}} file extension.
> {code:title=org.apache.aries.blueprint.container.BlueprintExtender.checkBundle(Bundle)}
> [...]
>            addEntries(bundle, name, "*.xml", pathList);
> [...]
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (KARAF-1617) Blueprint deployer in combination with maven URL deployer creates wrong OSGi/blueprint/ file

Posted by "Jamie goodyear (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/KARAF-1617?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13408960#comment-13408960 ] 

Jamie goodyear commented on KARAF-1617:
---------------------------------------

Thank you Uwe Barthel for the patch! :)
                
> Blueprint deployer in combination with maven URL deployer creates wrong OSGi/blueprint/ file
> --------------------------------------------------------------------------------------------
>
>                 Key: KARAF-1617
>                 URL: https://issues.apache.org/jira/browse/KARAF-1617
>             Project: Karaf
>          Issue Type: Bug
>          Components: karaf-core
>    Affects Versions: 2.2.8
>         Environment: Karaf 2.2.8
> * org/apache/karaf/deployer/org.apache.karaf.deployer.blueprint/2.2.8
> * org/apache/aries/blueprint/org.apache.aries.blueprint/0.3.2
>            Reporter: Uwe Barthel
>            Assignee: Freeman Fang
>              Labels: newbie, patch
>         Attachments: patch_karaf_1617.txt
>
>
> We are using the Aries JNDI service for providing database-datasources via JNDI.
> The datasource definition is a blueprint-XML file like [this one|https://github.com/cschneider/Karaf-Tutorial/blob/master/db/datasource/datasource-derby.xml] and is located in our Maven repository.
> I try to install the datasource definition like:
> {quote}
> bundle:install -s blueprint:mvn:my.product.database/my.product.database.layer//xml/datasource-hsqldb
> {quote}
> or via Kara feature:
> {quote}
> feature:install datasource-hsqldb
> {quote}
> {code:title=features.xml}
> [...]
>   <feature name="datasource-hsqldb" version="${project.version}" resolver="(obr)">
>     <feature>hsqldb</feature>
>     <bundle >blueprint:mvn:my.product.database/my.product.database.layer/${project.version}/xml/datasource-hsqldb</bundle>
>   </feature>
> [...]
> {code}
> The bundle will be installed but the blueprint service was not created.
> The blueprint deployer creates a bundle-JAR file and including a new ZipEntry as blueprint service descriptor into {{OSGi/blueprint/}}.
> {code:title=org.apache.karaf.deployer.blueprint.BlueprintTransformer.transform(URL, OutputStream)}
> [...]
>         String name = url.getPath();
>         int idx = name.lastIndexOf('/');
>         if (idx >= 0) {
>             name = name.substring(idx + 1);
>         }
> [...]
>         e = new ZipEntry("OSGI-INF/blueprint/" + name);
>         out.putNextEntry(e);
>         // Copy the new DOM
>         if (tf == null) {
>             tf = TransformerFactory.newInstance();
>         }
>         tf.newTransformer().transform(new DOMSource(doc), new StreamResult(out));
>         out.closeEntry();
> [...]
> {code}
> Based on the {{mvn:}} URL the name of the blueprint descriptor file is {{datasource-hsqldb}} (w/o the {{.xml}} extension).
> The blueprint service needs the {{.xml}} file extension.
> {code:title=org.apache.aries.blueprint.container.BlueprintExtender.checkBundle(Bundle)}
> [...]
>            addEntries(bundle, name, "*.xml", pathList);
> [...]
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira