NutzCN Logo
问答 nutz和nutz-integration-spring升级问题
发布于 2036天前 作者 wx_nlugjssocpkj3bf8bamd 1650 次浏览 复制 上一个帖子 下一个帖子
标签:

因存在启动时sql获取问题,按wendal指导说是升级包就可以了,由于我是接手的项目,本身不熟悉java的配置和Bean等。
特请@wendal再给指点指点。

更新前的包

<dependency>
      <groupId>org.nutz</groupId>
      <artifactId>nutz</artifactId>
      <version>1.r.61</version>
    </dependency>

    <dependency>
      <groupId>org.nutz</groupId>
      <artifactId>nutz-integration-spring</artifactId>
      <version>1.r.61.r2</version>
    </dependency>

更新后的包

<!-- ORM ONLY -->
    <dependency>
      <groupId>org.nutz</groupId>
      <artifactId>nutz</artifactId>
      <version>1.r.66</version>
    </dependency>

    <dependency>
      <groupId>org.nutz</groupId>
      <artifactId>nutz-integration-spring</artifactId>
      <version>1.r.66.r2</version>
    </dependency>

其他配置代码如下:



import com.zaxxer.hikari.HikariDataSource; import org.nutz.integration.spring.SpringResourceLoaction; import org.nutz.resource.Scans; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Primary; import org.springframework.core.annotation.Order; import javax.sql.DataSource; @Configuration @EnableAutoConfiguration @ConfigurationProperties(prefix = "spring.datasource") @Order(2) public class DataSourceConfig { private String username; private String password; private String url; private String driverClassName; private String connectionTestQuery; private int maximumPoolSize; @Autowired private PkGenConfig pkGenConfig; @Autowired private ApplicationContext applicationContext; @Bean @Primary public DataSource primaryDataSource() { final HikariDataSource ds = new HikariDataSource(); ds.setDriverClassName(driverClassName); ds.setJdbcUrl(url); ds.setUsername(username); ds.setPassword(password); ds.setMaximumPoolSize(maximumPoolSize==0?200:maximumPoolSize); ds.setPoolName(pkGenConfig.getIp()); ds.setConnectionTestQuery(connectionTestQuery); return ds; } public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public String getUrl() { return url; } public void setUrl(String url) { this.url = url; } public String getDriverClassName() { return driverClassName; } public void setDriverClassName(String driverClassName) { this.driverClassName = driverClassName; } public String getConnectionTestQuery() { return connectionTestQuery; } public void setConnectionTestQuery(String connectionTestQuery) { this.connectionTestQuery = connectionTestQuery; } public int getMaximumPoolSize() { return maximumPoolSize; } public void setMaximumPoolSize(int maximumPoolSize) { this.maximumPoolSize = maximumPoolSize; } public ApplicationContext getApplicationContext() { return applicationContext; } public void setApplicationContext(ApplicationContext applicationContext) { this.applicationContext = applicationContext; } }

package cn.guanfu.common.db;

import cn.guanfu.common.utils.Utils;
import cn.guanfu.config.PkGenConfig;
import cn.guanfu.entity.SysIdWorkerEntity;
import cn.guanfu.service.SystemService;
import com.relops.snowflake.Snowflake;
import org.nutz.conf.NutConf;
import cn.guanfu.common.constants.Const;
import cn.guanfu.common.generator.FireIdGenerator;

import org.nutz.dao.*;
import org.nutz.dao.entity.Entity;
import org.nutz.dao.entity.Record;
import org.nutz.dao.impl.EntityHolder;
import org.nutz.dao.impl.FileSqlManager;
import org.nutz.dao.impl.NutDao;
import org.nutz.dao.jdbc.JdbcExpert;
import org.nutz.dao.pager.Pager;
import org.nutz.dao.sql.PojoMaker;
import org.nutz.dao.sql.Sql;
import org.nutz.el.opt.custom.CustomMake;
import org.nutz.integration.spring.SpringResourceLoaction;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.lang.Each;
import org.nutz.resource.NutResource;
import org.nutz.resource.Scans;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.annotation.Order;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
import org.springframework.core.io.ResourceLoader;
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
import org.springframework.stereotype.Repository;

import javax.annotation.PostConstruct;
import javax.sql.DataSource;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

@SuppressWarnings("SpringJavaAutowiringInspection")
@Configuration
@Repository("dao")
@Order(3)
public class GFDao extends NutDao{

//    @Autowired
//    private PKGenerator pkGenerator;


    @Autowired
    private FireIdGenerator fireIdGenerator;

    @Autowired
    private PkGenConfig pkGenConfig;

    private DataSource hikariDataSource;

    private Integer node;

    private FileSqlManager fileSqlManager;

//    private static final String[] SQLS = {
//            "user.sql",
//            "module.sql",
//            "system.sql",
//            "article.sql"
//    };



    /**
     * 查全部
     * @param clazz
     * @param sqlName
     * @param <T>
     * @return
     */
    public  <T>List<T>  getList(Class clazz,String sqlName){
        return this.getList(clazz,sqlName,null);
    }

    /**
     * 通过页码查询
     * @param clazz
     * @param sqlName
     * @param pageNumber
     * @param <T>
     * @return
     */
    public  <T>List<T>  getList(Class clazz,String sqlName,int pageNumber){
        return this.getList(clazz,sqlName,null,null,pageNumber);
    }

    /**
     * 通过参数查询
     * @param clazz
     * @param sqlName
     * @param params
     * @param pageNumber
     * @param <T>
     * @return
     */
    public  <T>List<T>  getList(Class clazz, String sqlName, Map params,Map vars, Integer pageNumber){
        Pager pager = null;
        if(pageNumber != null){
            pager  = new Pager();
            pager.setPageNumber(pageNumber);
            pager.setPageSize(15);
        }
        return this.getPageList(clazz,sqlName,params,vars,pager);
    }

    public  <T>List<T>  getList(Class clazz, String sqlName, Map params,Map vars){

        return this.getPageList(clazz,sqlName,params,vars,null);
    }

    /**
     *
     * @param clazz 返回类型
     * @param sqlName sql 名
     * @param params 参数
     * @param <T> 返回类型
     * @return
     */
    public <T>List<T>  getList(Class clazz, String sqlName, Map params){

        return this.getPageList(clazz,sqlName,params,null,null);
    }


    /**
     * 自定义分页查询
     * @param clazz
     * @param sqlName
     * @param params
     * @param pager
     * @param <T>
     * @return
     */
    public  <T>List<T>  getPageList(Class clazz, String sqlName, Map params,Map vars, Pager pager){
        Sql sql = this.sqls().create(sqlName);
        sql.setCallback(Sqls.callback.entities());
        sql.setEntity(this.getEntity(clazz));
        if(params != null && params.size() > 0){
            sql.params().putAll(params);
        }

        if(vars != null && vars.size() > 0){
            sql.vars().putAll(vars);
        }

        if(pager != null){
            sql.setPager(pager);
        }

        this.execute(sql);
        return sql.getList(clazz);
    }






    public <T> T getObject(Class<T> clazz,String sqlName){
        return this.getObject(clazz,sqlName,null);
    }


    public <T> T  getObject(Class<T> clazz,String sqlName, Map params){
        return getObject(clazz,sqlName,params,null);
    }


