[
https://issues.apache.org/jira/browse/FELIX-5206?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Pierre De Rop updated FELIX-5206:
---------------------------------
Attachment: FELIX-5206-wrap-vfszipurl-to-jarfileurl.patch
I have attached a second patch which just wraps the vfszip url in the
PojoSR.buildRevision(BundleDescriptor desc) method.
However, I'm now hesitant. Indeed, I'm not a jboss expert, but looking at some
links from google, it seems that vfszip is not the only URL protocol supported
by jboss (there is also vfsjar, vfsfile, etc ...).
Another concern is about the vfszip, which seems to be able to not only point
to real jars (like in my case), but also point to some inner jars from a
non-exploded ear (not my case).
So, it seems that if we want to generically handle all the possible use cases,
then we would need to call URL.openConnection() and get the content in a
transparent way ? One option could be to try to wrap the vfszip
URL to a jar url in a more robust way, like using a custom URLStream Handler
that would then internally call the actual vfszip URL.openConnection() in order
to copy the content in a temporary file, etc ... (really similar to the
RevisionAsJarURL inner class from [1]).
But then, this also looks similar to what I did in the initial patch (in the
URLRevision) ? by the way, what is really wrong with it ?
So, what do you think ? (both patches are currently working for my use case,
it's just that I would like to make sure that all use cases are correctly
supported).
... maybe I'm rambling too much :-)
[1]
http://svn.apache.org/viewvc/felix/trunk/framework/src/main/java/org/apache/felix/framework/BundleProtectionDomain.java?revision=1734034&view=co
> 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-wrap-vfszipurl-to-jarfileurl.patch,
> 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)