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

Adding a new entity-group but no corresponding delegator/group-map is hard to debug

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Implemented
    • Trunk
    • 16.11.01
    • framework
    • None
    • Important

    Description

      When you add a new entity-group in an entitygroup.xml, eg

      <entity-group group="new.group.name"
      

      but forget to set the corresponding delegator/group-map in entityengine.xml

      <group-map group-name="new.group.name"
      

      You get an error stack like

      [java] 2015-06-25 16:56:25,036 |delegator-startup-1  |ModelEntityChecker  |INFO| [initReservedWords] array length = 1025
      [java] 2015-06-25 16:56:25,105 |main                 |ExecutionPool       |ERROR| null
      [java] java.util.concurrent.ExecutionException: java.lang.NullPointerException
      [java]     at java.util.concurrent.FutureTask.report(FutureTask.java:122) ~[?:1.7.0_45]
      [java]     at java.util.concurrent.FutureTask.get(FutureTask.java:188) ~[?:1.7.0_45]
      [java]     at org.ofbiz.base.concurrent.ExecutionPool.getAllFutures(ExecutionPool.java:83) [ofbiz-base.jar:?]
      [java]     at org.ofbiz.entity.DelegatorContainer.start(DelegatorContainer.java:55) [ofbiz-entity.jar:?]
      [java]     at org.ofbiz.base.container.ContainerLoader.start(ContainerLoader.java:237) [ofbiz-base.jar:?]
      [java]     at org.ofbiz.base.start.Start.startStartLoaders(Start.java:343) [ofbiz.jar:?]
      [java]     at org.ofbiz.base.start.Start.start(Start.java:369) [ofbiz.jar:?]
      [java]     at org.ofbiz.base.start.Start.main(Start.java:136) [ofbiz.jar:?]
      [java] Caused by: java.lang.NullPointerException
      [java]     at org.ofbiz.entity.GenericDelegator.getEntityFieldType(GenericDelegator.java:561) ~[ofbiz-entity.jar:?]
      [java]     at org.ofbiz.entity.model.ModelEntityChecker.checkEntities(ModelEntityChecker.java:111) ~[ofbiz-entity.jar:?]
      [java]     at org.ofbiz.entity.GenericDelegator.<init>(GenericDelegator.java:224) ~[ofbiz-entity.jar:?]
      [java]     at org.ofbiz.entity.DelegatorFactoryImpl.getInstance(DelegatorFactoryImpl.java:33) ~[ofbiz-entity.jar:?]
      [java]     at org.ofbiz.entity.DelegatorFactoryImpl.getInstance(DelegatorFactoryImpl.java:25) ~[ofbiz-entity.jar:?]
      [java]     at org.ofbiz.base.util.UtilObject.getObjectFromFactory(UtilObject.java:200) ~[ofbiz-base.jar:?]
      [java]     at org.ofbiz.entity.DelegatorFactory$DelegatorConfigurable.call(DelegatorFactory.java:83) ~[ofbiz-entity.jar:?]
      [java]     at org.ofbiz.entity.DelegatorFactory$DelegatorConfigurable.call(DelegatorFactory.java:74) ~[ofbiz-entity.jar:?]
      [java]     at java.util.concurrent.FutureTask.run(FutureTask.java:262) ~[?:1.7.0_45]
      [java]     at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) ~[?:1.7.0_45]
      [java]     at java.util.concurrent.FutureTask.run(FutureTask.java:262) ~[?:1.7.0_45]
      [java]     at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178) ~[?:1.7.0_45]
      [java]     at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292) ~[?:1.7.0_45]
      [java]     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) ~[?:1.7.0_45]
      [java]     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) ~[?:1.7.0_45]
      [java]     at java.lang.Thread.run(Thread.java:744) ~[?:1.7.0_45]
      [....]
      

      and that's hard to debug. So we need to put a warning somewhere in the log...

      This can happen when several teams or developers work together and forget to communicate their entitygroup changes...

      Attachments

        Activity

          People

            jleroux Jacques Le Roux
            jleroux Jacques Le Roux
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: