Application that bring in dependency bundles from a bundle repository doesn't 
deploy
------------------------------------------------------------------------------------

                 Key: ARIES-461
                 URL: https://issues.apache.org/jira/browse/ARIES-461
             Project: Aries
          Issue Type: Bug
          Components: Application
    Affects Versions: 0.3
            Reporter: Jeremy Hughes


I thought I'd try the new capability in the application module for provisioning 
absent dependencies to the framework using OBR. I created a tiny app that uses 
twitter4j to get recent tweets from the 'theasf' twitter id. The bundle in the 
app imports the twitter4j package and the org.apache.commons.lang package for 
the StringEscapeUtils class.

Firstly, I created my .eba with all of its dependencies contained within it: 
twitter4j bundle and commons lang bundle. I hijacked the blog-assembly module 
to try it out. I started the framework with 

    java -jar osgi-3.5.0.v20090520.jar -console

then copied my .eba to the load directory. This worked fine - although the 
debug output from the org.apache.aries.application.modelling.impl now seems to 
be overly verbose.

Second, I started the framework like this:

    java -Dobr.repository.url=http://sigil.codecauldron.org/spring-external.obr 
-jar osgi-3.5.0.v20090520.jar -console

the -D flag will give an OBR repository to Felix OBR. The repository.xml at the 
end of the above URL is for the Spring Source Enterprise Bundle Repository. I 
copied the same .eba into the load directory. This means the repository.xml was 
fetched, and used in the OBR resolve. It took a lot longer to resolve either 
because Felix OBR had a large repository.xml to use in its resolution process 
or because of the verbosity of org.apache.aries.application.modelling.impl. At 
the end I have the application's bundles started in the framework.

That was all just a sanity check to make sure things still work when including 
all dependencies in the .eba.

Third, I removed the dependency bundles from the .eba and started as before:

    java -Dobr.repository.url=http://sigil.codecauldron.org/spring-external.obr 
-jar osgi-3.5.0.v20090520.jar -console

I copied the .eba to the load directory. This time I got a problem:

[fileinstall-./load] DEBUG 
org.apache.aries.application.deployment.management.impl.DeploymentManifestManagerImpl
 - Method exit: generateDeploymentMani
fest, returning [org.apache.aries.application.management.ResolverException: 
Resolution of asset org.exampe.twitter.query.app indicates invalid depende
ncies of shared content on isolated content:
Shared bundle twitter4j_2.0.8 has a dependency for package 
javax.xml.transform.dom which is exported from isolated bundle 
[com.springsource.org.apache
.xmlcommons_1.3.4]
Shared bundle twitter4j_2.0.8 has a dependency for package 
javax.xml.transform.stream which is exported from isolated bundle 
[com.springsource.org.apa
che.xmlcommons_1.3.4]
Shared bundle twitter4j_2.0.8 has a dependency for package org.w3c.dom which is 
exported from isolated bundle [com.springsource.org.apache.xmlcommons_
1.3.4]
Shared bundle twitter4j_2.0.8 has a dependency for package javax.xml.parsers 
which is exported from isolated bundle [com.springsource.org.apache.xmlco
mmons_1.3.4]
Shared bundle twitter4j_2.0.8 has a dependency for package org.xml.sax which is 
exported from isolated bundle [com.springsource.org.apache.xmlcommons_
1.3.4]
Shared bundle twitter4j_2.0.8 has a dependency for package javax.xml.transform 
which is exported from isolated bundle [com.springsource.org.apache.xml
commons_1.3.4] ]
[fileinstall-./load] DEBUG org.apache.aries.blueprint.proxy.Collaborator - 
invoke
org.apache.aries.application.management.ResolverException: Resolution of asset 
org.exampe.twitter.query.app indicates invalid dependencies of shared c
ontent on isolated content:
Shared bundle twitter4j_2.0.8 has a dependency for package 
javax.xml.transform.dom which is exported from isolated bundle 
[com.springsource.org.apache
.xmlcommons_1.3.4]
Shared bundle twitter4j_2.0.8 has a dependency for package 
javax.xml.transform.stream which is exported from isolated bundle 
[com.springsource.org.apa
che.xmlcommons_1.3.4]
Shared bundle twitter4j_2.0.8 has a dependency for package org.w3c.dom which is 
exported from isolated bundle [com.springsource.org.apache.xmlcommons_
1.3.4]
Shared bundle twitter4j_2.0.8 has a dependency for package javax.xml.parsers 
which is exported from isolated bundle [com.springsource.org.apache.xmlco
mmons_1.3.4]
Shared bundle twitter4j_2.0.8 has a dependency for package org.xml.sax which is 
exported from isolated bundle [com.springsource.org.apache.xmlcommons_
1.3.4]
Shared bundle twitter4j_2.0.8 has a dependency for package javax.xml.transform 
which is exported from isolated bundle [com.springsource.org.apache.xml
commons_1.3.4]
        at 
org.apache.aries.application.deployment.management.impl.DeploymentManifestManagerImpl.generateDeployedBundles(DeploymentManifestManagerImpl
.java:325)
        at 
org.apache.aries.application.deployment.management.impl.DeploymentManifestManagerImpl.generateDeploymentManifest(DeploymentManifestManagerI
mpl.java:160)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
        at java.lang.reflect.Method.invoke(Method.java:600)
        at 
org.apache.aries.blueprint.proxy.Collaborator$1.invoke(Collaborator.java:67)
        at 
org.apache.aries.blueprint.proxy.Collaborator.invoke(Collaborator.java:143)
        at $Proxy15.generateDeploymentManifest(Unknown Source)
        at 
org.apache.aries.application.management.impl.AriesApplicationManagerImpl.resolve(AriesApplicationManagerImpl.java:272)
        at 
org.apache.aries.application.management.impl.AriesApplicationManagerImpl.install(AriesApplicationManagerImpl.java:289)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
        at java.lang.reflect.Method.invoke(Method.java:600)
        at 
org.apache.aries.blueprint.proxy.Collaborator$1.invoke(Collaborator.java:67)
        at 
org.apache.aries.blueprint.proxy.Collaborator.invoke(Collaborator.java:143)
        at $Proxy16.install(Unknown Source)
        at 
org.apache.aries.application.install.EBAInstaller.install(EBAInstaller.java:71)
        at 
org.apache.felix.fileinstall.internal.DirectoryWatcher.install(DirectoryWatcher.java:827)
        at 
org.apache.felix.fileinstall.internal.DirectoryWatcher.install(DirectoryWatcher.java:755)
        at 
org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:393)
        at 
org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:212)
[fileinstall-./load] WARN org.apache.aries.blueprint.proxy.Collaborator - 
Discarding initial exception
org.apache.aries.application.management.ResolverException: Resolution of asset 
org.exampe.twitter.query.app indicates invalid dependencies of shared c
ontent on isolated content:
Shared bundle twitter4j_2.0.8 has a dependency for package 
javax.xml.transform.dom which is exported from isolated bundle 
[com.springsource.org.apache
.xmlcommons_1.3.4]
Shared bundle twitter4j_2.0.8 has a dependency for package 
javax.xml.transform.stream which is exported from isolated bundle 
[com.springsource.org.apa
che.xmlcommons_1.3.4]
Shared bundle twitter4j_2.0.8 has a dependency for package org.w3c.dom which is 
exported from isolated bundle [com.springsource.org.apache.xmlcommons_
1.3.4]
Shared bundle twitter4j_2.0.8 has a dependency for package javax.xml.parsers 
which is exported from isolated bundle [com.springsource.org.apache.xmlco
mmons_1.3.4]
Shared bundle twitter4j_2.0.8 has a dependency for package org.xml.sax which is 
exported from isolated bundle [com.springsource.org.apache.xmlcommons_
1.3.4]
Shared bundle twitter4j_2.0.8 has a dependency for package javax.xml.transform 
which is exported from isolated bundle [com.springsource.org.apache.xml
commons_1.3.4]
        at 
org.apache.aries.application.deployment.management.impl.DeploymentManifestManagerImpl.generateDeployedBundles(DeploymentManifestManagerImpl
.java:325)
        at 
org.apache.aries.application.deployment.management.impl.DeploymentManifestManagerImpl.generateDeploymentManifest(DeploymentManifestManagerI
mpl.java:160)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
        at java.lang.reflect.Method.invoke(Method.java:600)
        at 
org.apache.aries.blueprint.proxy.Collaborator$1.invoke(Collaborator.java:67)
        at 
