spring - Spring - 不是托管类型:类
问题描述
所以,我在我的应用程序中使用 3 个不同的数据源。最初有 2 个,但由于一些项目更改,我不得不添加另一个。创建模型、存储库、配置这个新数据源的类后,我无法启动我的应用程序。它给出了以下错误:
...
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'requestMappingHandlerMapping' defined in class path resource [org/springframework/boot/autoconfigure/web/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping]: Factory method 'requestMappingHandlerMapping' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mvcConversionService' defined in class path resource [org/springframework/boot/autoconfigure/web/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.format.support.FormattingConversionService]: Factory method 'mvcConversionService' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transacaoRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Not a managed type: class br.com.brb.maf.pix.transacao.model.Transacao
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:599)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1178)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1072)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:511)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:481)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:312)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:308)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:208)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.addCandidateEntry(DefaultListableBeanFactory.java:1314)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1280)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveMultipleBeans(DefaultListableBeanFactory.java:1178)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1094)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1064)
at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:835)
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:741)
... 36 common frames omitted
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping]: Factory method 'requestMappingHandlerMapping' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mvcConversionService' defined in class path resource [org/springframework/boot/autoconfigure/web/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.format.support.FormattingConversionService]: Factory method 'mvcConversionService' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transacaoRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Not a managed type: class br.com.brb.maf.pix.transacao.model.Transacao
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:189)
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588)
... 52 common frames omitted
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mvcConversionService' defined in class path resource [org/springframework/boot/autoconfigure/web/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.format.support.FormattingConversionService]: Factory method 'mvcConversionService' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transacaoRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Not a managed type: class br.com.brb.maf.pix.transacao.model.Transacao
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:599)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1178)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1072)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:511)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:481)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:312)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:308)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.obtainBeanInstanceFromFactory(ConfigurationClassEnhancer.java:389)
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:361)
at org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration$EnableWebMvcConfiguration$$EnhancerBySpringCGLIB$$ef1e37c8.mvcConversionService(<generated>)
at org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport.getInterceptors(WebMvcConfigurationSupport.java:307)
at org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport.requestMappingHandlerMapping(WebMvcConfigurationSupport.java:258)
at org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration$EnableWebMvcConfiguration.requestMappingHandlerMapping(WebMvcAutoConfiguration.java:403)
at org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration$EnableWebMvcConfiguration$$EnhancerBySpringCGLIB$$ef1e37c8.CGLIB$requestMappingHandlerMapping$6(<generated>)
at org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration$EnableWebMvcConfiguration$$EnhancerBySpringCGLIB$$ef1e37c8$$FastClassBySpringCGLIB$$bc131863.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:358)
at org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration$EnableWebMvcConfiguration$$EnhancerBySpringCGLIB$$ef1e37c8.requestMappingHandlerMapping(<generated>)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162)
... 53 common frames omitted
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.format.support.FormattingConversionService]: Factory method 'mvcConversionService' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transacaoRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Not a managed type: class br.com.brb.maf.pix.transacao.model.Transacao
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:189)
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588)
... 77 common frames omitted
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transacaoRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Not a managed type: class br.com.brb.maf.pix.transacao.model.Transacao
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1631)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:481)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:312)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:308)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1086)
at org.springframework.data.repository.support.Repositories.cacheRepositoryFactory(Repositories.java:96)
at org.springframework.data.repository.support.Repositories.populateRepositoryFactoryInformation(Repositories.java:89)
at org.springframework.data.repository.support.Repositories.<init>(Repositories.java:82)
at org.springframework.data.repository.support.DomainClassConverter.setApplicationContext(DomainClassConverter.java:98)
at org.springframework.data.web.config.SpringDataWebConfiguration.addFormatters(SpringDataWebConfiguration.java:96)
at org.springframework.web.servlet.config.annotation.WebMvcConfigurerComposite.addFormatters(WebMvcConfigurerComposite.java:80)
at org.springframework.web.servlet.config.annotation.DelegatingWebMvcConfiguration.addFormatters(DelegatingWebMvcConfiguration.java:77)
at org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport.mvcConversionService(WebMvcConfigurationSupport.java:600)
at org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration$EnableWebMvcConfiguration$$EnhancerBySpringCGLIB$$ef1e37c8.CGLIB$mvcConversionService$35(<generated>)
at org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration$EnableWebMvcConfiguration$$EnhancerBySpringCGLIB$$ef1e37c8$$FastClassBySpringCGLIB$$bc131863.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:358)
at org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration$EnableWebMvcConfiguration$$EnhancerBySpringCGLIB$$ef1e37c8.mvcConversionService(<generated>)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162)
... 78 common frames omitted
Caused by: java.lang.IllegalArgumentException: Not a managed type: class br.com.brb.maf.pix.transacao.model.Transacao
at org.hibernate.jpa.internal.metamodel.MetamodelImpl.managedType(MetamodelImpl.java:210)
at org.springframework.data.jpa.repository.support.JpaMetamodelEntityInformation.<init>(JpaMetamodelEntityInformation.java:71)
at org.springframework.data.jpa.repository.support.JpaEntityInformationSupport.getEntityInformation(JpaEntityInformationSupport.java:68)
at org.springframework.data.jpa.repository.support.JpaRepositoryFactory.getEntityInformation(JpaRepositoryFactory.java:184)
at org.springframework.data.jpa.repository.support.JpaRepositoryFactory.getTargetRepository(JpaRepositoryFactory.java:117)
at org.springframework.data.jpa.repository.support.JpaRepositoryFactory.getTargetRepository(JpaRepositoryFactory.java:99)
at org.springframework.data.repository.core.support.RepositoryFactorySupport.getRepository(RepositoryFactorySupport.java:198)
at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.initAndReturn(RepositoryFactoryBeanSupport.java:277)
at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.afterPropertiesSet(RepositoryFactoryBeanSupport.java:263)
at org.springframework.data.jpa.repository.support.JpaRepositoryFactoryBean.afterPropertiesSet(JpaRepositoryFactoryBean.java:101)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1689)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1627)
... 103 common frames omitted
问题是,我正在做与我的第二个数据源(不是@Primary 的那个)相同的配置,它工作正常。所以我不知道是什么导致了这个错误。我已经尝试使用我在 stackoverflow 上找到的一些技巧,例如使用 EntityScan 或 ComponentScan 等。这是我的课程:
Transacao.java
package br.com.brb.maf.pix.transacao.model;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import javax.persistence.Column;
import javax.persistence.Convert;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import org.hibernate.annotations.Immutable;
import org.springframework.data.jpa.convert.threeten.Jsr310JpaConverters.LocalDateTimeConverter;
import br.com.brb.framework.core.entity.AbstractEntity;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Immutable
@Entity
@Table(name = "VW_TRANSACAO_PAGAMENTO_MAF", schema = "GPI")
public class Transacao extends AbstractEntity<Long> {
private static final long serialVersionUID = 2695172871355012963L;
@Id
@Column(name = "SQ_TRANSACAO_PAGAMENTO")
private Long id;
@Column(name = "SQ_MENSAGEM")
private Long mensagemPagamento;
@Column(name = "CD_IDENT_EVENTO")
private String transactionId;
@Column(name = "VL_MENSAGEM")
private BigDecimal valorTransacao;
@Column(name = "DT_RECEBIMENTO_ORDEM")
@Convert(converter = LocalDateTimeConverter.class)
private LocalDateTime dataRecebimento;
@Column(name = "CD_CPF_CNPJ_RECEBEDOR")
private String cpfRecebedor;
@Column(name = "CD_CPF_CNPJ_PAGADOR")
private String cpfPagador;
@Column(name = "CD_ISPB_PAGADOR")
private String ispbPagador;
@Column(name = "CD_ISPB_RECEBEDOR")
private String ispbRecebedor;
@Column(name = "CD_CHAVE_ENDERECAMENTO")
private String chaveEnderecamento;
@Column(name = "CD_CONCILIACAO")
private String codConciliacao;
@Column(name = "NO_PAGADOR")
private String nomePagador;
@Column(name = "NR_AGENCIA_PAGADOR")
private Long agenciaPagador;
@Column(name = "NR_CONTA_PAGADOR")
private Long contaPagador;
@Column(name = "NO_RECEBEDOR")
private String nomeRecebedor;
@Column(name = "NR_AGENCIA_RECEBEDOR")
private Long agenciaRecebedor;
@Column(name = "NR_CONTA_RECEBEDOR")
private Long contaRecebedor;
@Column(name = "DS_IDENTIFICADOR")
private String identificador;
@Column(name = "CD_FORMA_PAGAMENTO")
private String codFormaPagamento;
@Column(name = "SQ_RETORNO_PAGAMENTO")
private String codRetornoPagamento;
@Column(name = "SQ_MENSAGEM_RETORNO_PAGAMENTO")
private Long mensagemRetornoPagamento;
@Column(name = "CD_IDENT_ORIGINAL")
private String transactionIdOriginal;
@Column(name = "CD_STATUS_RETORNO_PAGAMENTO")
private String statusRetornoPagamentoString;
@Column(name = "DT_LIQUIDACAO")
@Convert(converter = LocalDateTimeConverter.class)
private LocalDateTime dataLiquidacao;
@Column(name = "DT_CONTABIL")
@Convert(converter = LocalDateTimeConverter.class)
private LocalDateTime dataContabil;
@Column(name = "SQ_DEVOLUCAO_PAGAMENTO")
private Long codDevolucaoPagamento;
}
TransacaoRepository.java
package br.com.brb.maf.pix.transacao.repository;
import br.com.brb.framework.core.domain.repository.BaseRepository;
import br.com.brb.maf.pix.transacao.model.Transacao;
public interface TransacaoRepository extends BaseRepository<Transacao, Long> {
}
MAFApplication.java
package br.com.brb.maf;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.support.SpringBootServletInitializer;
@SpringBootApplication
public class MAFApplication extends SpringBootServletInitializer {
private static final String PROFILE_WEBLOGIC = "weblogic";
private static final String PROFILE_DEFAULT = "default";
public static void main(String... args) {
SpringApplication.run(MAFApplication.class, args);
}
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
application.profiles(PROFILE_DEFAULT, PROFILE_WEBLOGIC);
return application.sources(MAFApplication.class);
}
}
GpiDatabaseConfigurationStandalone.java
package br.com.brb.maf.config;
import java.util.Properties;
import javax.sql.DataSource;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.autoconfigure.jdbc.DataSourceBuilder;
import org.springframework.boot.bind.RelaxedPropertyResolver;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.EnvironmentAware;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
import org.springframework.core.env.Environment;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.orm.jpa.JpaVendorAdapter;
import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean;
import org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter;
import org.springframework.transaction.annotation.EnableTransactionManagement;
@Configuration
@EnableTransactionManagement
@EnableJpaRepositories(basePackages = { "br.com.brb.maf.pix.transacao.repository" })
@Profile("autoContido")
public class GpiDatabaseConfigurationStandalone implements EnvironmentAware {
private static final String SPRING_DATASOURCE = "spring.datasource.";
private static final String SPRING_JPA_PROPERTIES = "spring.jpa.properties.";
private static final String VALIDATE = "validate";
private static final String HIBERNATE_FORMAT_SQL = "hibernate.format_sql";
private static final String HIBERNATE_SHOW_SQL = "hibernate.show_sql";
private static final String HIBERNATE_DIALECT = "hibernate.dialect";
private static final String HIBERNATE_HBM2DDL_AUTO = "hibernate.hbm2ddl.auto";
private static final String HIBERNATE_DEFAULT_SCHEMA = "hibernate.default_schema";
private RelaxedPropertyResolver jpaPropertyResolver;
@Override
public void setEnvironment(Environment environment) {
this.jpaPropertyResolver = new RelaxedPropertyResolver(environment, SPRING_JPA_PROPERTIES);
new RelaxedPropertyResolver(environment, SPRING_DATASOURCE);
}
@Bean(name = "gpiDataSource")
@ConfigurationProperties(prefix = "spring.datasource.gpi")
public DataSource dataSource() {
return DataSourceBuilder.create().build();
}
@Bean(name = "gpiEntityManagerFactory")
public LocalContainerEntityManagerFactoryBean entityManagerFactory(
@Qualifier("gpiDataSource") DataSource dataSource) {
LocalContainerEntityManagerFactoryBean em = new LocalContainerEntityManagerFactoryBean();
em.setDataSource(dataSource);
JpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter();
em.setJpaVendorAdapter(vendorAdapter);
em.setJpaProperties(additionalProperties());
em.setPackagesToScan(new String[] {"br.com.brb.maf.pix.transacao.model"});
return em;
}
Properties additionalProperties() {
Properties properties = new Properties();
properties.setProperty(HIBERNATE_HBM2DDL_AUTO,
jpaPropertyResolver.getProperty(HIBERNATE_HBM2DDL_AUTO, VALIDATE));
properties.setProperty(HIBERNATE_DIALECT, jpaPropertyResolver.getProperty(HIBERNATE_DIALECT));
properties.setProperty(HIBERNATE_DEFAULT_SCHEMA, jpaPropertyResolver.getProperty(HIBERNATE_DEFAULT_SCHEMA));
properties.setProperty(HIBERNATE_SHOW_SQL,
jpaPropertyResolver.getProperty(HIBERNATE_SHOW_SQL, Boolean.FALSE.toString()));
properties.setProperty(HIBERNATE_FORMAT_SQL,
jpaPropertyResolver.getProperty(HIBERNATE_FORMAT_SQL, Boolean.FALSE.toString()));
return properties;
}
}
应用程序.yml
server:
contextPath: /fraude
port: 8250
spring:
profiles: default
application:
name: MAF
messages:
basename: i18n/messages, i18n/messagesWebRest
batch:
job:
enabled: false
jpa:
open-in-view: false
generate-ddl: false
properties:
hibernate:
format_sql: false
show_sql: false
dialect: org.hibernate.dialect.Oracle10gDialect
default_schema: MAF
hbm2ddl:
auto: " "
cache:
cache-names: folha
endpoints:
health:
sensitive: true
shutdown:
enabled: false
applicationProperties:
mail:
from: noreply@brb.com.br
cors:
allowed-origins: '*'
allowed-methods: GET, PUT, POST, DELETE, OPTIONS
allowed-headers: Authorization,content-type
exposed-headers: X-Total-Count, X-Validation-Error
max-age: 1800
swagger:
title: API da aplicação MAF
description: Documentacao da API da aplicação MAF
version: 1.0.0
termsOfServiceUrl: null
contact: servnuext@brb.com.br
license: null
licenseUrl: null
springfox:
documentation:
swagger:
v2:
path: /api-docs
sga:
sistema:
sigla: MAF
dominio: brb.com.br
trancodes:
- name: LOGIN
code: 1001
- name: LOGOFF
code: 1002
hosts: DAP340218
ports: 3030
timeout: 50000
limiteMaxCon: 10
timeoutPool: 15000
mantemConexao: true
authorization:
activeDirectoryDomain: brb.com.br
activeDirectoryUrl: ldap://brb.com.br
timeout:
refreshToken: 39600
token: 36000
---
spring:
profiles: weblogic
mail:
jndi-name: mail/BRB
datasource:
maf:
jndi-name: java/MAFDS
mobile:
jndi-name: java/MBKDS
gpi:
jndi-name: java/GPIDS
cache:
jcache:
provider: com.tangosol.coherence.jcache.CoherenceBasedCachingProvider
---
spring:
profiles: autoContido
mail:
host: localhost
port: 25
datasource:
maf:
url: jdbc:oracle:thin:@DBD340207.brb.com.br:1521/dep1d.brb.com.br
username: u840280
password: ENC(V39VJLxZy7PSsgkojKCsR7QUNEaYp4LB)
driver-class-name: oracle.jdbc.OracleDriver
max-active: 2
max-idle: 1
test-on-borrow: true
validation-query: select 1 from dual
initial-size: 1
mobile:
url: jdbc:oracle:thin:@HBD340207.brb.com.br:1521/mcn1h.brb.com.br
username: u840280
password: ENC(V39VJLxZy7PSsgkojKCsR7QUNEaYp4LB)
driver-class-name: oracle.jdbc.OracleDriver
max-active: 2
max-idle: 1
test-on-borrow: true
validation-query: select 1 from dual
initial-size: 1
gpi:
url: jdbc:oracle:thin:@HBD340207.brb.com.br:1521/spb1h.brb.com.br
username: u840280
password: ENC(V39VJLxZy7PSsgkojKCsR7QUNEaYp4LB)
driver-class-name: oracle.jdbc.OracleDriver
max-active: 2
max-idle: 1
test-on-borrow: true
validation-query: select 1 from dual
initial-size: 1
---
mensagem:
url: https://fcm.googleapis.com/fcm/send
chave: AIzaSyDe7Zygu8P94nDPVRABS9Y7CU1Kg6D2pyI
color: navy
sound: default
icon: notification_icon
contentAvailable: 1
priority: high
config-proxy:
proxy: webproxy.brb.com.br
porta: 8080
usuario: s_vcbrb
senha: V1c2b3r4b5
---
spring:
profiles: h2local
jpa:
hibernate:
hbm2ddl:
auto: create-drop
datasource:
driverClassName: org.h2.Driver
url: jdbc:h2:mem:test;MODE=Oracle
---
configConstants:
dir: /opt/MAF
有人能告诉我这个吗?
解决方案
原来我必须在配置类中添加entityManagerFactoryRef
注释@EnableJpaRepositories
:
@Configuration
@EnableTransactionManagement
@EnableJpaRepositories(
basePackages = { "br.com.brb.maf.pix.transacao.repository" },
entityManagerFactoryRef = "gpiEntityManagerFactory")
@Profile("autoContido")
推荐阅读
- python - 在程序启动时从 Python 初始化 Kivy 小部件值
- java - 使用接口或超类作为数据类型来实例化子类
- amazon-web-services - 未捕获的异常“Predis\Response\ServerException”,消息为“MOVED 7369”
- r - 使用 eclat 挖掘频繁项集时的“零频繁项”
- angular - JHipster 4.14.1:输入类型="datetime-local" 未绑定
- javascript - 重置应用于日历单元格的 css 类
- python - 如何从python中的docker容器获取文件
- javascript - 在调整大小时将图像高度应用于 Div
- python - 如何从另一个文件设置另一个文件上的字典的值?
- vba - 如何使用 vba 脚本检查 MS Word 页边距?