    public <T> T  getObject(Class<T> clazz,String sqlName, Map params,Map vars){
        Sql sql = this.sqls().create(sqlName);
        sql.setCallback(Sqls.callback.entities());
        sql.setEntity(this.getEntity(clazz));

        if(params != null){
            sql.params().putAll(params);
        }

        if(vars != null){
            sql.vars().putAll(vars);
        }

        this.execute(sql);
        return sql.getObject(clazz);
    }


    @PostConstruct
    public void reg(){

        String ip = pkGenConfig.getIp();

        if(ip == null){

            this.node = 1024;

        }else{

            SysIdWorkerEntity sysIdWorkerEntity = this.fetch(SysIdWorkerEntity.class, Cnd.where("ip","=",ip));

            if(sysIdWorkerEntity != null){
                this.node = sysIdWorkerEntity.getNode();
            }else{
                sysIdWorkerEntity = insertNewWorker();
                this.node = sysIdWorkerEntity.getNode();
            }

        }


        fireIdGenerator.setSnowflake(new Snowflake(this.node));

        CustomMake.me().register(Const.ID_GEN_DEF, fireIdGenerator);






    }




    private SysIdWorkerEntity insertNewWorker(){
        SysIdWorkerEntity oldWorker = getObject(SysIdWorkerEntity.class,"sys.fetchMaxNode");

        SysIdWorkerEntity sysIdWorkerEntityNew = new SysIdWorkerEntity();
        sysIdWorkerEntityNew.setCreateTime(Utils.currentTime());
        sysIdWorkerEntityNew.setIp(pkGenConfig.getIp());
        sysIdWorkerEntityNew.setNode(oldWorker==null?1:oldWorker.getNode()+1);

        try {

            this.fastInsert(sysIdWorkerEntityNew);
            return sysIdWorkerEntityNew;

        }catch (Exception e){
            insertNewWorker();
        }

        return null;
    }

    @Autowired
    public void setHikariDataSource(DataSource hikariDataSource) {
        this.hikariDataSource = hikariDataSource;

        SpringResourceLoaction springResourceLoaction = new SpringResourceLoaction();
        springResourceLoaction.setApplicationContext(applicationContext);
        Scans.me().addResourceLocation(springResourceLoaction);



        this.setDataSource(hikariDataSource);
    }


    @Autowired
    private ApplicationContext applicationContext;

}

---
现更新包版本之后,报错如下,不太清楚是哪里没有配置好,如果代码没贴全请@wendal明示,这是在我只更新了nutz和nutz-integration-spring包的情况下提示的,其他东西我没有改。

Connected to the target VM, address: '127.0.0.1:52409', transport: 'socket'
10:47:00.503 [main] DEBUG org.springframework.core.env.StandardEnvironment - Adding [systemProperties] PropertySource with lowest search precedence
10:47:00.510 [main] DEBUG org.springframework.core.env.StandardEnvironment - Adding [systemEnvironment] PropertySource with lowest search precedence
10:47:00.512 [main] DEBUG org.springframework.core.env.StandardEnvironment - Initialized StandardEnvironment with PropertySources [systemProperties,systemEnvironment]
10:47:00.746 [main] DEBUG org.springframework.boot.devtools.settings.DevToolsSettings - Included patterns for restart : []
10:47:00.746 [main] DEBUG org.springframework.boot.devtools.settings.DevToolsSettings - Excluded patterns for restart : [/spring-boot-starter/target/classes/, /spring-boot-autoconfigure/target/classes/, /spring-boot-starter-[\w-]+/, /spring-boot/target/classes/, /spring-boot-actuator/target/classes/, /spring-boot-devtools/target/classes/]
10:47:00.747 [main] DEBUG org.springframework.boot.devtools.restart.ChangeableUrls - Matching URLs for reloading : [file:/Users/wangchao/java-work/guanfuapp-2-0-api/target/classes/]
10:47:00.754 [restartedMain] DEBUG org.springframework.core.env.StandardEnvironment - Adding [systemProperties] PropertySource with lowest search precedence
10:47:00.754 [restartedMain] DEBUG org.springframework.core.env.StandardEnvironment - Adding [systemEnvironment] PropertySource with lowest search precedence
10:47:00.754 [restartedMain] DEBUG org.springframework.core.env.StandardEnvironment - Initialized StandardEnvironment with PropertySources [systemProperties,systemEnvironment]

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v1.5.6.RELEASE)

