|
@@ -18,7 +18,6 @@
|
|
|
|
|
|
package org.hswebframework.web.starter;
|
|
|
|
|
|
-import org.hsweb.ezorm.rdb.RDBDatabase;
|
|
|
import org.hsweb.ezorm.rdb.executor.SqlExecutor;
|
|
|
import org.hsweb.ezorm.rdb.meta.RDBDatabaseMetaData;
|
|
|
import org.hsweb.ezorm.rdb.meta.parser.H2TableMetaParser;
|
|
@@ -36,7 +35,6 @@ import org.hswebframework.web.datasource.DatabaseType;
|
|
|
import org.hswebframework.web.service.Service;
|
|
|
import org.hswebframework.web.starter.init.SystemInitialize;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
-import org.springframework.beans.BeansException;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.config.BeanPostProcessor;
|
|
|
import org.springframework.boot.CommandLineRunner;
|
|
@@ -91,11 +89,12 @@ public class SystemInitializeAutoConfiguration implements CommandLineRunner, Bea
|
|
|
addGlobalVariable("spring", applicationContext);
|
|
|
}
|
|
|
|
|
|
+ @SuppressWarnings("all")
|
|
|
protected void addGlobalVariable(String var, Object val) {
|
|
|
engines.forEach(engine -> {
|
|
|
try {
|
|
|
engine.addGlobalVariable(Collections.singletonMap(var, val));
|
|
|
- } catch (Exception ignore) {
|
|
|
+ } catch (NullPointerException ignore) {
|
|
|
}
|
|
|
}
|
|
|
);
|
|
@@ -140,12 +139,12 @@ public class SystemInitializeAutoConfiguration implements CommandLineRunner, Bea
|
|
|
|
|
|
|
|
|
@Override
|
|
|
- public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
|
|
|
+ public Object postProcessBeforeInitialization(Object bean, String beanName) {
|
|
|
return bean;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
|
|
|
+ public Object postProcessAfterInitialization(Object bean, String beanName) {
|
|
|
ScriptScope scope;
|
|
|
if (bean instanceof Service) {
|
|
|
addGlobalVariable(beanName, bean);
|