0

I have a project where it has many OSGI bundles with one web (.war). Some OSGi have other OSGi as dependencies and war uses all OSGi as dependencies.

Problem. When I redeploy one of the OSGi bundles then dependent OSGi gets stopped, also war gets unregistered. Is there any way that after redeploy, dependent OSGi and war get refreshed (redeploy) automatically? I am using JBOSS EAP 7.3.0 application server.

Exception is :

11:01:14,238 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC000001: Failed to start service jboss.deployment.unit."W.war".FIRST_MODULE_USE: org.jboss.msc.service.StartException in service jboss.deployment.unit."W.war".FIRST_MODULE_USE: JBAS018733: Failed to process phase FIRST_MODULE_USE of deployment "W.war"
    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:127) [jboss-as-server-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_55]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_55]
    at java.lang.Thread.run(Thread.java:744) [rt.jar:1.7.0_55]
Caused by: java.lang.NullPointerException
    at org.jboss.as.jpa.processor.JPAInterceptorProcessor.deploy(JPAInterceptorProcessor.java:52)
    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:120) [jboss-as-server-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]
    ... 5 more
Sionnach733
  • 4,686
  • 4
  • 36
  • 51
Nikhil soni
  • 121
  • 1
  • 1
  • 8
  • Why do the dependent bundles get stopped? What does "war gets unregistered" mean? And why do you WANT the dependent bundles to get refreshed/redeployed automatically? – Neil Bartlett Nov 25 '14 at 11:47
  • Take one example of A, B are OSGi bundles and W is war application. A has reference of B it means that A uses B OSGi bundle. So we first deploy B OSGi bundle then A OSGi bundle. In this way A OSGi bundle gets reference of B OSGi service . Then We deploy W war so W get use these OSGi services. In War we have injected OSGi service so whenever any bundle gets unregistered Jboss suddenly undeploy War. – Nikhil soni Nov 25 '14 at 12:05
  • "whenever bundle gets unregistered JBoss suddenly undeploy War". Does it really?? This sounds bad. Probably you should report as a bug to JBoss. It's got nothing to do with OSGi. – Neil Bartlett Nov 25 '14 at 20:24
  • Perhaps you are using Import-Bundle/Require-Bundle as the the "reference"? If so then read http://stackoverflow.com/a/11574738/573057 - a build tool like [bndtools](http://bndtools.org/) or [org.apache.felix/maven-bundle-plugin](http://felix.apache.org/site/apache-felix-maven-bundle-plugin-bnd.html) will manage [Import-Package](http://wiki.osgi.org/wiki/Import-Package) for you. – earcam Nov 28 '14 at 01:28

0 Answers0