2019-04-29 10:47:01.541  INFO 70903 --- [  restartedMain] cn.guanfu.GuanfuAppServer                : Starting GuanfuAppServer on wangchaodeMacBook-Pro.local with PID 70903 (/Users/wangchao/java-work/guanfuapp-2-0-api/target/classes started by wangchao in /Users/wangchao/java-work/guanfuapp-2-0-api)
2019-04-29 10:47:01.543  INFO 70903 --- [  restartedMain] cn.guanfu.GuanfuAppServer                : The following profiles are active: pkgen,dev
2019-04-29 10:47:01.633  INFO 70903 --- [  restartedMain] ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@10d3d6d5: startup date [Mon Apr 29 10:47:01 CST 2019]; root of context hierarchy
2019-04-29 10:47:04.138  INFO 70903 --- [  restartedMain] o.s.b.f.s.DefaultListableBeanFactory     : Overriding bean definition for bean 'managementServletContext' with a different definition: replacing [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.boot.actuate.autoconfigure.EndpointWebMvcHypermediaManagementContextConfiguration; factoryMethodName=managementServletContext; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/boot/actuate/autoconfigure/EndpointWebMvcHypermediaManagementContextConfiguration.class]] with [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.boot.actuate.autoconfigure.EndpointWebMvcAutoConfiguration; factoryMethodName=managementServletContext; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/boot/actuate/autoconfigure/EndpointWebMvcAutoConfiguration.class]]
2019-04-29 10:47:04.183  INFO 70903 --- [  restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode!
2019-04-29 10:47:05.352  INFO 70903 --- [  restartedMain] trationDelegate$BeanPostProcessorChecker : Bean 'redisCacheConfig' of type [cn.guanfu.config.RedisCacheConfig$$EnhancerBySpringCGLIB$$c7f22428] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2019-04-29 10:47:05.462  INFO 70903 --- [  restartedMain] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.cache.annotation.ProxyCachingConfiguration' of type [org.springframework.cache.annotation.ProxyCachingConfiguration$$EnhancerBySpringCGLIB$$fdf29e8d] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2019-04-29 10:47:06.072  INFO 70903 --- [  restartedMain] org.xnio                                 : XNIO version 3.3.8.Final
2019-04-29 10:47:06.099  INFO 70903 --- [  restartedMain] org.xnio.nio                             : XNIO NIO Implementation Version 3.3.8.Final
2019-04-29 10:47:06.295  WARN 70903 --- [  restartedMain] io.undertow.websockets.jsr               : UT026009: XNIO worker was not set on WebSocketDeploymentInfo, the default worker will be used
2019-04-29 10:47:06.295  WARN 70903 --- [  restartedMain] io.undertow.websockets.jsr               : UT026010: Buffer pool was not set on WebSocketDeploymentInfo, the default pool will be used
2019-04-29 10:47:06.448  INFO 70903 --- [  restartedMain] io.undertow.servlet                      : Initializing Spring embedded WebApplicationContext
2019-04-29 10:47:06.449  INFO 70903 --- [  restartedMain] o.s.web.context.ContextLoader            : Root WebApplicationContext: initialization completed in 4820 ms
2019-04-29 10:47:06.761  INFO 70903 --- [  restartedMain] o.s.b.w.servlet.ServletRegistrationBean  : Mapping servlet: 'dispatcherServlet' to [/]
2019-04-29 10:47:06.767  INFO 70903 --- [  restartedMain] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'metricsFilter' to: [/*]
2019-04-29 10:47:06.768  INFO 70903 --- [  restartedMain] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'characterEncodingFilter' to: [/*]
2019-04-29 10:47:06.768  INFO 70903 --- [  restartedMain] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
2019-04-29 10:47:06.768  INFO 70903 --- [  restartedMain] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'httpPutFormContentFilter' to: [/*]
2019-04-29 10:47:06.768  INFO 70903 --- [  restartedMain] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'requestContextFilter' to: [/*]
2019-04-29 10:47:06.769  INFO 70903 --- [  restartedMain] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'webRequestLoggingFilter' to: [/*]
2019-04-29 10:47:06.769  INFO 70903 --- [  restartedMain] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'applicationContextIdFilter' to: [/*]
2019-04-29 10:47:07.167  WARN 70903 --- [  restartedMain] ationConfigEmbeddedWebApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dao': Injection of autowired dependencies failed; nested exception is java.lang.NoSuchFieldError: USE_EL_IN_OBJECT_CONVERT
2019-04-29 10:47:07.184  INFO 70903 --- [  restartedMain] utoConfigurationReportLoggingInitializer : 

Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled.
2019-04-29 10:47:07.194 ERROR 70903 --- [  restartedMain] o.s.boot.SpringApplication               : Application startup failed

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dao': Injection of autowired dependencies failed; nested exception is java.lang.NoSuchFieldError: USE_EL_IN_OBJECT_CONVERT
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:372)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1264)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:761)
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543)
	at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122)
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:693)
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:360)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:303)
	at cn.guanfu.GuanfuAppServer.main(GuanfuAppServer.java:34)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49)
Caused by: java.lang.NoSuchFieldError: USE_EL_IN_OBJECT_CONVERT
	at org.nutz.mapl.impl.convert.ObjConvertImpl.<init>(ObjConvertImpl.java:46)
	at org.nutz.mapl.Mapl.maplistToObj(Mapl.java:34)
	at org.nutz.json.Json.parse(Json.java:94)
	at org.nutz.json.Json.fromJson(Json.java:73)
	at org.nutz.json.Json.fromJson(Json.java:178)
	at org.nutz.lang.Lang.map(Lang.java:1282)
	at org.nutz.lang.Strings.<clinit>(Strings.java:1016)
	at org.nutz.lang.util.Disks.normalize(Disks.java:298)
	at org.nutz.lang.util.Disks.absolute(Disks.java:255)
	at org.nutz.lang.Files.findFile(Files.java:465)
	at org.nutz.lang.Files.findFile(Files.java:648)
	at org.nutz.dao.jdbc.Jdbcs.<clinit>(Jdbcs.java:73)
	at org.nutz.dao.impl.DaoSupport.setDataSource(DaoSupport.java:187)
	at org.nutz.dao.impl.DaoSupport.setDataSource(DaoSupport.java:178)
	at cn.guanfu.common.db.GFDao.setHikariDataSource(GFDao.java:274)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredMethodElement.inject(AutowiredAnnotationBeanPostProcessor.java:701)
	at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:366)
	... 20 common frames omitted

Disconnected from the target VM, address: '127.0.0.1:52409', transport: 'socket'

Process finished with exit code 0

7 回复

用68最新版

还是只更新pom文件,但还是之前的那个错误,是哪里需要重新配置下吗?

<!-- ORM ONLY -->
    <dependency>
    <groupId>org.nutz</groupId>
    <artifactId>nutz</artifactId>
    <version>1.r.68.v20190329</version>
  </dependency>

    <!-- https://mvnrepository.com/artifact/org.nutz/nutz-integration-spring -->
    <dependency>
      <groupId>org.nutz</groupId>
      <artifactId>nutz-integration-spring</artifactId>
      <version>1.r.68.v20190329</version>
    </dependency>
Connected to the target VM, address: '127.0.0.1:53432', transport: 'socket'
11:19:33.158 [main] DEBUG org.springframework.core.env.StandardEnvironment - Adding [systemProperties] PropertySource with lowest search precedence
11:19:33.167 [main] DEBUG org.springframework.core.env.StandardEnvironment - Adding [systemEnvironment] PropertySource with lowest search precedence
11:19:33.168 [main] DEBUG org.springframework.core.env.StandardEnvironment - Initialized StandardEnvironment with PropertySources [systemProperties,systemEnvironment]
11:19:33.407 [main] DEBUG org.springframework.boot.devtools.settings.DevToolsSettings - Included patterns for restart : []
11:19:33.408 [main] DEBUG org.springframework.boot.devtools.settings.DevToolsSettings - Excluded patterns for restart : [/spring-boot-starter/target/classes/, /spring-boot-autoconfigure/target/classes/, /spring-boot-starter-[\w-]+/, /spring-boot/target/classes/, /spring-boot-actuator/target/classes/, /spring-boot-devtools/target/classes/]
11:19:33.408 [main] DEBUG org.springframework.boot.devtools.restart.ChangeableUrls - Matching URLs for reloading : [file:/Users/wangchao/java-work/guanfuapp-2-0-api/target/classes/]
11:19:33.416 [restartedMain] DEBUG org.springframework.core.env.StandardEnvironment - Adding [systemProperties] PropertySource with lowest search precedence
11:19:33.416 [restartedMain] DEBUG org.springframework.core.env.StandardEnvironment - Adding [systemEnvironment] PropertySource with lowest search precedence
11:19:33.416 [restartedMain] DEBUG org.springframework.core.env.StandardEnvironment - Initialized StandardEnvironment with PropertySources [systemProperties,systemEnvironment]

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v1.5.6.RELEASE)

2019-04-29 11:19:34.198  INFO 70965 --- [  restartedMain] cn.guanfu.GuanfuAppServer                : Starting GuanfuAppServer on wangchaodeMacBook-Pro.local with PID 70965 (/Users/wangchao/java-work/guanfuapp-2-0-api/target/classes started by wangchao in /Users/wangchao/java-work/guanfuapp-2-0-api)
2019-04-29 11:19:34.200  INFO 70965 --- [  restartedMain] cn.guanfu.GuanfuAppServer                : The following profiles are active: pkgen,dev
2019-04-29 11:19:34.282  INFO 70965 --- [  restartedMain] ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@5cd95f85: startup date [Mon Apr 29 11:19:34 CST 2019]; root of context hierarchy
2019-04-29 11:19:36.602  INFO 70965 --- [  restartedMain] o.s.b.f.s.DefaultListableBeanFactory     : Overriding bean definition for bean 'managementServletContext' with a different definition: replacing [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.boot.actuate.autoconfigure.EndpointWebMvcHypermediaManagementContextConfiguration; factoryMethodName=managementServletContext; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/boot/actuate/autoconfigure/EndpointWebMvcHypermediaManagementContextConfiguration.class]] with [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.boot.actuate.autoconfigure.EndpointWebMvcAutoConfiguration; factoryMethodName=managementServletContext; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/boot/actuate/autoconfigure/EndpointWebMvcAutoConfiguration.class]]
2019-04-29 11:19:36.645  INFO 70965 --- [  restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode!
2019-04-29 11:19:37.736  INFO 70965 --- [  restartedMain] trationDelegate$BeanPostProcessorChecker : Bean 'redisCacheConfig' of type [cn.guanfu.config.RedisCacheConfig$$EnhancerBySpringCGLIB$$d9f3e841] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2019-04-29 11:19:37.830  INFO 70965 --- [  restartedMain] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.cache.annotation.ProxyCachingConfiguration' of type [org.springframework.cache.annotation.ProxyCachingConfiguration$$EnhancerBySpringCGLIB$$ff462a6] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2019-04-29 11:19:38.197  INFO 70965 --- [  restartedMain] org.xnio                                 : XNIO version 3.3.8.Final
2019-04-29 11:19:38.217  INFO 70965 --- [  restartedMain] org.xnio.nio                             : XNIO NIO Implementation Version 3.3.8.Final
2019-04-29 11:19:38.339  WARN 70965 --- [  restartedMain] io.undertow.websockets.jsr               : UT026009: XNIO worker was not set on WebSocketDeploymentInfo, the default worker will be used
2019-04-29 11:19:38.339  WARN 70965 --- [  restartedMain] io.undertow.websockets.jsr               : UT026010: Buffer pool was not set on WebSocketDeploymentInfo, the default pool will be used
2019-04-29 11:19:38.477  INFO 70965 --- [  restartedMain] io.undertow.servlet                      : Initializing Spring embedded WebApplicationContext
2019-04-29 11:19:38.477  INFO 70965 --- [  restartedMain] o.s.web.context.ContextLoader            : Root WebApplicationContext: initialization completed in 4198 ms
2019-04-29 11:19:38.742  INFO 70965 --- [  restartedMain] o.s.b.w.servlet.ServletRegistrationBean  : Mapping servlet: 'dispatcherServlet' to [/]
2019-04-29 11:19:38.751  INFO 70965 --- [  restartedMain] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'metricsFilter' to: [/*]
2019-04-29 11:19:38.753  INFO 70965 --- [  restartedMain] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'characterEncodingFilter' to: [/*]
2019-04-29 11:19:38.753  INFO 70965 --- [  restartedMain] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
2019-04-29 11:19:38.753  INFO 70965 --- [  restartedMain] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'httpPutFormContentFilter' to: [/*]
2019-04-29 11:19:38.753  INFO 70965 --- [  restartedMain] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'requestContextFilter' to: [/*]
2019-04-29 11:19:38.753  INFO 70965 --- [  restartedMain] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'webRequestLoggingFilter' to: [/*]
2019-04-29 11:19:38.753  INFO 70965 --- [  restartedMain] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'applicationContextIdFilter' to: [/*]
2019-04-29 11:19:39.095  WARN 70965 --- [  restartedMain] ationConfigEmbeddedWebApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dao': Injection of autowired dependencies failed; nested exception is java.lang.NoSuchFieldError: USE_EL_IN_OBJECT_CONVERT
2019-04-29 11:19:39.106  INFO 70965 --- [  restartedMain] utoConfigurationReportLoggingInitializer : 

Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled.
2019-04-29 11:19:39.111 ERROR 70965 --- [  restartedMain] o.s.boot.SpringApplication               : Application startup failed

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dao': Injection of autowired dependencies failed; nested exception is java.lang.NoSuchFieldError: USE_EL_IN_OBJECT_CONVERT
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:372)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1264)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:761)
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543)
	at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122)
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:693)
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:360)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:303)
	at cn.guanfu.GuanfuAppServer.main(GuanfuAppServer.java:34)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49)
Caused by: java.lang.NoSuchFieldError: USE_EL_IN_OBJECT_CONVERT
	at org.nutz.mapl.impl.convert.ObjConvertImpl.<init>(ObjConvertImpl.java:46)
	at org.nutz.mapl.Mapl.maplistToObj(Mapl.java:34)
	at org.nutz.json.Json.parse(Json.java:94)
	at org.nutz.json.Json.fromJson(Json.java:73)
	at org.nutz.json.Json.fromJson(Json.java:178)
	at org.nutz.lang.Lang.map(Lang.java:1286)
	at org.nutz.lang.Strings.<clinit>(Strings.java:1016)
	at org.nutz.lang.util.Disks.normalize(Disks.java:305)
	at org.nutz.lang.util.Disks.absolute(Disks.java:262)
	at org.nutz.lang.Files.findFile(Files.java:465)
	at org.nutz.lang.Files.findFile(Files.java:648)
	at org.nutz.dao.jdbc.Jdbcs.<clinit>(Jdbcs.java:73)
	at org.nutz.dao.impl.DaoSupport.setDataSource(DaoSupport.java:189)
	at org.nutz.dao.impl.DaoSupport.setDataSource(DaoSupport.java:180)
	at cn.guanfu.common.db.GFDao.setHikariDataSource(GFDao.java:274)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredMethodElement.inject(AutowiredAnnotationBeanPostProcessor.java:701)
	at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:366)
	... 20 common frames omitted

Disconnected from the target VM, address: '127.0.0.1:53432', transport: 'socket'

Process finished with exit code 0

证明还有另外一个版本的nutz存在, 检查一下依赖树吧

好的,我先去排查排查。

目前我修整了下,具体如下:

<dependency>
      <groupId>org.nutz</groupId>
      <artifactId>nutz</artifactId>
      <version>1.r.68.v20190329</version>
    </dependency>

    <dependency>
      <groupId>org.nutz</groupId>
      <artifactId>nutz-integration-spring</artifactId>
      <version>1.r.68.v20190329</version>
    </dependency>
package cn.guanfu.config;


import com.zaxxer.hikari.HikariDataSource;
import org.nutz.dao.impl.NutDao;
import org.nutz.integration.spring.SpringResourceLoaction;
import org.nutz.resource.Scans;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import org.springframework.core.annotation.Order;

import javax.sql.DataSource;


@Configuration
@EnableAutoConfiguration
@ConfigurationProperties(prefix = "spring.datasource")
@Order(2)
public class DataSourceConfig {

    private String username;

    private String password;

    private String url;

    private String driverClassName;

    private String connectionTestQuery;

    private int maximumPoolSize;

    @Autowired
    private PkGenConfig pkGenConfig;


    @Autowired
    private ApplicationContext applicationContext;

    @Bean
    @Primary
    public DataSource primaryDataSource() {

        final HikariDataSource ds = new HikariDataSource();

        ds.setDriverClassName(driverClassName);
        ds.setJdbcUrl(url);
        ds.setUsername(username);
        ds.setPassword(password);
        ds.setMaximumPoolSize(maximumPoolSize==0?200:maximumPoolSize);
        ds.setPoolName(pkGenConfig.getIp());
        ds.setConnectionTestQuery(connectionTestQuery);
        return ds;
    }

    @Bean
    public NutDao dao(){
        NutDao nutDao = new NutDao();
        nutDao.setDataSource(primaryDataSource());
        return nutDao;

    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getDriverClassName() {
        return driverClassName;
    }

    public void setDriverClassName(String driverClassName) {
        this.driverClassName = driverClassName;
    }

    public String getConnectionTestQuery() {
        return connectionTestQuery;
    }

    public void setConnectionTestQuery(String connectionTestQuery) {
        this.connectionTestQuery = connectionTestQuery;
    }

    public int getMaximumPoolSize() {
        return maximumPoolSize;
    }

    public void setMaximumPoolSize(int maximumPoolSize) {
        this.maximumPoolSize = maximumPoolSize;
    }

    public ApplicationContext getApplicationContext() {
        return applicationContext;
    }

    public void setApplicationContext(ApplicationContext applicationContext) {
        this.applicationContext = applicationContext;
    }
}
package cn.guanfu.common.db;

import cn.guanfu.common.utils.Utils;
import cn.guanfu.config.PkGenConfig;
import com.relops.snowflake.Snowflake;
import org.nutz.conf.NutConf;
import cn.guanfu.common.constants.Const;
import cn.guanfu.common.generator.FireIdGenerator;

import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
import org.nutz.dao.Sqls;
import org.nutz.dao.impl.FileSqlManager;
import org.nutz.dao.impl.NutDao;
import org.nutz.dao.pager.Pager;
import org.nutz.dao.sql.Sql;
import org.nutz.el.opt.custom.CustomMake;
import org.nutz.integration.spring.SpringResourceLoaction;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.resource.NutResource;
import org.nutz.resource.Scans;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.annotation.Order;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
import org.springframework.core.io.ResourceLoader;
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
import org.springframework.stereotype.Repository;

import javax.annotation.PostConstruct;
import javax.sql.DataSource;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;


@SuppressWarnings("SpringJavaAutowiringInspection")
@Configuration
@Repository("dao")
@Order(3)
public class GFDao{

//    @Autowired
//    private PKGenerator pkGenerator;

    private Dao dao;

    @Autowired
    private FireIdGenerator fireIdGenerator;

    @Autowired
    private PkGenConfig pkGenConfig;

    private DataSource hikariDataSource;

    private Integer node;

    private FileSqlManager fileSqlManager;

//    private static final String[] SQLS = {
//            "user.sql",
//            "module.sql",
//            "system.sql",
//            "article.sql"
//    };



    /**
     * 查全部
     * @param clazz
     * @param sqlName
     * @param <T>
     * @return
     */
    public  <T>List<T>  getList(Class clazz,String sqlName){
        return this.getList(clazz,sqlName,null);
    }

    /**
     * 通过页码查询
     * @param clazz
     * @param sqlName
     * @param pageNumber
     * @param <T>
     * @return
     */
    public  <T>List<T>  getList(Class clazz,String sqlName,int pageNumber){
        return this.getList(clazz,sqlName,null,null,pageNumber);
    }

    /**
     * 通过参数查询
     * @param clazz
     * @param sqlName
     * @param params
     * @param pageNumber
     * @param <T>
     * @return
     */
    public  <T>List<T>  getList(Class clazz, String sqlName, Map params,Map vars, Integer pageNumber){
        Pager pager = null;
        if(pageNumber != null){
            pager  = new Pager();
            pager.setPageNumber(pageNumber);
            pager.setPageSize(15);
        }
        return this.getPageList(clazz,sqlName,params,vars,pager);
    }

    public  <T>List<T>  getList(Class clazz, String sqlName, Map params,Map vars){

        return this.getPageList(clazz,sqlName,params,vars,null);
    }

    /**
     *
     * @param clazz 返回类型
     * @param sqlName sql 名
     * @param params 参数
     * @param <T> 返回类型
     * @return
     */
    public <T>List<T>  getList(Class clazz, String sqlName, Map params){

        return this.getPageList(clazz,sqlName,params,null,null);
    }


    /**
     * 自定义分页查询
     * @param clazz
     * @param sqlName
     * @param params
     * @param pager
     * @param <T>
     * @return
     */
    public  <T>List<T>  getPageList(Class clazz, String sqlName, Map params,Map vars, Pager pager){
        Sql sql = dao.sqls().create(sqlName);
        sql.setCallback(Sqls.callback.entities());
        sql.setEntity(dao.getEntity(clazz));
        if(params != null && params.size() > 0){
            sql.params().putAll(params);
        }

        if(vars != null && vars.size() > 0){
            sql.vars().putAll(vars);
        }

        if(pager != null){
            sql.setPager(pager);
        }

        dao.execute(sql);
        return sql.getList(clazz);
    }






    public <T> T getObject(Class<T> clazz,String sqlName){
        return this.getObject(clazz,sqlName,null);
    }


    public <T> T  getObject(Class<T> clazz,String sqlName, Map params){
        return getObject(clazz,sqlName,params,null);
    }


    public <T> T  getObject(Class<T> clazz,String sqlName, Map params,Map vars){
        Sql sql = dao.sqls().create(sqlName);
        sql.setCallback(Sqls.callback.entities());
        sql.setEntity(dao.getEntity(clazz));

        if(params != null){
            sql.params().putAll(params);
        }

        if(vars != null){
            sql.vars().putAll(vars);
        }

        dao.execute(sql);
        return sql.getObject(clazz);
    }


//    @PostConstruct
//    public void reg(){
//
//        String ip = pkGenConfig.getIp();
//
//        if(ip == null){
//
//            this.node = 1024;
//
//        }else{
//
//            SysIdWorkerEntity sysIdWorkerEntity = fetch(SysIdWorkerEntity.class, Cnd.where("ip","=",ip));
//
//            if(sysIdWorkerEntity != null){
//                this.node = sysIdWorkerEntity.getNode();
//            }else{
//                sysIdWorkerEntity = insertNewWorker();
//                this.node = sysIdWorkerEntity.getNode();
//            }
//
//        }
//
//
//        fireIdGenerator.setSnowflake(new Snowflake(this.node));
//
//        CustomMake.me().register(Const.ID_GEN_DEF, fireIdGenerator);
//
//
//
//
//
//
//    }
//
//
//
//
//    private SysIdWorkerEntity insertNewWorker(){
//        SysIdWorkerEntity oldWorker = getObject(SysIdWorkerEntity.class,"sys.fetchMaxNode");
//
//        SysIdWorkerEntity sysIdWorkerEntityNew = new SysIdWorkerEntity();
//        sysIdWorkerEntityNew.setCreateTime(Utils.currentTime());
//        sysIdWorkerEntityNew.setIp(pkGenConfig.getIp());
//        sysIdWorkerEntityNew.setNode(oldWorker==null?1:oldWorker.getNode()+1);
//
//        try {
//
//            fastInsert(sysIdWorkerEntityNew);
//            return sysIdWorkerEntityNew;
//
//        }catch (Exception e){
//            insertNewWorker();
//        }
//
//        return null;
//    }

//    @Autowired
//    public void setHikariDataSource(DataSource hikariDataSource) {
//        this.hikariDataSource = hikariDataSource;
//
//        SpringResourceLoaction springResourceLoaction = new SpringResourceLoaction();
//        springResourceLoaction.setApplicationContext(applicationContext);
//        Scans.me().addResourceLocation(springResourceLoaction);
//
//
//
//        setDataSource(hikariDataSource);
//    }


    @Autowired
    private ApplicationContext applicationContext;




//    @Autowired
//    public void setFileSqlManager() {
//        FileSqlManager fileSqlManager = new FileSqlManager("/sqls/");
//        setSqlManager(fileSqlManager);
//    }

//    @Override
//    public void run(ConnCallback callback) {
//        Connection con = DataSourceUtils.getConnection(hikariDataSource);
//        try {
//            callback.invoke(con);
//        } catch (Exception e) {
//            if (e instanceof RuntimeException)
//                throw (RuntimeException) e;
//            else
//                throw new RuntimeException(e);
//        } finally {
//            DataSourceUtils.releaseConnection(con, hikariDataSource);
//        }
//    }
}

报错信息如下:

Connected to the target VM, address: '127.0.0.1:51675', transport: 'socket'
17:25:37.686 [main] DEBUG org.springframework.core.env.StandardEnvironment - Adding [systemProperties] PropertySource with lowest search precedence
17:25:37.691 [main] DEBUG org.springframework.core.env.StandardEnvironment - Adding [systemEnvironment] PropertySource with lowest search precedence
17:25:37.693 [main] DEBUG org.springframework.core.env.StandardEnvironment - Initialized StandardEnvironment with PropertySources [systemProperties,systemEnvironment]
17:25:37.923 [main] DEBUG org.springframework.boot.devtools.settings.DevToolsSettings - Included patterns for restart : []
17:25:37.924 [main] DEBUG org.springframework.boot.devtools.settings.DevToolsSettings - Excluded patterns for restart : [/spring-boot-starter/target/classes/, /spring-boot-autoconfigure/target/classes/, /spring-boot-starter-[\w-]+/, /spring-boot/target/classes/, /spring-boot-actuator/target/classes/, /spring-boot-devtools/target/classes/]
17:25:37.924 [main] DEBUG org.springframework.boot.devtools.restart.ChangeableUrls - Matching URLs for reloading : [file:/Users/wangchao/java-work/update-api/target/classes/]
17:25:37.932 [restartedMain] DEBUG org.springframework.core.env.StandardEnvironment - Adding [systemProperties] PropertySource with lowest search precedence
17:25:37.932 [restartedMain] DEBUG org.springframework.core.env.StandardEnvironment - Adding [systemEnvironment] PropertySource with lowest search precedence
17:25:37.932 [restartedMain] DEBUG org.springframework.core.env.StandardEnvironment - Initialized StandardEnvironment with PropertySources [systemProperties,systemEnvironment]

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v1.5.6.RELEASE)

