1 2 Previous Next 17 Replies Latest reply on Jan 3, 2012 2:53 AM by bosschaert Go to original post
      • 15. Re: Weld-OSGi integration in AS7
        mathieu.ancelin

        Actually, we followed a different approach for Weld-OSGi.

        We don't think that it's mandatory to fail a deployment if some OSGi services are not present (after all, OSGi is dynamic and everything is a matter of services that come and go).

         

        With Weld-OSGi it's possible to mark an OSGi service injection point as 'Required' to specify that we absolutely need an implementation of that particular service to work. In this case, it's possible to declare callbacks (via CDI events) that will be activated when all 'Required' dependencies will be present in OSGi service registry or when there are missing dependencies. Then, it's possible to handle cases of mandatory dependencies with these callbacks (start the application when the XYZ service appears and shut it down when it goes off, etc ...)

        • 16. Re: Weld-OSGi integration in AS7
          goodidea

          Just download AS7 CR1. Trying to make work CDI example from bosschaert-coderthoughts-c8edd9c.zip

          I have got error:

          10:23:25,749 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-7) Starting deployment of "osgi-cdi-demo-provider-bundle-1.0.0-SNAPSHOT.jar"

           

          10:23:25,765 INFO  [org.jboss.osgi.framework.internal.BundleManager] (MSC service thread 1-7) Install bundle: osgi-cdi-demo-provider-bundle:1.0.0.SNAP

          SHOT

          10:23:25,780 INFO  [stdout] (MSC service thread 1-7) *** osgi-cdi-demo-provider-bundle started.

          10:23:25,780 INFO  [org.jboss.as.server] (HttpManagementService-threads - 5) JBAS018559: Deployed "osgi-cdi-demo-provider-bundle-1.0.0-SNAPSHOT.jar"

          10:23:25,796 INFO  [org.jboss.osgi.framework.internal.HostBundleState] (MSC service thread 1-7) Bundle started: osgi-cdi-demo-provider-bundle:1.0.0.SN

          APSHOT

          10:25:22,000 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-2) Starting deployment of "osgi-cdi-demo-webapp.war"

          10:25:22,062 INFO  [org.jboss.weld] (MSC service thread 1-4) Processing CDI deployment: osgi-cdi-demo-webapp.war

          10:25:22,078 INFO  [org.jboss.weld] (MSC service thread 1-3) Starting Services for CDI deployment: osgi-cdi-demo-webapp.war

          10:25:22,078 INFO  [org.jboss.weld] (MSC service thread 1-7) Starting weld service

          10:25:22,140 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-7) MSC00001: Failed to start service jboss.deployment.unit."osgi-cdi-demo-webapp

          .war".WeldService: org.jboss.msc.service.StartException in service jboss.deployment.unit."osgi-cdi-demo-webapp.war".WeldService: org.jboss.weld.except

          ions.DeploymentException: WELD-001408 Unsatisfied dependencies for type [OSGiPropertyProvider] with qualifiers [@Default] at injection point [[field]

          @Inject org.coderthoughts.demo.cdiosgi.web.CDIServlet.osgiPropertyProvider]

                  at org.jboss.as.weld.services.WeldService.start(WeldService.java:96)

                  at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1824) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]

                  at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1759) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]

                  at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_25]

                  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_25]

                  at java.lang.Thread.run(Thread.java:662) [:1.6.0_25]

          Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-001408 Unsatisfied dependencies for type [OSGiPropertyProvider] with qualifiers [@Defau

          lt] at injection point [[field] @Inject org.coderthoughts.demo.cdiosgi.web.CDIServlet.osgiPropertyProvider]

                  at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:274)

                  at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:243)

                  at org.jboss.weld.bootstrap.Validator.validateBean(Validator.java:106)

                  at org.jboss.weld.bootstrap.Validator.validateRIBean(Validator.java:126)

                  at org.jboss.weld.bootstrap.Validator.validateBeans(Validator.java:345)

                  at org.jboss.weld.bootstrap.Validator.validateDeployment(Validator.java:330)

                  at org.jboss.weld.bootstrap.WeldBootstrap.validateBeans(WeldBootstrap.java:366)

                  at org.jboss.as.weld.WeldContainer.start(WeldContainer.java:82)

                  at org.jboss.as.weld.services.WeldService.start(WeldService.java:89)

                  ... 5 more

           

          10:25:22,375 INFO  [org.jboss.as.server] (HttpManagementService-threads - 6) JBAS015856: Undeploy of deployment "osgi-cdi-demo-webapp.war" was rolled

          back with failure message {"JBAS014671: Failed services" => {"jboss.deployment.unit.\"osgi-cdi-demo-webapp.war\".WeldService" => "org.jboss.msc.servic

          e.StartException in service jboss.deployment.unit.\"osgi-cdi-demo-webapp.war\".WeldService: org.jboss.weld.exceptions.DeploymentException: WELD-001408

          Unsatisfied dependencies for type [OSGiPropertyProvider] with qualifiers [@Default] at injection point [[field] @Inject org.coderthoughts.demo.cdiosg

          i.web.CDIServlet.osgiPropertyProvider]"}}

          10:25:22,375 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-2) Stopped deployment osgi-cdi-demo-webapp.war in 12ms

          10:25:22,375 INFO  [org.jboss.as.controller] (HttpManagementService-threads - 6) JBAS014774: Service status report

          JBAS014777:   Services which failed to start:      service jboss.deployment.unit."osgi-cdi-demo-webapp.war".WeldService: org.jboss.msc.service.StartEx

          ception in service jboss.deployment.unit."osgi-cdi-demo-webapp.war".WeldService: org.jboss.weld.exceptions.DeploymentException: WELD-001408 Unsatisfie

          d dependencies for type [OSGiPropertyProvider] with qualifiers [@Default] at injection point [[field] @Inject org.coderthoughts.demo.cdiosgi.web.CDISe

          rvlet.osgiPropertyProvider]

          • 17. Re: Weld-OSGi integration in AS7
            bosschaert

            Hi Konstantin,

             

            The Weld-OSGi integration is not yet part of AS7. Please check JBOSGI-445 to see the status.

             

            Best regards,

             

            David

            1 2 Previous Next