1 2 Previous Next 20 Replies Latest reply on Apr 24, 2017 10:06 AM by madere

    Wildfly OSGI Bundle deployment

    madere

      Hi all,

       

      i have installed:

      - Wildfly 10.1.0 Final

      - JBOSGI 2.5.2

       

      I have 2 OSGI bundles: Bundle_A and Bundle_B.

      Bundle_A contains super classes for Bundle_B

      In the manifest file of Bundle_A, all local classes are exported in the "export_packages".

       

      In the Bundle_B, I have classes that extends from classes in Bundle_A.

      In the manifest file in Bundle_B, i have all used classes from Bundle_A as Imported Packages.

       

      The deployment and start/activation of Bundle_A works fine.

      The deployment of Bundle_B works fine, but i cant start/activate Bundle_B: it stays in the "resolved" state. When expanding the Bundle_B in the Felix webconsole, I see all imported packages marked as red.

      So it looks like, that Bundle_B can't find the classes from Bundle_A.

       

      The strange thing is that these bundles deployed on Apache Karaf 4.0.4 could both be started and all works fine.

      What might be wrong for Wildfly with my Karaf Bundles? Do i need to change some files?

       

      Regards,

      Martin.

        • 1. Re: Wildfly OSGI Bundle deployment
          arcivanov

          Firstly, please delete the same question from the other WildFly spaces.
          Secondly, could you please post your WildFly startup logs?

          • 2. Re: Wildfly OSGI Bundle deployment
            madere

            Hi Arcadiy,

             

            I deleted them.

            Please find uploaded my clean start-up log file: "Martin de Reuver - server.log"

             

            It concerns the 2 deployments:

            - com.onetrail.CoreOSGI:1.1.0

            - com.onetrail.camel.onetrailCamelCore2Wildfly:1.2.3.SNAPSHOT

            The com.onetrail.CoreOSGI contains classes used by com.onetrail.camel.onetrailCamelCore2Wildfly but can't be found. It is installed but can't be started.

             

            Thanks in advange.

             

            Regards,

            Martin de Reuver

            • 3. Re: Wildfly OSGI Bundle deployment
              madere

              Bump.

              If some1 has an idea, please.

              • 4. Re: Wildfly OSGI Bundle deployment
                arcivanov

                Hi Martin,

                Sorry I've been busy. I don't see the uploaded file anywhere.

                • 5. Re: Wildfly OSGI Bundle deployment
                  madere

                  Hi Arcadiy,

                  dont worry. No problem.

                  It is in the "documents" part of this forum. Or you can see it when you click "All Content".

                  Hope you will find it.

                  Martin

                  • 6. Re: Wildfly OSGI Bundle deployment
                    arcivanov

                    2017-03-21 10:56:32,400 WARN  [org.jboss.as.osgi] (MSC service thread 1-2) JBAS011910: Cannot resolve requirements: [XPackageRequirement[dirs={filter=(&(osgi.wiring.package=org.apache.camel)(&(version>=2.8.0)(!(version>=3.0.0))))},[com.onetrail.camel.onetrailCamelCore2Wildfly:1.2.3.SNAPSHOT]]]

                     

                    You're missing Apache Camel, 2.8.0 <= ver < 3.0.0.

                    • 7. Re: Wildfly OSGI Bundle deployment
                      madere

                      That might be true, but this OSGI bundle (com.onetrail.camel.onetrailCamelCore2Wildfly:1.2.3.SNAPSHOT) can't see the exported packages from the installed and started bundle "com.onetrail.CoreOSGI:1.1.0".

                      But I do not see yet what that has to do with the missing Apache Camel version.

                       

                       

                      Its true: i have to install the correct Apache Camel version. And some other missing depencies.

                      I will install the missing depencies tomorrow.

                      • 8. Re: Wildfly OSGI Bundle deployment
                        arcivanov

                        Here's how resolution works:

                         

                        A depends on X from B
                        C depends on Y from A

                         

                        If A cannot find X because B is missing, then C will not be able to find Y from A because A has not been resolved.

                         

                        Bundles will deploy, and install. But with missing requirements the entire chains will not resolve and therefore won't start.

                        • 9. Re: Wildfly OSGI Bundle deployment
                          madere

                          I have Uploaded "Screens Wildfly OSGI Bundles.zip"

                           

                          When you say:

                            "A depends on X from B"

                           

                          Then I consider:

                            B = com.onetrail.CoreOSGI:1.1.0 and contains "X"

                            A = com.onetrail.camel.onetrailCamelCore2Wildfly:1.2.3.SNAPSHOT and has classes extending "X"

                           

                          As you can see in the pics, "B" can be installed/started.

                          But "A" can't be installed because it can't resolve "com.onetrail.model" and  "com.onetrail.util" although they are exported in the "B" bundle (com.onetrail.CoreOSGI:1.1.0)

                           

                          For each installed bundle/jar, the red imported packages should turn black (so it can be resolved).

                           

                          So im still puzzled.

                          • 10. Re: Wildfly OSGI Bundle deployment
                            arcivanov

                            I don't see evidence of what you're describing in the logs. A is installed, but can't resolve Apache Camel. I don't see it being unable to resolve "com.onetrail.model" or "com.onetrail.util".

                            • 11. Re: Wildfly OSGI Bundle deployment
                              madere

                              Take a look at my screenshots please. In the screenshot of com.onetrail.camel.onetrailCamelCore2Wildfly you see that "com.onetrail.model" or "com.onetrail.util". can't be resolved.

                               

                              In the meantiem I installed the Apache Camel 2.18.1 and he still complains that the package can't be resolved (in the screenshot).

                              In the logfile it seems that only 1 package at a time is reported.

                               

                              Remember: deploying and installing these 2 bundles (and more) on Apache Karaf 4.0.5 was no problem. All is running smooth.

                              • 12. Re: Wildfly OSGI Bundle deployment
                                arcivanov

                                I've looked at the screenshots. It shows that ALL of the packages cannot be resolved, including javax.*. This is because resolver solution could not be arrived at and there are no package linkages created.
                                Could you post your latest logs after you added Camel?

                                 

                                I have no idea what you have in your Karaf by default or if anything inside Karaf is pulling missing dependencies. You were missing Camel in the above case so the above set of plugin couldn't have been possibly resolved in Karaf either, unless something else is going on.

                                • 13. Re: Wildfly OSGI Bundle deployment
                                  madere

                                  I have uploaded the new server log: "Martin de Reuver server - with Apache Camel.log".

                                  As you can see on line 205: "Bundle started: org.apache.camel.camel-core:2.18.2".

                                  But in the Felix OSGI console, the package still cant be found.

                                   

                                  1 thing that is strange to me is that the exported packages in "com.onetrail.CoreOSGI:1.1.0" are not listed at the Exported Packages part (see screenshot), but they are listed in manifest file.

                                  Does JBOSGI treats the manifest file correctly? In Apache Karaf the Exported Packages list is correctly filled.

                                  • 14. Re: Wildfly OSGI Bundle deployment
                                    arcivanov

                                    Hi again

                                     

                                    2017-04-05 08:22:36,969 WARN  [org.jboss.as.osgi] (MSC service thread 1-3) JBAS011910: Cannot resolve requirements: [XPackageRequirement[dirs={filter=(osgi.wiring.package=net.sf.json)},[com.onetrail.camel.onetrailCamelCore2Wildfly:1.0.0.SNAPSHOT]]]

                                     

                                    Here's the deal:

                                    1. open your server log
                                    2. look for "Cannot resolve requirements".
                                    3. If found, add missing bundles.
                                    4. Go to 1 until no more missing requirements are there.

                                    If your logs are clean and things still don't work, do let me know.

                                    1 2 Previous Next