You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@servicemix.apache.org by "Lars Heinemann (JIRA)" <ji...@apache.org> on 2008/12/17 22:56:05 UTC

[jira] Commented: (SMX4-177) commons-dbcp component doesn't allow dynamic imports

    [ https://issues.apache.org/activemq/browse/SMX4-177?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=48250#action_48250 ] 

Lars Heinemann commented on SMX4-177:
-------------------------------------

Well...this looks not very general to me.

Guillaume, wouldn't it be better to patch it with something like this?  (not tested yet)

{noformat}
Index: bundles-pom/pom.xml
===================================================================
--- bundles-pom/pom.xml	(revision 727525)
+++ bundles-pom/pom.xml	(working copy)
@@ -38,6 +38,7 @@
         <servicemix.osgi.export.pkg />
         <servicemix.osgi.import.pkg />
         <servicemix.osgi.private.pkg />
+        <servicemix.osgi.dynamic.pkg />
         <servicemix.osgi.failok>false</servicemix.osgi.failok>
     </properties>
 
@@ -96,6 +97,7 @@
                         <Export-Package>${servicemix.osgi.export}</Export-Package>
                         <Import-Package>${servicemix.osgi.import.pkg}*</Import-Package>
                         <Private-Package>${servicemix.osgi.private.pkg}</Private-Package>
+                        <DynamicImport-Packages>${servicemix.osgi.dynamic.pkg}</DynamicImport-Packages>
                         <_failok>${servicemix.osgi.failok}</_failok>
                     </instructions>
                     <unpackBundle>true</unpackBundle>
Index: commons-dbcp-1.2.2/pom.xml
===================================================================
--- commons-dbcp-1.2.2/pom.xml	(revision 727525)
+++ commons-dbcp-1.2.2/pom.xml	(working copy)
@@ -42,6 +42,7 @@
         <servicemix.osgi.export.pkg>
             org.apache.commons*
         </servicemix.osgi.export.pkg>
+        <servicemix.osgi.dynamic.pkg>*</servicemix.osgi.dynamic.pkg>
     </properties>
 
     <dependencies>
{noformat}

Maybe we should even think about adding the DynamicImport * always?

Regards
Lars


> commons-dbcp component doesn't allow dynamic imports
> ----------------------------------------------------
>
>                 Key: SMX4-177
>                 URL: https://issues.apache.org/activemq/browse/SMX4-177
>             Project: ServiceMix 4
>          Issue Type: Bug
>    Affects Versions: 4.0-m1
>            Reporter: Adrian Trenaman
>             Fix For: 4.0-m2
>
>         Attachments: commons-dbcp-1.2.2.patch
>
>   Original Estimate: 1 day
>  Remaining Estimate: 1 day
>
> Original email trail is below - Guillaume raised a question on why not use bnd - I used the shade plugin simply because that was what the existing pom used. 
> /Ade
> ------
> Attachments are removed from the mailing lists, so please raise a JIRA
> and attach your patch.
> Btw, why not using the bnd tool to set up this manifest entry ?
> If we configure the plugin, it should work too:
>            <plugin>
>                <groupId>org.apache.felix</groupId>
>                <artifactId>maven-bundle-plugin</artifactId>
>                <version>1.4.1</version>
>                <extensions>true</extensions>
>                <configuration>
>                    <instructions>
> <Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName>
> <Export-Package>${servicemix.osgi.export}</Export-Package>
> <Import-Package>${servicemix.osgi.import.pkg}*</Import-Package>
> <Private-Package>${servicemix.osgi.private.pkg}</Private-Package>
>                        <DynamicImport-Packages>*</DynamicImport-Packages>
>                        <_failok>${servicemix.osgi.failok}</_failok>
>                    </instructions>
>                    <unpackBundle>true</unpackBundle>
>                </configuration>
>            </plugin>
> On Thu, Dec 11, 2008 at 18:06, Adrian Trenaman <tr...@progress.com> wrote:
> Hi Guillaume,
> Have attached a patch to this email. Basically, I had to add the following
> to the shade configuration element:
>                           <transformers>
>                               <transformer
> implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
>                                   <manifestEntries>
> <DynamicImport-Packages>*</DynamicImport-Packages>
>                                   </manifestEntries>
>                               </transformer>
>                           </transformers>
> Also, I had to set the version for shade to be 1.2 for this to work. I
> haven't created a JIRA for this issue - can you apply the patch directly or
> do you want me to put it all through JIRA?
> Best,
> Ade.
> On 11 Dec 2008, at 11:41, Guillaume Nodet wrote:
> Yes, this looks like a bug and should be fixed.
> Wanna provide a patch or I can do that if you prefer.
> On Thu, Dec 11, 2008 at 11:21 AM, Adrian Trenaman <tr...@progress.com>
> wrote:
> Hi there,
> I was configuring yesterday a fragment of Spring for SMX4 to deploy an
> Oracle dataSource and expose it as an OSGi service (and so share it
> across
> all bundles in the container). Using the Postgres pooled data source
> works
> fine: however, using the Oracle dataSource I get a
> ClassNotFoundException.
> This is because the commons-dbcp BasicDataSource is trying to dynamically
> load the Oracle driver: it would seem, however, that my wrapping of the
> commons-dbcp.jar has not added a DynamicImport-Packages attribute to the
> Manifest.MF.
> Does the SMX4 bundles/commons-dbcp-1.2.2 wrapper add
> DynamicImport-Packages
> to the Manifest.MF? I've checked the pom, but I don't see it explicitly
> setting up DynamicImports.
> Thanks in advance for any help!
> Ade.
> --
> Cheers,
> Guillaume Nodet
> ------------------------
> Blog: http://gnodet.blogspot.com/
> ------------------------
> Open Source SOA
> http://fusesource.com
> ---
> Adrian Trenaman, Consultant Fellow, PS - Opensource Center of Competence
> Progress Software Corp
> Shelbourne Road, Dublin 4, Ireland
> ---
> +353-1-637-2659 (Office)
> +353-1-637-2882 (Fax)
> +353-86-6051026 (Mobile)
> adrian.trenaman (Skype)
> ----
> Blog: http://trenaman.blogspot.com
> -- 
> Cheers,
> Guillaume Nodet
> ------------------------
> Blog: http://gnodet.blogspot.com/
> ------------------------
> Open Source SOA
> http://fusesource.com

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.