2019-04-29 17:25:38.725  INFO 73980 --- [  restartedMain] cn.guanfu.GuanfuAppServer                : Starting GuanfuAppServer on wangchaodeMacBook-Pro.local with PID 73980 (/Users/wangchao/java-work/update-api/target/classes started by wangchao in /Users/wangchao/java-work/update-api)
2019-04-29 17:25:38.727  INFO 73980 --- [  restartedMain] cn.guanfu.GuanfuAppServer                : The following profiles are active: pkgen,dev
2019-04-29 17:25:38.795  INFO 73980 --- [  restartedMain] ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@997963f: startup date [Mon Apr 29 17:25:38 CST 2019]; root of context hierarchy
2019-04-29 17:25:40.198  INFO 73980 --- [  restartedMain] o.s.b.f.s.DefaultListableBeanFactory     : Overriding bean definition for bean 'dao' with a different definition: replacing [Generic bean: class [cn.guanfu.common.db.GFDao]; scope=singleton; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in file [/Users/wangchao/java-work/update-api/target/classes/cn/guanfu/common/db/GFDao.class]] with [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=dataSourceConfig; factoryMethodName=dao; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [cn/guanfu/config/DataSourceConfig.class]]
2019-04-29 17:25:40.474  INFO 73980 --- [  restartedMain] o.s.b.f.s.DefaultListableBeanFactory     : Overriding bean definition for bean 'managementServletContext' with a different definition: replacing [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.boot.actuate.autoconfigure.EndpointWebMvcHypermediaManagementContextConfiguration; factoryMethodName=managementServletContext; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/boot/actuate/autoconfigure/EndpointWebMvcHypermediaManagementContextConfiguration.class]] with [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.boot.actuate.autoconfigure.EndpointWebMvcAutoConfiguration; factoryMethodName=managementServletContext; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/boot/actuate/autoconfigure/EndpointWebMvcAutoConfiguration.class]]
2019-04-29 17:25:40.515  INFO 73980 --- [  restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode!
2019-04-29 17:25:41.319  INFO 73980 --- [  restartedMain] trationDelegate$BeanPostProcessorChecker : Bean 'redisCacheConfig' of type [cn.guanfu.config.RedisCacheConfig$$EnhancerBySpringCGLIB$$c2ffd47b] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2019-04-29 17:25:41.402  INFO 73980 --- [  restartedMain] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.cache.annotation.ProxyCachingConfiguration' of type [org.springframework.cache.annotation.ProxyCachingConfiguration$$EnhancerBySpringCGLIB$$f9004ee0] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2019-04-29 17:25:41.737  INFO 73980 --- [  restartedMain] org.xnio                                 : XNIO version 3.3.8.Final
2019-04-29 17:25:41.753  INFO 73980 --- [  restartedMain] org.xnio.nio                             : XNIO NIO Implementation Version 3.3.8.Final
2019-04-29 17:25:41.856  WARN 73980 --- [  restartedMain] io.undertow.websockets.jsr               : UT026009: XNIO worker was not set on WebSocketDeploymentInfo, the default worker will be used
2019-04-29 17:25:41.857  WARN 73980 --- [  restartedMain] io.undertow.websockets.jsr               : UT026010: Buffer pool was not set on WebSocketDeploymentInfo, the default pool will be used
2019-04-29 17:25:41.880  INFO 73980 --- [  restartedMain] io.undertow.servlet                      : Initializing Spring embedded WebApplicationContext
2019-04-29 17:25:41.880  INFO 73980 --- [  restartedMain] o.s.web.context.ContextLoader            : Root WebApplicationContext: initialization completed in 3089 ms
2019-04-29 17:25:42.111  INFO 73980 --- [  restartedMain] o.s.b.w.servlet.ServletRegistrationBean  : Mapping servlet: 'dispatcherServlet' to [/]
2019-04-29 17:25:42.117  INFO 73980 --- [  restartedMain] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'metricsFilter' to: [/*]
2019-04-29 17:25:42.118  INFO 73980 --- [  restartedMain] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'characterEncodingFilter' to: [/*]
2019-04-29 17:25:42.118  INFO 73980 --- [  restartedMain] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
2019-04-29 17:25:42.118  INFO 73980 --- [  restartedMain] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'httpPutFormContentFilter' to: [/*]
2019-04-29 17:25:42.118  INFO 73980 --- [  restartedMain] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'requestContextFilter' to: [/*]
2019-04-29 17:25:42.119  INFO 73980 --- [  restartedMain] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'webRequestLoggingFilter' to: [/*]
2019-04-29 17:25:42.119  INFO 73980 --- [  restartedMain] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'applicationContextIdFilter' to: [/*]
2019-04-29 17:25:42.643 DEBUG 73980 --- [  restartedMain] org.nutz.dao.jdbc.Jdbcs                  : Jdbcs init complete
2019-04-29 17:25:42.643  INFO 73980 --- [  restartedMain] org.nutz.dao.jdbc.Jdbcs                  : Get Connection from DataSource for JdbcExpert, if you lock at here, check your database server and configure
2019-04-29 17:25:42.645  INFO 73980 --- [  restartedMain] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Starting...
2019-04-29 17:25:42.940  INFO 73980 --- [  restartedMain] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Start completed.
2019-04-29 17:25:42.946 DEBUG 73980 --- [  restartedMain] org.nutz.dao.impl.DaoSupport             : select expert : org.nutz.dao.impl.jdbc.mysql.MysqlJdbcExpert
2019-04-29 17:25:42.951 DEBUG 73980 --- [  restartedMain] org.nutz.dao.impl.DaoSupport             : JDBC Driver --> mysql-connector-java-5.1.43 ( Revision: 1d14b699eff3e6112aaedb1cbe5a151ab81f98f1 )
2019-04-29 17:25:42.951 DEBUG 73980 --- [  restartedMain] org.nutz.dao.impl.DaoSupport             : JDBC Name   --> MySQL Connector Java
2019-04-29 17:25:42.951 DEBUG 73980 --- [  restartedMain] org.nutz.dao.impl.DaoSupport             : JDBC URL    --> jdbc:mysql://10.0.0.254/gf-010060-3?useSSL=false
2019-04-29 17:25:42.960 DEBUG 73980 --- [  restartedMain] o.n.dao.impl.jdbc.mysql.MysqlJdbcExpert  : Mysql : character_set_client=utf8mb4
2019-04-29 17:25:42.960 DEBUG 73980 --- [  restartedMain] o.n.dao.impl.jdbc.mysql.MysqlJdbcExpert  : Mysql : character_set_connection=utf8mb4
2019-04-29 17:25:42.960 DEBUG 73980 --- [  restartedMain] o.n.dao.impl.jdbc.mysql.MysqlJdbcExpert  : Mysql : character_set_database=utf8mb4
2019-04-29 17:25:42.960 DEBUG 73980 --- [  restartedMain] o.n.dao.impl.jdbc.mysql.MysqlJdbcExpert  : Mysql : character_set_filesystem=binary
2019-04-29 17:25:42.960 DEBUG 73980 --- [  restartedMain] o.n.dao.impl.jdbc.mysql.MysqlJdbcExpert  : Mysql : character_set_results=
2019-04-29 17:25:42.960 DEBUG 73980 --- [  restartedMain] o.n.dao.impl.jdbc.mysql.MysqlJdbcExpert  : Mysql : character_set_server=utf8mb4
2019-04-29 17:25:42.961 DEBUG 73980 --- [  restartedMain] o.n.dao.impl.jdbc.mysql.MysqlJdbcExpert  : Mysql : character_set_system=utf8
2019-04-29 17:25:42.961 DEBUG 73980 --- [  restartedMain] o.n.dao.impl.jdbc.mysql.MysqlJdbcExpert  : Mysql : character_sets_dir=/usr/local/mysql/share/charsets/
2019-04-29 17:25:42.963 DEBUG 73980 --- [  restartedMain] o.n.dao.impl.jdbc.mysql.MysqlJdbcExpert  : Mysql : binlog_format=MIXED
2019-04-29 17:25:42.964 DEBUG 73980 --- [  restartedMain] o.n.dao.impl.jdbc.mysql.MysqlJdbcExpert  : Mysql : database=gf-010060-3
2019-04-29 17:25:42.966 DEBUG 73980 --- [  restartedMain] o.n.dao.impl.jdbc.mysql.MysqlJdbcExpert  : Mysql : user=root@10.0.0.113
2019-04-29 17:25:42.981 DEBUG 73980 --- [  restartedMain] org.nutz.dao.impl.DaoSupport             : Database info --> MYSQL:[MySQL - 5.7.22-log]
2019-04-29 17:25:43.791  WARN 73980 --- [  restartedMain] ationConfigEmbeddedWebApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'systemController': Unsatisfied dependency expressed through field 'gfDao'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'cn.guanfu.common.db.GFDao' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
2019-04-29 17:25:43.792  INFO 73980 --- [  restartedMain] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Shutdown initiated...
2019-04-29 17:25:43.817  INFO 73980 --- [  restartedMain] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Shutdown completed.
2019-04-29 17:25:43.849  INFO 73980 --- [  restartedMain] utoConfigurationReportLoggingInitializer : 

Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled.
2019-04-29 17:25:44.010 ERROR 73980 --- [  restartedMain] o.s.b.d.LoggingFailureAnalysisReporter   : 

***************************
APPLICATION FAILED TO START
***************************

Description:

Field gfDao in cn.guanfu.controller.SystemController required a bean of type 'cn.guanfu.common.db.GFDao' that could not be found.


Action:

Consider defining a bean of type 'cn.guanfu.common.db.GFDao' in your configuration.

Disconnected from the target VM, address: '127.0.0.1:51675', transport: 'socket'

Process finished with exit code 1

请@wendal帮忙看看我该怎么配置下。。。

package cn.guanfu.config;
package cn.guanfu.common.db;

报个是spring注入问题, 扫描spring bean的配置没配好?

嗯,是报这里的,不过我只是升级了nutz版本,其他的地方需要修改吗?

cn.guanfu.config下的文件:

package cn.guanfu.common.db;

import cn.guanfu.common.utils.Utils;
import cn.guanfu.config.PkGenConfig;
import com.relops.snowflake.Snowflake;
import org.nutz.conf.NutConf;
import cn.guanfu.common.constants.Const;
import cn.guanfu.common.generator.FireIdGenerator;

import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
import org.nutz.dao.Sqls;
import org.nutz.dao.impl.FileSqlManager;
import org.nutz.dao.impl.NutDao;
import org.nutz.dao.pager.Pager;
import org.nutz.dao.sql.Sql;
import org.nutz.el.opt.custom.CustomMake;
import org.nutz.integration.spring.SpringResourceLoaction;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.resource.NutResource;
import org.nutz.resource.Scans;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.annotation.Order;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
import org.springframework.core.io.ResourceLoader;
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
import org.springframework.stereotype.Repository;

import javax.annotation.PostConstruct;
import javax.sql.DataSource;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;


@SuppressWarnings("SpringJavaAutowiringInspection")
@Configuration
@Repository("dao")
@Order(3)
public class GFDao{

//    @Autowired
//    private PKGenerator pkGenerator;

    private Dao dao;

    @Autowired
    private FireIdGenerator fireIdGenerator;

    @Autowired
    private PkGenConfig pkGenConfig;

    private DataSource hikariDataSource;

    private Integer node;

    private FileSqlManager fileSqlManager;

//    private static final String[] SQLS = {
//            "user.sql",
//            "module.sql",
//            "system.sql",
//            "article.sql"
//    };



    /**
     * 查全部
     * @param clazz
     * @param sqlName
     * @param <T>
     * @return
     */
    public  <T>List<T>  getList(Class clazz,String sqlName){
        return this.getList(clazz,sqlName,null);
    }

    /**
     * 通过页码查询
     * @param clazz
     * @param sqlName
     * @param pageNumber
     * @param <T>
     * @return
     */
    public  <T>List<T>  getList(Class clazz,String sqlName,int pageNumber){
        return this.getList(clazz,sqlName,null,null,pageNumber);
    }

    /**
     * 通过参数查询
     * @param clazz
     * @param sqlName
     * @param params
     * @param pageNumber
     * @param <T>
     * @return
     */
    public  <T>List<T>  getList(Class clazz, String sqlName, Map params,Map vars, Integer pageNumber){
        Pager pager = null;
        if(pageNumber != null){
            pager  = new Pager();
            pager.setPageNumber(pageNumber);
            pager.setPageSize(15);
        }
        return this.getPageList(clazz,sqlName,params,vars,pager);
    }

    public  <T>List<T>  getList(Class clazz, String sqlName, Map params,Map vars){

        return this.getPageList(clazz,sqlName,params,vars,null);
    }

    /**
     *
     * @param clazz 返回类型
     * @param sqlName sql 名
     * @param params 参数
     * @param <T> 返回类型
     * @return
     */
    public <T>List<T>  getList(Class clazz, String sqlName, Map params){

        return this.getPageList(clazz,sqlName,params,null,null);
    }


    /**
     * 自定义分页查询
     * @param clazz
     * @param sqlName
     * @param params
     * @param pager
     * @param <T>
     * @return
     */
    public  <T>List<T>  getPageList(Class clazz, String sqlName, Map params,Map vars, Pager pager){
        Sql sql = dao.sqls().create(sqlName);
        sql.setCallback(Sqls.callback.entities());
        sql.setEntity(dao.getEntity(clazz));
        if(params != null && params.size() > 0){
            sql.params().putAll(params);
        }

        if(vars != null && vars.size() > 0){
            sql.vars().putAll(vars);
        }

        if(pager != null){
            sql.setPager(pager);
        }

        dao.execute(sql);
        return sql.getList(clazz);
    }






    public <T> T getObject(Class<T> clazz,String sqlName){
        return this.getObject(clazz,sqlName,null);
    }


    public <T> T  getObject(Class<T> clazz,String sqlName, Map params){
        return getObject(clazz,sqlName,params,null);
    }


    public <T> T  getObject(Class<T> clazz,String sqlName, Map params,Map vars){
        Sql sql = dao.sqls().create(sqlName);
        sql.setCallback(Sqls.callback.entities());
        sql.setEntity(dao.getEntity(clazz));

        if(params != null){
            sql.params().putAll(params);
        }

        if(vars != null){
            sql.vars().putAll(vars);
        }

        dao.execute(sql);
        return sql.getObject(clazz);
    }


//    @PostConstruct
//    public void reg(){
//
//        String ip = pkGenConfig.getIp();
//
//        if(ip == null){
//
//            this.node = 1024;
//
//        }else{
//
//            SysIdWorkerEntity sysIdWorkerEntity = fetch(SysIdWorkerEntity.class, Cnd.where("ip","=",ip));
//
//            if(sysIdWorkerEntity != null){
//                this.node = sysIdWorkerEntity.getNode();
//            }else{
//                sysIdWorkerEntity = insertNewWorker();
//                this.node = sysIdWorkerEntity.getNode();
//            }
//
//        }
//
//
//        fireIdGenerator.setSnowflake(new Snowflake(this.node));
//
//        CustomMake.me().register(Const.ID_GEN_DEF, fireIdGenerator);
//
//
//
//
//
//
//    }
//
//
//
//
//    private SysIdWorkerEntity insertNewWorker(){
//        SysIdWorkerEntity oldWorker = getObject(SysIdWorkerEntity.class,"sys.fetchMaxNode");
//
//        SysIdWorkerEntity sysIdWorkerEntityNew = new SysIdWorkerEntity();
//        sysIdWorkerEntityNew.setCreateTime(Utils.currentTime());
//        sysIdWorkerEntityNew.setIp(pkGenConfig.getIp());
//        sysIdWorkerEntityNew.setNode(oldWorker==null?1:oldWorker.getNode()+1);
//
//        try {
//
//            fastInsert(sysIdWorkerEntityNew);
//            return sysIdWorkerEntityNew;
//
//        }catch (Exception e){
//            insertNewWorker();
//        }
//
//        return null;
//    }

//    @Autowired
//    public void setHikariDataSource(DataSource hikariDataSource) {
//        this.hikariDataSource = hikariDataSource;
//
//        SpringResourceLoaction springResourceLoaction = new SpringResourceLoaction();
//        springResourceLoaction.setApplicationContext(applicationContext);
//        Scans.me().addResourceLocation(springResourceLoaction);
//
//
//
//        setDataSource(hikariDataSource);
//    }


    @Autowired
    private ApplicationContext applicationContext;




//    @Autowired
//    public void setFileSqlManager() {
//        FileSqlManager fileSqlManager = new FileSqlManager("/sqls/");
//        setSqlManager(fileSqlManager);
//    }

//    @Override
//    public void run(ConnCallback callback) {
//        Connection con = DataSourceUtils.getConnection(hikariDataSource);
//        try {
//            callback.invoke(con);
//        } catch (Exception e) {
//            if (e instanceof RuntimeException)
//                throw (RuntimeException) e;
//            else
//                throw new RuntimeException(e);
//        } finally {
//            DataSourceUtils.releaseConnection(con, hikariDataSource);
//        }
//    }
}

cn.guanfu.common.db文件如下:

package cn.guanfu.config;


import com.zaxxer.hikari.HikariDataSource;
import org.nutz.dao.impl.NutDao;
import org.nutz.integration.spring.SpringResourceLoaction;
import org.nutz.resource.Scans;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import org.springframework.core.annotation.Order;

import javax.sql.DataSource;


@Configuration
@EnableAutoConfiguration
@ConfigurationProperties(prefix = "spring.datasource")
@Order(2)
public class DataSourceConfig {

    private String username;

    private String password;

    private String url;

    private String driverClassName;

    private String connectionTestQuery;

    private int maximumPoolSize;

    @Autowired
    private PkGenConfig pkGenConfig;


    @Autowired
    private ApplicationContext applicationContext;

    @Bean
    @Primary
    public DataSource primaryDataSource() {

        final HikariDataSource ds = new HikariDataSource();

        ds.setDriverClassName(driverClassName);
        ds.setJdbcUrl(url);
        ds.setUsername(username);
        ds.setPassword(password);
        ds.setMaximumPoolSize(maximumPoolSize==0?200:maximumPoolSize);
        ds.setPoolName(pkGenConfig.getIp());
        ds.setConnectionTestQuery(connectionTestQuery);
        return ds;
    }

    @Bean
    public NutDao dao(){
        NutDao nutDao = new NutDao();
        nutDao.setDataSource(primaryDataSource());
        return nutDao;

    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getDriverClassName() {
        return driverClassName;
    }

    public void setDriverClassName(String driverClassName) {
        this.driverClassName = driverClassName;
    }

    public String getConnectionTestQuery() {
        return connectionTestQuery;
    }

    public void setConnectionTestQuery(String connectionTestQuery) {
        this.connectionTestQuery = connectionTestQuery;
    }

    public int getMaximumPoolSize() {
        return maximumPoolSize;
    }

    public void setMaximumPoolSize(int maximumPoolSize) {
        this.maximumPoolSize = maximumPoolSize;
    }

    public ApplicationContext getApplicationContext() {
        return applicationContext;
    }

    public void setApplicationContext(ApplicationContext applicationContext) {
        this.applicationContext = applicationContext;
    }
}

请@wendal帮忙看看我这里配置是否需要修改下

添加回复
请先登陆
回到顶部