Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Bundle can't see class within its packages

Avatar

Avatar
Level 2
lebom50735824
Level 2

Likes

0 likes

Total Posts

17 posts

Correct Reply

0 solutions
View profile

Avatar
Level 2
lebom50735824
Level 2

Likes

0 likes

Total Posts

17 posts

Correct Reply

0 solutions
View profile
lebom50735824
Level 2

03-05-2016

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] [477]: 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] [477]: 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:
src/main/java
   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?

Lebom

Replies

Avatar

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,406 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,406 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile
smacdonald2008
Level 10

03-05-2016

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. 

Avatar

Avatar
Level 2
lebom50735824
Level 2

Likes

0 likes

Total Posts

17 posts

Correct Reply

0 solutions
View profile

Avatar
Level 2
lebom50735824
Level 2

Likes

0 likes

Total Posts

17 posts

Correct Reply

0 solutions
View profile
lebom50735824
Level 2

03-05-2016

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?

Avatar

Avatar
Coach
Employee
Jörg_Hoh
Employee

Likes

1,089 likes

Total Posts

3,123 posts

Correct Reply

1,063 solutions
Top badges earned
Coach
Give back 600
Ignite 5
Ignite 3
Ignite 1
View profile

Avatar
Coach
Employee
Jörg_Hoh
Employee

Likes

1,089 likes

Total Posts

3,123 posts

Correct Reply

1,063 solutions
Top badges earned
Coach
Give back 600
Ignite 5
Ignite 3
Ignite 1
View profile
Jörg_Hoh
Employee

03-05-2016

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).

Jörg