I get the following error when I active a bundle in AEM 6.1 :
03.05.2016 11:03:50.434 *ERROR* [qtp2128475881-158] org.apache.felix.http.jetty %bundles.pluginTitle: Cannot start (org.osgi.framework.BundleException: Unresolved constraint in bundle [bundle name] : Unable to resolve 477.0: missing requirement [477.0] osgi.wiring.package; (osgi.wiring.package=com.microsoft.schemas._2003._10.serialization))
org.osgi.framework.BundleException: Unresolved constraint in [bundle name] : Unable to resolve 477.0: missing requirement [477.0] osgi.wiring.package; (osgi.wiring.package=com.microsoft.schemas._2003._10.serialization)
I have created a bundle that calls an external web services but also serves as a service to a jsp page. The workflow is supposed to be that a JSP calls the OSGI service running in AEM 6.1, the OSGI service then calls an external web service. The structure of the code is like:
package 1 (external web service code)
package 2 (external web service code)
package 3 (OSGI service interface)
package 4 (OSGI service implementation)
package 5 (external web service code)
package 6 (external web service code)
All the packages have different names of course. I've looked at other AEM examples like the WeatherWS articles but they don't do what I what I want to do. Is what I am trying to do possible with OSGI? I am new to OSGI btw. Is it possible to have code for an OSGI service and an external web service code in one bundle like I have above? Do you know of an example that does a similar thing to what I am trying to do?
To consume a third party SOAP web service with AEM, you can use Apache CFX to create JAVA proxy classes. See https://helpx.adobe.com/experience-manager/using/creating-cxf-bundles-consume-web.html.
":Is it possible to have code for an OSGI service and an external web service code in one bundle like I have above"
The only difference between the CFX example and your layout is in your example- you have mulitple Java packages - which OSGi supports.
The one question I would appreciate if it can be answered is why the OSGI container cannot resolve the web services packages when activating the bundle.When I build the code in Eclipse, the code compiles without a problem. Both the OSGI service and the web services code are in the same bundle. When I activate the bundle, the container doesn't seem to see the package "com.microsoft.schemas._2003._10.serialization above" as part of the service. Why is that the case?
So your bundle contains all the code required to execute this webservice call? Does it include the package "com.microsoft.schemas._2003._10.serialization" as well? In that case I would assume, that the import statements for your bundle are generated incorrectly.
To better diagnose the problem it would be good if you provide more data (including the package structure of your bundle and the bundle import/export statements).