You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Karl Pauls (JIRA)" <ji...@apache.org> on 2016/03/08 15:11:40 UTC

[jira] [Commented] (FELIX-5206) Can't load bundle entries when embedding FelixConnect in JBoss

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

Karl Pauls commented on FELIX-5206:
-----------------------------------

Well, I'm not sure that this is the correct way of handling this problem. 

It seems like you are assuming that you can just read any url as a jar. This probably is not a good assumption. Granted, I never really figured out what to do in this case so your guess is as good as any but I would rather say we should special case the vfszip protocol and turn it into a JarRevision when we encounter it. Have a look at the buildRevision(BundleDescriptor desc)  method in PojoSR. There we first check if it is a file url, then we check if it is a JarURLConnection, and then we fallback to a URLRevision. It almost looks like you could just detect that it is a vfszip protocol url, wrap it into a jar: url and make it a JarRevision there, no?

> Can't load bundle entries when embedding FelixConnect in JBoss
> --------------------------------------------------------------
>
>                 Key: FELIX-5206
>                 URL: https://issues.apache.org/jira/browse/FELIX-5206
>             Project: Felix
>          Issue Type: Bug
>          Components: Connect
>    Affects Versions: connect-0.1.0
>            Reporter: Pierre De Rop
>         Attachments: FELIX-5206.patch
>
>
> I'm using Apache Connect embedded in JBoss EAP 5.2.
> I came across the following issue: When I launch Apache Connect under jboss, the ClasspathScanner loads bundles from a jboss classloader that I pass to the scanForBundles method. The problem is that jboss ClassLoader.getResources(...) method returns a list of URL with a special jboss "vfszip" URL, like:
> vfszip:/opt/SPS_2_0_I16/jboss/common/lib/DNSClient-1.2759.01.jar/ 
> Now, when declarative service (1.8.2) is started, it can't load the xml descriptors, because when it invokes the Bundle.findEntries(...) method, this one returns null, because the call to this method ends up calling the org.apache.felix.connect.URLRevision.getEntries() method, which is not implemented:
> {code}
>     @Override
>     public Enumeration<String> getEntries()
>     {
>         return Collections.enumeration(Collections.EMPTY_LIST);
>     }
> {code}
> I have attached a simple patch to this issue which resolves the problem.
> Anyone could review it and let me know if I can commit it ?
> thanks.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)