[ https://issues.apache.org/jira/browse/OFBIZ-10760?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17364927#comment-17364927 ] Nicolas Malin commented on OFBIZ-10760: --------------------------------------- I'm also not fully understand what Adrian have been realized with the idea to pass a null dispatcher. This element is important on many case, I can propose de generate it on the fly for Artifact and Label process {code:java} Index: framework/service/src/main/java/org/apache/ofbiz/service/DispatchContext.java =================================================================== diff --git a/framework/service/src/main/java/org/apache/ofbiz/service/DispatchContext.java b/framework/service/src/main/java/org/apache/ofbiz/service/DispatchContext.java --- a/framework/service/src/main/java/org/apache/ofbiz/service/DispatchContext.java (revision b915bb222f783216943e7822204fc9b7454dc722) +++ b/framework/service/src/main/java/org/apache/ofbiz/service/DispatchContext.java (date 1623932774108) @@ -38,6 +38,7 @@ import org.apache.ofbiz.base.util.Debug; import org.apache.ofbiz.base.util.cache.UtilCache; import org.apache.ofbiz.entity.Delegator; +import org.apache.ofbiz.entity.DelegatorFactory; import org.apache.ofbiz.entity.GenericEntityConfException; import org.apache.ofbiz.entity.config.model.DelegatorElement; import org.apache.ofbiz.entity.config.model.EntityConfig; @@ -121,6 +122,10 @@ * @return LocalDispatcher that was used to create this context */ public LocalDispatcher getDispatcher() { + if (dispatcher == null) { + return new GenericDispatcherFactory().createLocalDispatcher(this.name, + DelegatorFactory.getDelegator(null)); + } return this.dispatcher; } @@ -129,7 +134,7 @@ * @return Delegator associated with this context */ public Delegator getDelegator() { - return dispatcher.getDelegator(); + return getDispatcher().getDelegator(); } /** @@ -137,7 +142,7 @@ * @return Security object associated with this dispatcher */ public Security getSecurity() { - return dispatcher.getSecurity(); + return getDispatcher().getSecurity(); } // All the methods that follow are helper methods to retrieve service model information from cache (and manage the cache) {code} > Errors and warnings in webtools' ArtifactInfo > --------------------------------------------- > > Key: OFBIZ-10760 > URL: https://issues.apache.org/jira/browse/OFBIZ-10760 > Project: OFBiz > Issue Type: Bug > Components: framework/webtools > Affects Versions: Release Branch 18.12, Release Branch 17.12, Trunk > Reporter: Mathieu Lirzin > Assignee: Michael Brohl > Priority: Major > Attachments: ArtifactInfo.log, OFBIZ-10760_Fixed-Remove-updateEntitySyncRunning-service.patch, OFBIZ-10760_Fixed-Removing-unused-services.patch, OFBIZ-10760_Fixed-declare-entity-auto-services-properly.patch > > > When running {{https://localhost:8443/webtools/control/ArtifactInfo}} multiple warnings and errors are logged, including missing definition of services and {{null}} pointer exceptions. > The filtered log is available in [^ArtifactInfo.log] . -- This message was sent by Atlassian Jira (v8.3.4#803005) |
Free forum by Nabble | Edit this page |