org.apache.aries.blueprint.proxy.Collaborator.invoke(Collaborator.java:143)
        at $Proxy15.generateDeploymentManifest(Unknown Source)
        at 
org.apache.aries.application.management.impl.AriesApplicationManagerImpl.resolve(AriesApplicationManagerImpl.java:272)
        at 
org.apache.aries.application.management.impl.AriesApplicationManagerImpl.install(AriesApplicationManagerImpl.java:289)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
        at java.lang.reflect.Method.invoke(Method.java:600)
        at 
org.apache.aries.blueprint.proxy.Collaborator$1.invoke(Collaborator.java:67)
        at 
org.apache.aries.blueprint.proxy.Collaborator.invoke(Collaborator.java:143)
        at $Proxy16.install(Unknown Source)
        at 
org.apache.aries.application.install.EBAInstaller.install(EBAInstaller.java:71)
        at 
org.apache.felix.fileinstall.internal.DirectoryWatcher.install(DirectoryWatcher.java:827)
        at 
org.apache.felix.fileinstall.internal.DirectoryWatcher.install(DirectoryWatcher.java:755)
        at 
org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:393)
        at 
org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:212)
[fileinstall-./load] DEBUG org.apache.aries.blueprint.proxy.Collaborator - 
invoke
org.apache.aries.application.management.ResolverException: Resolution of asset 
org.exampe.twitter.query.app indicates invalid dependencies of shared c
ontent on isolated content:
Shared bundle twitter4j_2.0.8 has a dependency for package 
javax.xml.transform.dom which is exported from isolated bundle 
[com.springsource.org.apache
.xmlcommons_1.3.4]
Shared bundle twitter4j_2.0.8 has a dependency for package 
javax.xml.transform.stream which is exported from isolated bundle 
[com.springsource.org.apa
che.xmlcommons_1.3.4]
Shared bundle twitter4j_2.0.8 has a dependency for package org.w3c.dom which is 
exported from isolated bundle [com.springsource.org.apache.xmlcommons_
1.3.4]
Shared bundle twitter4j_2.0.8 has a dependency for package javax.xml.parsers 
which is exported from isolated bundle [com.springsource.org.apache.xmlco
mmons_1.3.4]
Shared bundle twitter4j_2.0.8 has a dependency for package org.xml.sax which is 
exported from isolated bundle [com.springsource.org.apache.xmlcommons_
1.3.4]
Shared bundle twitter4j_2.0.8 has a dependency for package javax.xml.transform 
which is exported from isolated bundle [com.springsource.org.apache.xml
commons_1.3.4]
        at 
org.apache.aries.application.deployment.management.impl.DeploymentManifestManagerImpl.generateDeployedBundles(DeploymentManifestManagerImpl
.java:325)
        at 
org.apache.aries.application.deployment.management.impl.DeploymentManifestManagerImpl.generateDeploymentManifest(DeploymentManifestManagerI
mpl.java:160)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
        at java.lang.reflect.Method.invoke(Method.java:600)
        at 
org.apache.aries.blueprint.proxy.Collaborator$1.invoke(Collaborator.java:67)
        at 
org.apache.aries.blueprint.proxy.Collaborator.invoke(Collaborator.java:143)
        at $Proxy15.generateDeploymentManifest(Unknown Source)
        at 
org.apache.aries.application.management.impl.AriesApplicationManagerImpl.resolve(AriesApplicationManagerImpl.java:272)
        at 
org.apache.aries.application.management.impl.AriesApplicationManagerImpl.install(AriesApplicationManagerImpl.java:289)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
        at java.lang.reflect.Method.invoke(Method.java:600)
        at 
org.apache.aries.blueprint.proxy.Collaborator$1.invoke(Collaborator.java:67)
        at 
org.apache.aries.blueprint.proxy.Collaborator.invoke(Collaborator.java:143)
        at $Proxy16.install(Unknown Source)
        at 
org.apache.aries.application.install.EBAInstaller.install(EBAInstaller.java:71)
        at 
org.apache.felix.fileinstall.internal.DirectoryWatcher.install(DirectoryWatcher.java:827)
        at 
org.apache.felix.fileinstall.internal.DirectoryWatcher.install(DirectoryWatcher.java:755)
        at 
