Uploaded image for project: 'Fuse Tooling'
  1. Fuse Tooling
  2. FUSETOOLS-1138

NPE in karaf server core support after removing a deployed project

    XMLWordPrintable

Details

    • Hide
      • create 2 projects (camel-blueprint and camel-spring for example)
      • start the Apache Karaf 2.3 server
      • select the server in the servers view
      • Add and Remove...
      • Add All >>
      • select the server in the servers view
      • Publish
      • observe the 2 projects as deployed and active in the karaf container
      • select the server in the servers view
      • remove camel-spring
      • camel-spring is removed fro the Server view Karaf expansion but still exists in the karaf bundle
      • select the server in the servers view
      • Publish - should get the NPE
      Show
      create 2 projects (camel-blueprint and camel-spring for example) start the Apache Karaf 2.3 server select the server in the servers view Add and Remove... Add All >> select the server in the servers view Publish observe the 2 projects as deployed and active in the karaf container select the server in the servers view remove camel-spring camel-spring is removed fro the Server view Karaf expansion but still exists in the karaf bundle select the server in the servers view Publish - should get the NPE

    Description

      Publish fails in karaf server subsystem:

      java.lang.NullPointerException
      at org.fusesource.ide.server.karaf.core.util.KarafUtils.getModelFile(KarafUtils.java:231)
      at org.fusesource.ide.server.karaf.core.util.KarafUtils.runBuild(KarafUtils.java:259)
      at org.fusesource.ide.server.karaf.core.util.KarafUtils.runBuild(KarafUtils.java:243)
      at org.fusesource.ide.server.karaf.core.server.subsystems.Karaf2xPublishController.publishModule(Karaf2xPublishController.java:9
      4)
      at org.jboss.ide.eclipse.as.wtp.core.server.behavior.ControllableServerBehavior.publishModule(ControllableServerBehavior.java:13
      4)
      at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publishModule(ServerBehaviourDelegate.java:1091)
      at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publishModules(ServerBehaviourDelegate.java:1183)
      at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publish(ServerBehaviourDelegate.java:987)
      at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publish(ServerBehaviourDelegate.java:774)
      at org.eclipse.wst.server.core.internal.Server.publishImpl(Server.java:3157)
      at org.eclipse.wst.server.core.internal.Server$PublishJob.run(Server.java:345)
      at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

      some defensive code to protect against the NPE:

      diff --git a/plugins/org.fusesource.ide.server.karaf.core/src/org/fusesource/ide/server/karaf/core/server/subsystems/Karaf2xPublishContr
      index e421c0b..5c56cd4 100644
      — a/plugins/org.fusesource.ide.server.karaf.core/src/org/fusesource/ide/server/karaf/core/server/subsystems/Karaf2xPublishController.j
      +++ b/plugins/org.fusesource.ide.server.karaf.core/src/org/fusesource/ide/server/karaf/core/server/subsystems/Karaf2xPublishController.j
      @@ -90,6 +90,8 @@ public class Karaf2xPublishController extends AbstractSubsystemController
      int publishType = KarafUtils.getPublishType(getServer(), module, kind, deltaKind);
      switch (publishType) {
      case KarafUtils.FULL_PUBLISH:
      + if (!module[0].exists())
      + break;
      // do a build
      boolean built = KarafUtils.runBuild(GOALS, module[0], monitor);
      status = this.publisher.publish(getServer(), module);
      @@ -97,6 +99,8 @@ public class Karaf2xPublishController extends AbstractSubsystemController
      ((Server)getServer()).setModuleState(module, status);
      break;
      case KarafUtils.INCREMENTAL_PUBLISH:
      + if (!module[0].exists())
      + break;
      // do a build
      built = KarafUtils.runBuild(GOALS, module[0], monitor);
      status = this.publisher.publish(getServer(), module);

      Attachments

        Activity

          People

            lheinema@redhat.com Lars Heinemann
            rhn-support-pleacu Paul Leacu (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: