Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aws-sdk-java-osgi imports com.amazonaws.jmespath/software.amazon.ion but these are not available as OSGi bundle #979

Closed
bosschaert opened this issue Jan 10, 2017 · 20 comments
Assignees
Labels
bug This issue is a bug.

Comments

@bosschaert
Copy link

bosschaert commented Jan 10, 2017

aws-sdk-java-osgi 1.11.76 has the following OSGi imports:
Import-Package: ...,com.amazonaws.jmespath,...,software.amazon.ion,software.amazon.ion.system

However, there is no aws-provided bundle that exports these packages. com.amazonaws/jmespath-java/1.11.77 and software.amazon.ion/ion-java/1.0.1 are not OSGi bundles as they do not provide the OSGi manifest headers.
Therefore aws-sdk-java-osgi does not resolve and cannot be used in OSGi.

It would be good to add OSGi metadata to the jmespath-java ion-java jar files, or alternatively, include these packages in aws-sdk-java-osgi so that this bundle can resolve again.

Note that this problem exists in version 1.11.76. It did not exist in 1.10.76 or 1.11.4.

@bosschaert
Copy link
Author

bosschaert commented Jan 10, 2017

The people at lucee.org have made an OSGi version of ion-java which can be used as a workaround and also as inspiration on how to add the OSGi metadata: https://search.maven.org/#artifactdetails%7Corg.lucee%7Csoftware.amazon.ion%7C1.0.1%7Cbundle

However there does not seem to be a workaround available for com.amazonaws.jmespath.

@bosschaert bosschaert changed the title aws-sdk-java-osgi imports software.amazon.ion but this is not available as OSGi bundle aws-sdk-java-osgi imports com.amazonaws.jmespath/software.amazon.ion but these are not available as OSGi bundle Jan 10, 2017
@shorea
Copy link
Contributor

shorea commented Jan 10, 2017

I'll forward this request to the team that publishes ION.

@shorea shorea self-assigned this Jan 10, 2017
@bosschaert
Copy link
Author

Note that the same issue also exists with com.amazonaws.jmespath. All the other APIs are embedded in this jar, so it might make more sense so simply include com.amazonaws.jmespath and software.amazon.ion.** as is done with others.

@shorea
Copy link
Contributor

shorea commented Jan 10, 2017

Ah gotcha. JMESPath we can include. ION isn't something our team owns so I would feel more comfortable importing that normally.

@amit-jain
Copy link

With 1.11.82 the JMESPath in included but it still lists com.amazonaws.jmespath in the Import-Package in the manifest and that should be removed to resolve this.

@shorea
Copy link
Contributor

shorea commented Feb 15, 2017

@amit-jain can you link to this?

@sgliech
Copy link

sgliech commented Feb 15, 2017

Well, I don't know exactly where it comes from when the OSGi jar is generated but you can see it for example in "aws-java-sdk-osgi-1.11.89.jar\META-INF\MANIFEST.MF":

[...]
Import-Package: org.apache.http.conn.routing,com.amazonaws.jmespath,co
m.fasterxml.jackson.annotation;version="[2.6,3)",com.fasterxml.jackso`
[...]

If I try to activate the bundle in AEM 6 it logs an error:

ERROR (org.osgi.framework.BundleException: Unable to resolve com.amazonaws.aws-java-sdk-osgi
missing requirement [com.amazonaws.aws-java-sdk-osgi] osgi.wiring.package; (osgi.wiring.package=com.amazonaws.jmespath) Unresolved requirements: [[com.amazonaws.aws-java-sdk-osgi] osgi.wiring.package; (osgi.wiring.package=com.amazonaws.jmespath)])

Maybe it has something to do with the fact that "jmespath-java" is still listed as a dependency in https://github.com/aws/aws-sdk-java/blob/master/pom.xml even though it is an internal module now.

@shorea
Copy link
Contributor

shorea commented Feb 15, 2017

I see the issue now. I pushed a change to fix it a month ago but it got stuck on our staging branch. I have fixed that and it will be part of our next release, tentatively scheduled for today.

@sgliech
Copy link

sgliech commented Feb 15, 2017

Would be great, thanks!

@sgliech
Copy link

sgliech commented Feb 16, 2017

The jmespath-java dependency problem in OSGi is fixed now, thanks!

Now there is a problem with the json-path dependency activation in OSGi but we can't fix that here. ;)

@shorea
Copy link
Contributor

shorea commented Feb 16, 2017

Oh I see. Is this for the stepfunctions module?

@sgliech
Copy link

sgliech commented Feb 16, 2017

Yes, that's correct. json-path seems only to be used in the stepfunctions module.

@shorea
Copy link
Contributor

shorea commented Feb 16, 2017

What's the error in the activation you're seeing?

@sgliech
Copy link

sgliech commented Feb 16, 2017

Error:

org.osgi.framework.BundleException: Unable to resolve com.jayway.jsonpath.json-path [23](R 23.0): missing requirement [com.jayway.jsonpath.json-path [23](R 23.0)] osgi.wiring.package; (osgi.wiring.package=org.apache.tapestry5.json) Unresolved requirements: [[com.jayway.jsonpath.json-path [23](R 23.0)] osgi.wiring.package; (osgi.wiring.package=org.apache.tapestry5.json)]

The Tapestry5 dependency doesn't have OSGi metadata.
json-path theoretically fixed this by making tapestry5 optional (see [1]), but they haven't released a new version yet. And it seems that a new release (no date set) wouldn't even be a version 2 (see [2]).

Unfortunately, the usage of json-path seems to be a major blocker for easy usage of later AWS SDK versions in OSGi environments like AEM. :/

[1] json-path/JsonPath#207
[2] json-path/JsonPath#225

@kiiadi kiiadi added the bug This issue is a bug. label Mar 9, 2017
@kiiadi
Copy link
Contributor

kiiadi commented Mar 27, 2017

@sgliech just coming back on this - it sounds like the fix for this is with json-path and there's not a whole lot we can do from the AWS SDK. Do you agree? Can we close this, SDK related issue?

@varunnvs92
Copy link
Contributor

Closing due to inactivity. If you still have the JsonPath problem, open a seperate issue as the title of this thread is related to jmespath and ion. Thank you.

@shorea
Copy link
Contributor

shorea commented Apr 5, 2017

We decided to remove the JsonPath dependency for other reasons so this problem will go away in the next release of the SDK (1.11.116)

@sgliech
Copy link

sgliech commented Apr 5, 2017

That's great to hear! Thanks for the update!

@varunnvs92
Copy link
Contributor

@sgliech @bosschaert
I believe you use our SDK in OSGI environment. We are working on a SDK V2. We are trying to make the v2 OSGI compatible. In V2, we use ServiceLoader to load the http client implementations. However OSGI requires special configuration to work properly with ServiceLoader. See aws/aws-sdk-java-v2#607
We are looking for an external customer to test the fix pushed to varunkn/OsgiCompatibility branch in v2. Is it possible for you to install the v2 sdk in OSGI, create a service client and make few API calls? Let me know if you have questions. Thank you.

@sgliech
Copy link

sgliech commented Nov 16, 2018

@varunnvs92
Thanks for the update! Unfortunately, I'm not involved in this project anymore.
But I think @amit-jain still is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug.
Projects
None yet
Development

No branches or pull requests

6 participants