0 Replies Latest reply on Apr 1, 2015 4:27 PM by Roland Deck

    deployment of war - file (non-osgi) with dependencies to osgi - bundles

    Roland Deck Newbie

      Hi all

       

      In the Blog about JBoss osgi (a war - file (non-osgi) needs to access classes/services in osgi-bundles, the following has been said:

       

      like mentioned in the thread, there's two options:

      • osgify the war, provide it a valid OSGi manifest and
      • using regular dependencies mechanism, either through jboss-deployment-structure.xml or Dependencies header in the manifest.mf

      Both of these worked for me.

       

      I tried (with JBoss EAP 6.3 / JBoss AS 7.4):

       

      1) to use Dependencies header in the manifest.mf file => I get the error message "invalid header field"

      2) to use jboss-deployment-structure.xml (with <jboss-deployment-structure><deployment><dependencies><module name="...):

      2a) I tried with <module name="<bundle name>.<bundle version>" => This didn't work, I got the error:

      15:26:58,571 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-5) MSC000001: Failed to start service jboss.module.service."deployment.ch.allianz.portal.kp.war".main: org.jboss.msc.service.StartException in service jboss.module.service."deployment.ch.allianz.portal.kp.war".main: JBAS018759: Laden des Moduls fehlgeschlagen: deployment.ch.allianz.portal.kp.war:main

          at org.jboss.as.server.moduleservice.ModuleLoadService.start(ModuleLoadService.java:91) [jboss-as-server-7.4.0.Final-redhat-19.jar:7.4.0.Final-redhat-19]

          at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1980) [jboss-msc-1.1.5.Final-redhat-1.jar:1.1.5.Final-redhat-1]

          at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1913) [jboss-msc-1.1.5.Final-redhat-1.jar:1.1.5.Final-redhat-1]

          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0_09]

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0_09]

          at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_09]

      Caused by: org.jboss.modules.ModuleNotFoundException: at.allianz.a3k.authentication_14.5.0.201503251218:main

          at org.jboss.modules.Module.addPaths(Module.java:1050) [jboss-modules.jar:1.3.3.Final-redhat-1]

          at org.jboss.modules.Module.link(Module.java:1406) [jboss-modules.jar:1.3.3.Final-redhat-1]

          at org.jboss.modules.Module.relinkIfNecessary(Module.java:1434) [jboss-modules.jar:1.3.3.Final-redhat-1]

          at org.jboss.modules.ModuleLoader.loadModule(ModuleLoader.java:242) [jboss-modules.jar:1.3.3.Final-redhat-1]

          at org.jboss.as.server.moduleservice.ModuleLoadService.start(ModuleLoadService.java:70) [jboss-as-server-7.4.0.Final-redhat-19.jar:7.4.0.Final-redhat-19]

          ... 5 more

      2b) I tried with <module name="deployment.<bundle name>.<bundle version>" => This didn't work either, I got the error:

      11:39:15,359 ERROR [org.jboss.as.server] (DeploymentScanner-threads - 1) JBAS015870: Deploy von Deployment "ch.allianz.portal.kp.war" wurde mit folgender Fehlermeldung zurückgesetzt:

      {"JBAS014771: Dienste mit fehlenden/unverfügbaren Abhängigkeiten " => [

          "jboss.module.resolve.phase.\"deployment.ch.allianz.portal.kp.war\".main.1 [jboss.module.spec.service.\"deployment.at.allianz.a3k.orbit_14.5.0.201503251218\".main, jboss.module.spec.service.\"deployment.at.allianz.a3k.report.birt_14.5.0.201503251218\".main, jboss.module.spec.service.\"deployment.at.allianz.a3k.report_14.5.0.201503251218\".main, jboss.module.spec.service.\"deployment.at.allianz.a3k.gui_14.5.0.201503251218\".main, jboss.module.spec.service.\"deployment.at.allianz.a3k_14.5.0.201503251218\".main, jboss.module.spec.service.\"deployment.at.allianz.a3k.authentication_14.5.0.201503251218\".main] fehlt",

          "jboss.module.service.\"deployment.ch.allianz.portal.kp.war\".main [jboss.module.spec.service.\"deployment.at.allianz.a3k.orbit_14.5.0.201503251218\".main, jboss.module.spec.service.\"deployment.at.allianz.a3k.report.birt_14.5.0.201503251218\".main, jboss.module.spec.service.\"deployment.at.allianz.a3k.report_14.5.0.201503251218\".main, jboss.module.spec.service.\"deployment.at.allianz.a3k.gui_14.5.0.201503251218\".main, jboss.module.spec.service.\"deployment.at.allianz.a3k_14.5.0.201503251218\".main, module.resolved.service.\"deployment.ch.allianz.portal.kp.war\".main, jboss.module.spec.service.\"deployment.at.allianz.a3k.authentication_14.5.0.201503251218\".main] fehlt"

      ]}

       

      It seems to me that with the name starting with deployment. the bundles will be at least found. No ModuleNotFoundException occurs. But JBAS014771 says "services with missing/unavailable dependencies". Since the osgi bundles deployed properly, they are certainly not missing, so they have to be somehow "unavailable".

       

      BIG QUESTION: What do I have to do to be able to deploy my war file which is depending on some osgi bundles? It seems to me that everything I tried out doesn' work properly! Are there any working samples on this topic? Where (please don't post dead links, they don't help.)?