Uploaded image for project: 'OFBiz'
  1. OFBiz
  2. OFBIZ-5879

Sometimes, RMIDispatcher cannot be constructed

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: Trunk
    • Fix Version/s: 16.11.01
    • Component/s: framework
    • Labels:
      None
    • Sprint:
      Bug Crush Event - 21/2/2015

      Description

      sometimes, the ofbiz instance startup failed because following error:

      java.lang.NullPointerException
      at javolution.util.FastMap$Entry.access$302(FastMap.java:1530)
      at javolution.util.FastMap.put(FastMap.java:490)
      at javolution.util.FastMap.put(FastMap.java:453)
      at org.ofbiz.service.group.ServiceGroupReader.addGroupDefinitions(ServiceGroupReader.java:79)
      at org.ofbiz.service.group.ServiceGroupReader.readConfig(ServiceGroupReader.java:62)
      at org.ofbiz.service.ServiceDispatcher.<init>(ServiceDispatcher.java:104)
      at org.ofbiz.service.ServiceDispatcher.<init>(ServiceDispatcher.java:151)
      at org.ofbiz.service.ServiceDispatcher.getInstance(ServiceDispatcher.java:183)
      at org.ofbiz.service.ServiceDispatcher.getLocalDispatcher(ServiceDispatcher.java:162)
      at org.ofbiz.service.GenericDispatcherFactory.createLocalDispatcher(GenericDispatcherFactory.java:46)
      at org.ofbiz.service.ServiceContainer.getLocalDispatcher(ServiceContainer.java:90)
      at org.ofbiz.service.rmi.RmiServiceContainer.start(RmiServiceContainer.java:133)
      at org.ofbiz.base.container.ContainerLoader.start(ContainerLoader.java:237)
      at org.ofbiz.base.start.Start.startStartLoaders(Start.java:341)
      at org.ofbiz.base.start.Start.start(Start.java:367)
      at org.ofbiz.base.start.Start.main(Start.java:135)
      20141110104822705 |Thread-0 |ContainerLoader |I| Shutting down containers
      20141110104822705 |Thread-0 |ContainerLoader |I| Stopping container birt-container
      20141110104822706 |Thread-0 |ContainerLoader |I| Stopped container birt-container
      20141110104822706 |Thread-0 |ContainerLoader |I| Stopping container catalina-container
      20141110104822706 |Thread-0 |ContainerLoader |I| Stopped container catalina-container
      20141110104822706 |Thread-0 |ContainerLoader |I| Stopping container rmi-dispatcher
      java.lang.NullPointerException
      at org.ofbiz.service.rmi.RmiServiceContainer.stop(RmiServiceContainer.java:176)
      at org.ofbiz.base.container.ContainerLoader.unload(ContainerLoader.java:264)
      at org.ofbiz.base.start.Start.shutdownServer(Start.java:317)
      at org.ofbiz.base.start.Start$1.run(Start.java:231)

      Since it's hard to reproduce, and I'm not familiar with the logic behind it, I'm unable to figure out what the root cause is.

      Anyone can help?

        Issue Links

          Activity

          Hide
          utcb Leon added a comment -

          Maybe it's concurrency issue related to FastMap. Since ofbiz is intending to remove all Javolutions, I will apply latest patch (using ConcurrentHashMap instead) and close this ticket.

          Show
          utcb Leon added a comment - Maybe it's concurrency issue related to FastMap. Since ofbiz is intending to remove all Javolutions, I will apply latest patch (using ConcurrentHashMap instead) and close this ticket.
          Hide
          adrianc@hlmksw.com Adrian Crum added a comment -

          I also experience the same exception occasionally. I agree that the solution is to replace Javolution with plain Java classes.

          Show
          adrianc@hlmksw.com Adrian Crum added a comment - I also experience the same exception occasionally. I agree that the solution is to replace Javolution with plain Java classes.
          Hide
          lektran Scott Gray added a comment -

          I'm willing to bet that NPE is caused because the key is null (which FastMap doesn't allow) and if that's the case then it's an issue with the XML parser rather than javolution and switching the implementation will merely hide the problem. Just to be safe I'd suggest adding a null check on groupName until we can be sure I'm wrong.

          This reminds me of a similar issue we saw a while back where some service engine map configs would randomly be set to null when the configuration was cached as an XML document model.

          Show
          lektran Scott Gray added a comment - I'm willing to bet that NPE is caused because the key is null (which FastMap doesn't allow) and if that's the case then it's an issue with the XML parser rather than javolution and switching the implementation will merely hide the problem. Just to be safe I'd suggest adding a null check on groupName until we can be sure I'm wrong. This reminds me of a similar issue we saw a while back where some service engine map configs would randomly be set to null when the configuration was cached as an XML document model.
          Hide
          adrianc@hlmksw.com Adrian Crum added a comment -

          Null pointer check added in rev 1662084. Thanks Scott!

          Show
          adrianc@hlmksw.com Adrian Crum added a comment - Null pointer check added in rev 1662084. Thanks Scott!

            People

            • Assignee:
              adrianc@hlmksw.com Adrian Crum
              Reporter:
              utcb Leon
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development

                  Agile