diff --git a/application/src/main/java/org/thingsboard/server/actors/ActorSystemContext.java b/application/src/main/java/org/thingsboard/server/actors/ActorSystemContext.java index c7312ce5c3..28aaa583ab 100644 --- a/application/src/main/java/org/thingsboard/server/actors/ActorSystemContext.java +++ b/application/src/main/java/org/thingsboard/server/actors/ActorSystemContext.java @@ -221,7 +221,8 @@ public class ActorSystemContext { @Getter private EntityViewService entityViewService; - @Autowired + @Lazy + @Autowired(required = false) @Getter private TbEntityViewService tbEntityViewService; diff --git a/application/src/main/java/org/thingsboard/server/service/entitiy/AbstractTbEntityService.java b/application/src/main/java/org/thingsboard/server/service/entitiy/AbstractTbEntityService.java index 8439c1780b..7abe031f2e 100644 --- a/application/src/main/java/org/thingsboard/server/service/entitiy/AbstractTbEntityService.java +++ b/application/src/main/java/org/thingsboard/server/service/entitiy/AbstractTbEntityService.java @@ -21,6 +21,7 @@ import lombok.Getter; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Lazy; import org.thingsboard.server.cluster.TbClusterService; import org.thingsboard.server.common.data.EntityType; import org.thingsboard.server.common.data.HasName; @@ -93,13 +94,13 @@ public abstract class AbstractTbEntityService { @Autowired protected DbCallbackExecutorService dbExecutor; - @Autowired + @Autowired(required = false) protected TbNotificationEntityService notificationEntityService; @Autowired(required = false) protected EdgeService edgeService; @Autowired protected AlarmService alarmService; - @Autowired + @Autowired(required = false) protected EntityActionService entityActionService; @Autowired protected DeviceService deviceService; @@ -111,24 +112,27 @@ public abstract class AbstractTbEntityService { protected TenantService tenantService; @Autowired protected CustomerService customerService; - @Autowired + @Lazy + @Autowired(required = false) protected ClaimDevicesService claimDevicesService; @Autowired protected TbTenantProfileCache tenantProfileCache; @Autowired protected RuleChainService ruleChainService; - @Autowired + @Autowired(required = false) protected TbRuleChainService tbRuleChainService; - @Autowired + @Autowired(required = false) protected EdgeNotificationService edgeNotificationService; @Autowired protected QueueService queueService; @Autowired protected DashboardService dashboardService; + @Autowired protected EntitiesVersionControlService vcService; @Autowired protected EntityViewService entityViewService; + @Lazy @Autowired protected TelemetrySubscriptionService tsSubService; @Autowired @@ -149,7 +153,7 @@ public abstract class AbstractTbEntityService { protected InstallScripts installScripts; @Autowired protected UserService userService; - @Autowired + @Autowired(required = false) protected TbResourceService resourceService; @Autowired protected WidgetsBundleService widgetsBundleService; diff --git a/application/src/main/java/org/thingsboard/server/service/entitiy/entityView/DefaultTbEntityViewService.java b/application/src/main/java/org/thingsboard/server/service/entitiy/entityView/DefaultTbEntityViewService.java index 546a48d4a8..c7d447371f 100644 --- a/application/src/main/java/org/thingsboard/server/service/entitiy/entityView/DefaultTbEntityViewService.java +++ b/application/src/main/java/org/thingsboard/server/service/entitiy/entityView/DefaultTbEntityViewService.java @@ -44,8 +44,6 @@ import org.thingsboard.server.common.data.kv.TsKvEntry; import org.thingsboard.server.common.data.plugin.ComponentLifecycleEvent; import org.thingsboard.server.common.msg.plugin.ComponentLifecycleMsg; import org.thingsboard.server.dao.timeseries.TimeseriesService; -import org.thingsboard.server.queue.util.TbCoreComponent; -import org.thingsboard.server.queue.util.TbRuleEngineComponent; import org.thingsboard.server.service.entitiy.AbstractTbEntityService; import org.thingsboard.server.service.security.model.SecurityUser; @@ -62,8 +60,6 @@ import java.util.stream.Collectors; import static org.apache.commons.lang3.StringUtils.isBlank; @Service -@TbCoreComponent -@TbRuleEngineComponent @AllArgsConstructor @Slf4j public class DefaultTbEntityViewService extends AbstractTbEntityService implements TbEntityViewService {