Browse Source

ignore EntityFactory aware error

zhouhao 2 years ago
parent
commit
a7c6877074

+ 8 - 1
hsweb-commons/hsweb-commons-api/src/main/java/org/hswebframework/web/api/crud/entity/EntityFactoryHolderConfiguration.java

@@ -1,5 +1,6 @@
 package org.hswebframework.web.api.crud.entity;
 
+import org.springframework.beans.BeansException;
 import org.springframework.context.ApplicationContextAware;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
@@ -10,7 +11,13 @@ public class EntityFactoryHolderConfiguration {
 
     @Bean
     public ApplicationContextAware entityFactoryHolder() {
-        return context -> EntityFactoryHolder.FACTORY = context.getBean(EntityFactory.class);
+        return context -> {
+            try {
+                EntityFactoryHolder.FACTORY = context.getBean(EntityFactory.class);
+            } catch (BeansException ignore) {
+                
+            }
+        };
     }
 
 }