org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:393)
        at 
org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:212)
[fileinstall-./load] WARN org.apache.aries.blueprint.proxy.Collaborator - 
Discarding initial exception
org.apache.aries.application.management.ResolverException: Resolution of asset 
org.exampe.twitter.query.app indicates invalid dependencies of shared c
ontent on isolated content:
Shared bundle twitter4j_2.0.8 has a dependency for package 
javax.xml.transform.dom which is exported from isolated bundle 
[com.springsource.org.apache
.xmlcommons_1.3.4]
Shared bundle twitter4j_2.0.8 has a dependency for package 
javax.xml.transform.stream which is exported from isolated bundle 
[com.springsource.org.apa
che.xmlcommons_1.3.4]
Shared bundle twitter4j_2.0.8 has a dependency for package org.w3c.dom which is 
exported from isolated bundle [com.springsource.org.apache.xmlcommons_
1.3.4]
Shared bundle twitter4j_2.0.8 has a dependency for package javax.xml.parsers 
which is exported from isolated bundle [com.springsource.org.apache.xmlco
mmons_1.3.4]
Shared bundle twitter4j_2.0.8 has a dependency for package org.xml.sax which is 
exported from isolated bundle [com.springsource.org.apache.xmlcommons_
1.3.4]
Shared bundle twitter4j_2.0.8 has a dependency for package javax.xml.transform 
which is exported from isolated bundle [com.springsource.org.apache.xml
commons_1.3.4]
        at 
org.apache.aries.application.deployment.management.impl.DeploymentManifestManagerImpl.generateDeployedBundles(DeploymentManifestManagerImpl
.java:325)
        at 
org.apache.aries.application.deployment.management.impl.DeploymentManifestManagerImpl.generateDeploymentManifest(DeploymentManifestManagerI
mpl.java:160)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
        at java.lang.reflect.Method.invoke(Method.java:600)
        at 
org.apache.aries.blueprint.proxy.Collaborator$1.invoke(Collaborator.java:67)
        at 
org.apache.aries.blueprint.proxy.Collaborator.invoke(Collaborator.java:143)
        at $Proxy15.generateDeploymentManifest(Unknown Source)
        at 
org.apache.aries.application.management.impl.AriesApplicationManagerImpl.resolve(AriesApplicationManagerImpl.java:272)
        at 
org.apache.aries.application.management.impl.AriesApplicationManagerImpl.install(AriesApplicationManagerImpl.java:289)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
        at java.lang.reflect.Method.invoke(Method.java:600)
        at 
org.apache.aries.blueprint.proxy.Collaborator$1.invoke(Collaborator.java:67)
        at 
org.apache.aries.blueprint.proxy.Collaborator.invoke(Collaborator.java:143)
        at $Proxy16.install(Unknown Source)
        at 
org.apache.aries.application.install.EBAInstaller.install(EBAInstaller.java:71)
        at 
org.apache.felix.fileinstall.internal.DirectoryWatcher.install(DirectoryWatcher.java:827)
        at 
org.apache.felix.fileinstall.internal.DirectoryWatcher.install(DirectoryWatcher.java:755)
        at 
org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:393)
        at 
org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:212)

I believe OBR is for some reason resolving the java.xml.* org.w3c.dom and 
org.xml.sax packages to a bundle described in the OBR rather than those coming 
through from the JRE. As I understand it, there are two OBR resolutions going 
on here. #1 includes the bundles from the .eba Application-Content manifest 
header. The resulting list is the bundles from the Application-Content header 
plus any dependency bundles. We then go back to OBR with just the dependency 
bundles to make sure they don't depend on the bundles listed in the 
Application-Content header. This is so that the application content can be 
isolated from other applications' content and the shared bundles can be shared 
across applications running in the same JVM - after all if a shared bundle 
dependended on an bundle isolated in application1, application2 would be able 
to get to application1's bundle via the shared bundle.

So the issue is with the second OBR resolve. This seems to be giving a 
different result to the first OBR resolve. The first one seems to be happy 
resolving those packages against the JRE / System bundle, but the second 
resolve is not.


Note: In between each of these attempts I cleared out the load dir and deleted 
the target/configuration/org.eclipse.osgi directory, thereby cleaning out the 
OSGi cache.



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

Reply via email to