lyon91

 

一、项目本地可以运行,A 服务器可以运行 换到B不行

启动不了,不输出日志。后来发现是项目配置了日志输出文件,但是目录没有设置权限

 

二、微服务jpa 数据save不执行,发现是包扫描问题

/**
 * 主数据源配置类
 */
@Configuration
@EnableJpaRepositories(value = Constants.PROJECT_BASE_PACKAGE + ".repository.master",
    repositoryBaseClass = JpaRepositoryImpl.class)
//@EnableJpaAuditing(auditorAwareRef = "springSecurityAuditorAware")
@EnableTransactionManagement
public class DatabaseConfiguration {


    @Bean(name = "entityManagerFactory")
    public LocalContainerEntityManagerFactoryBean entityManagerFactory(EntityManagerFactoryBuilder builder) {
        DataSource dataSource = primaryDataSource();
        return builder
            .dataSource(dataSource)
            .properties(getVendorProperties(dataSource))
            .packages(Constants.PROJECT_BASE_PACKAGE + ".domain.master")
            .persistenceUnit("secondaryPersistenceUnit")
            .build();
    }

如果是要扫描多个目录,配置数组形式 {"", ""}

 

分类:

技术点:

相关文章:

  • 2021-05-30
  • 2021-12-20
  • 2022-01-04
  • 2021-05-06
  • 2021-09-17
  • 2021-10-08
  • 2021-12-23
猜你喜欢
  • 2021-11-24
  • 2021-12-13
  • 2021-10-25
  • 2021-12-04
  • 2021-11-15
  • 2021-12-16
  • 2021-04-11
相关资源
相似解决方案