I'm using Spring Boot 1.3.5 and spring-yarn-boot 2.3.0 and are plying around with https://github.com/spring-guides/gs-yarn-basic.git The problem I have is configuring resourceManagerHost and resources for the YarnContainer. In the YarnClient and YarnAppMaster the default values are overridden as expected.
The container application have the following application.yml:
spring:
profiles: dev
hadoop:
fsUri: hdfs://dev
resourceManagerHost: rm.dev.com
resources:
- "file:///etc/hadoop/conf/core-site.xml"
- "file:///etc/hadoop/conf/hdfs-site.xml"
- "file:///etc/hadoop/conf/yarn-site.xml"
yarn:
appName: gs-yarn-basic
applicationDir: /app/gs-yarn-basic/
debug: true
The last line below shows that fs.defaultFS is overridden correctly but yarn.resourcemanager.address is set to 0.0.0.0:8032 and "Configuration:" is set to the default xml configuration files.
[2016-06-09 16:47:14.397] boot - 35635 INFO [main] --- ContainerApplication: The following profiles are active: dev
[2016-06-09 16:47:14.397] boot - 35635 DEBUG [main] --- SpringApplication: Loading source class hello.container.ContainerApplication
[2016-06-09 16:47:14.450] boot - 35635 DEBUG [main] --- ConfigFileApplicationListener: Activated profiles dev
[2016-06-09 16:47:14.450] boot - 35635 DEBUG [main] --- ConfigFileApplicationListener: Skipped (empty) config file 'classpath:/application.yml'
[2016-06-09 16:47:14.450] boot - 35635 DEBUG [main] --- ConfigFileApplicationListener: Loaded config file 'classpath:/application.yml' for profile dev
[2016-06-09 16:47:14.455] boot - 35635 INFO [main] --- AnnotationConfigApplicationContext: Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext#b51cdbd: startup date [Thu Jun 09 16:47:14 CEST 2016]; root of context hierarchy
[2016-06-09 16:47:16.299] boot - 35635 INFO [main] --- ConfiguringBeanFactoryPostProcessor: No bean named 'taskScheduler' has been explicitly defined. Therefore, a default ThreadPoolTaskScheduler will be created.
[2016-06-09 16:47:16.303] boot - 35635 INFO [main] --- ConfiguringBeanFactoryPostProcessor: No bean named 'taskExecutor' has been explicitly defined. Therefore, a default SyncTaskExecutor will be created.
[2016-06-09 16:47:16.311] boot - 35635 INFO [main] --- AutowiredAnnotationBeanPostProcessor: JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
[2016-06-09 16:47:16.461] boot - 35635 INFO [main] --- PostProcessorRegistrationDelegate$BeanPostProcessorChecker: Bean 'org.springframework.data.hadoop.config.common.annotation.configuration.ObjectPostProcessorConfiguration' of type [class org.springframework.data.hadoop.config.common.annotation.configuration.ObjectPostProcessorConfiguration$$EnhancerBySpringCGLIB$$c2374003] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
[2016-06-09 16:47:16.474] boot - 35635 INFO [main] --- PostProcessorRegistrationDelegate$BeanPostProcessorChecker: Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [class org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$ca001d27] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
[2016-06-09 16:47:16.543] boot - 35635 INFO [main] --- PostProcessorRegistrationDelegate$BeanPostProcessorChecker: Bean 'yarnObjectPostProcessor' of type [class org.springframework.data.hadoop.config.common.annotation.configuration.AutowireBeanFactoryObjectPostProcessor] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
[2016-06-09 16:47:16.569] boot - 35635 INFO [main] --- PostProcessorRegistrationDelegate$BeanPostProcessorChecker: Bean 'org.springframework.yarn.boot.properties.SpringYarnEnvProperties' of type [class org.springframework.yarn.boot.properties.SpringYarnEnvProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
[2016-06-09 16:47:16.584] boot - 35635 INFO [main] --- PostProcessorRegistrationDelegate$BeanPostProcessorChecker: Bean 'spring.yarn.CONFIGURATION_PROPERTIES' of type [class org.springframework.yarn.boot.properties.SpringYarnProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
[2016-06-09 16:47:16.610] boot - 35635 INFO [main] --- PostProcessorRegistrationDelegate$BeanPostProcessorChecker: Bean 'spring.hadoop.CONFIGURATION_PROPERTIES' of type [class org.springframework.yarn.boot.properties.SpringHadoopProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
[2016-06-09 16:47:16.619] boot - 35635 INFO [main] --- PostProcessorRegistrationDelegate$BeanPostProcessorChecker: Bean 'spring.yarn.container.CONFIGURATION_PROPERTIES' of type [class org.springframework.yarn.boot.properties.SpringYarnContainerProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
[2016-06-09 16:47:16.663] boot - 35635 INFO [main] --- PostProcessorRegistrationDelegate$BeanPostProcessorChecker: Bean 'org.springframework.yarn.boot.YarnContainerAutoConfiguration$SpringYarnConfig' of type [class org.springframework.yarn.boot.YarnContainerAutoConfiguration$SpringYarnConfig$$EnhancerBySpringCGLIB$$2caddc60] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
[2016-06-09 16:47:16.675] boot - 35635 INFO [main] --- SpringYarnConfiguration: Enabling CONTAINER for Yarn
[2016-06-09 16:47:16.675] boot - 35635 INFO [main] --- PostProcessorRegistrationDelegate$BeanPostProcessorChecker: Bean 'org.springframework.yarn.config.annotation.configuration.SpringYarnContainerConfiguration' of type [class org.springframework.yarn.config.annotation.configuration.SpringYarnContainerConfiguration$$EnhancerBySpringCGLIB$$9f2964a0] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
[2016-06-09 16:47:16.723] boot - 35635 INFO [main] --- SpringYarnConfiguration: We couldn't figure out if we could use existing configuration
[2016-06-09 16:47:16.724] boot - 35635 INFO [main] --- SpringYarnConfiguration: Building configuration for bean 'yarnConfiguration'
[2016-06-09 16:47:16.738] boot - 35635 INFO [main] --- SpringYarnConfigBuilder: Existing yarnConfiguration: null
[2016-06-09 16:47:17.194] boot - 35635 INFO [main] --- ConfigurationFactoryBean: Overwriting fsUri=[file:///] with fsUri=[hdfs://dev]
[2016-06-09 16:47:17.323] boot - 35635 WARN [main] --- NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
[2016-06-09 16:47:17.442] boot - 35635 INFO [main] --- ConfigurationFactoryBean: Executing with tokens:
[2016-06-09 16:47:17.443] boot - 35635 INFO [main] --- ConfigurationFactoryBean: Kind: HDFS_DELEGATION_TOKEN, Service: ha-hdfs:dev, Ident: (HDFS_DELEGATION_TOKEN token 21603 for anonymous)
[2016-06-09 16:47:17.511] boot - 35635 INFO [main] --- ConfigurationFactoryBean: Kind: YARN_AM_RM_TOKEN, Service: 10.4.0.91:8030, Ident: (appAttemptId { application_id { id: 111 cluster_timestamp: 1465390563601 } attemptId: 1 } keyId: -144109947)
[2016-06-09 16:47:17.665] boot - 35635 INFO [main] --- SpringYarnConfigBuilder: Setting configuration for SpringYarnConfigs: fs.defaultFS=hdfs://dev yarn.resourcemanager.address=0.0.0.0:8032 Configuration: core-default.xml, core-site.xml, yarn-default.xml, yarn-site.xml, mapred-default.xml, mapred-site.xml
Any ideas on how to get the container application to pick up the configuration?
Related
I have a Spring Boot app that works fine when running with the built-in Tomcat. When I exclude the built-in Tomcat instance and deploy in IBM Liberty, most services/controllers work fine. However, 2 of my services fail to autowire, receiving a NPE when they are invoked.
The logs I'm seeing are:
Actual Error
Caused by: java.lang.NullPointerException
at com.services.adminsuite.features.linkedattributes.controllers.LinkedAttributesController.getAllConfigurations(LinkedAttributesController.java:122)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:90)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
at java.lang.reflect.Method.invoke(Method.java:508)
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:189)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:102)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:800)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1038)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:942)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1005)
Startup discrepancies
[AUDIT ] CWWKG0102I: Found conflicting settings for defaultKeyStore instance of keyStore configuration.
Property password has conflicting values:
Secure value is set in file:/opt/IBM/JazzTeamServer702-app10/wlp/usr/servers/pxs/GeneratedSSLInclude.xml.
Secure value is set in file:/opt/IBM/JazzTeamServer702-app10/wlp/usr/servers/pxs/server.xml.
Property password will be set to the value defined in file:/opt/IBM/JazzTeamServer702-app10/wlp/usr/servers/pxs/server.xml.
[AUDIT ] CWWKZ0058I: Monitoring dropins for applications.
[WARNING ] CWWKT0023W: The configured defaultHostName pxsjts could not be resolved, using localhost instead.
[AUDIT ] CWWKT0016I: Web application available (default_host): http://localhost:9081/ibm/adminCenter/serverConfig-1.0/
[AUDIT ] CWWKT0016I: Web application available (default_host): http://localhost:9081/adminCenter/
[AUDIT ] CWWKT0016I: Web application available (default_host): http://localhost:9081/ibm/adminCenter/explore-1.0/
[AUDIT ] CWWKT0016I: Web application available (default_host): http://localhost:9081/IBMJMXConnectorREST/
[AUDIT ] CWWKT0016I: Web application available (default_host): http://localhost:9081/ibm/api/
[WARNING ] CWNEN0047W: Resource annotations on the fields of the org.springframework.web.servlet.view.tiles3.TilesConfigurer$CompositeELResolverImpl class will be ignored. The annotations could not be obtained because of the exception : java.lang.NoClassDefFoundError: org.apache.tiles.el.ScopeELResolver
[WARNING ] CWNEN0049W: Resource annotations on the methods of the org.springframework.web.servlet.view.tiles3.TilesConfigurer$CompositeELResolverImpl class will be ignored. The annotations could not be obtained because of the exception : java.lang.NoClassDefFoundError: org.apache.tiles.el.ScopeELResolver
21:18:13.805 [Default Executor-thread-3] INFO org.springframework.data.jpa.repository.cdi.JpaRepositoryExtension - Activating CDI extension for Spring Data JPA repositories.
[AUDIT ] CWWKT0016I: Web application available (default_host): http://localhost:9081/pxs/
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.1.1.RELEASE)
2021-07-13 21:18:15.656 INFO 123564 --- [ecutor-thread-4] c.p.services.adminsuite.WebInitializer : Starting WebInitializer on with PID 123564 (/opt/IBM/JazzTeamServer702-app10/wlp/usr/servers/pxs/apps/expanded/pxs.war/WEB-INF/classes started by in /opt/IBM/JazzTeamServer702-app10/wlp/usr/servers/pxs)
2021-07-13 21:18:15.657 INFO 123564 --- [ecutor-thread-4] c.p.services.adminsuite.WebInitializer : The following profiles are active: prod
2021-07-13 21:18:16.755 INFO 123564 --- [ecutor-thread-4] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data repositories in DEFAULT mode.
2021-07-13 21:18:16.906 INFO 123564 --- [ecutor-thread-4] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 144ms. Found 13 repository interfaces.
2021-07-13 21:18:17.424 INFO 123564 --- [ecutor-thread-4] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$c4bbc7fd] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2021-07-13 21:18:17.460 INFO 123564 --- [ecutor-thread-4] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.security.config.annotation.configuration.ObjectPostProcessorConfiguration' of type [org.springframework.security.config.annotation.configuration.ObjectPostProcessorConfiguration$$EnhancerBySpringCGLIB$$5d699037] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2021-07-13 21:18:17.466 INFO 123564 --- [ecutor-thread-4] trationDelegate$BeanPostProcessorChecker : Bean 'objectPostProcessor' of type [org.springframework.security.config.annotation.configuration.AutowireBeanFactoryObjectPostProcessor] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2021-07-13 21:18:17.469 INFO 123564 --- [ecutor-thread-4] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.security.access.expression.method.DefaultMethodSecurityExpressionHandler#f8b13266' of type [org.springframework.security.access.expression.method.DefaultMethodSecurityExpressionHandler] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2021-07-13 21:18:17.472 INFO 123564 --- [ecutor-thread-4] trationDelegate$BeanPostProcessorChecker : Bean 'methodSecurityConfiguration' of type [com.services.adminsuite.core.config.MethodSecurityConfiguration$$EnhancerBySpringCGLIB$$e74ada7b] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2021-07-13 21:18:17.481 INFO 123564 --- [ecutor-thread-4] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.security.config.annotation.method.configuration.Jsr250MetadataSourceConfiguration' of type [org.springframework.security.config.annotation.method.configuration.Jsr250MetadataSourceConfiguration$$EnhancerBySpringCGLIB$$a7934aff] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2021-07-13 21:18:17.484 INFO 123564 --- [ecutor-thread-4] trationDelegate$BeanPostProcessorChecker : Bean 'jsr250MethodSecurityMetadataSource' of type [org.springframework.security.access.annotation.Jsr250MethodSecurityMetadataSource] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2021-07-13 21:18:17.485 INFO 123564 --- [ecutor-thread-4] trationDelegate$BeanPostProcessorChecker : Bean 'methodSecurityMetadataSource' of type [org.springframework.security.access.method.DelegatingMethodSecurityMetadataSource] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2021-07-13 21:18:17.511 INFO 123564 --- [ecutor-thread-4] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 1832 ms
The org.apache.tiles.el.ScopeELResolver NoClassDefFound error I've seen elsewhere in others logs when using Liberty, so doesn't seem related but not for sure. The BeanPostProcessor ones are interesting though, but not for sure there either (commented out method security on the class but it's still occurring).
Do you know why there would be any difference between how Liberty processes these and Tomcat? Or any tips for debugging this?
Thank you,
Matt
Turns out the controller endpoints with the problem (3 of them), for some reason were missing access modifier. Adding protected to the methods fixed the issue. It wasn't an issue in Tomcat, but only when running on Liberty. Thank you again for the help (and apologize for the late response as went on vacation soon after posting it)
I am starting a new spring-boot project using data-rest and I noticed a lot of INFO message reporting "Bean 'X' of type [Y] is not eligible for getting processed by all BeanPostProcessors.
Is this a cause for concerns?
To reproduce issue, create project from spring initializr 2.4.0, mvn, Java 11 with only data Rest Repositories as dependencies.
./mvnw clean install
Running the default test class from the generated project produces lots of
2020-12-01 13:35:05.746 INFO 21452 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.hateoas.config.HateoasConfiguration' of type [org.springframework.hateoas.config.HateoasConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-12-01 13:35:05.758 INFO 21452 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'relProviderPluginRegistry' of type [org.springframework.plugin.core.support.PluginRegistryFactoryBean] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-12-01 13:35:05.769 INFO 21452 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'relProviderPluginRegistry' of type [org.springframework.plugin.core.OrderAwarePluginRegistry] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-12-01 13:35:05.773 INFO 21452 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean '_relProvider' of type [org.springframework.hateoas.server.core.DelegatingLinkRelationProvider] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-12-01 13:35:05.781 INFO 21452 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'messageResolver' of type [org.springframework.hateoas.mediatype.MessageSourceResolver] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
...
After running the spring-boot App, I'm getting the below logs:
Using below:
Kubernetes
Bit-Bucket Pipeline
MySQL and Oracle
Consul
Running Debug Mode
2019-07-17 10:33:03 [0] [main] INFO c.n.c.sources.URLConfigurationSource - To enable URLs as dynamic configuration sources, define System property archaius.configurationSource.additionalUrls or make config.properties available on classpath.
2019-07-17 10:33:11 [0] [http-nio-9080-exec-2] INFO o.a.c.c.C.[Tomcat].[localhost].[/] - Initializing Spring FrameworkServlet 'dispatcherServlet'
I am investigating integrating Spring Cloud Sleuth into a new Spring Boot service we are building and want to exclude certain URL's from generating spans for example health check endpoints which are polled periodically.
Checking the code I can see that the TraceFilter created in the TraceWebAutoConfiguration.java has a DEFAULT_SKIP_PATTERN which can be overridden by setting spring.sleuth.instrument.web.skipPattern.
However even if I access a resource under the DEFAULT_SKIP_PATTERN I am still observing that a trace & span are being created i.e.
17:28:46.142 [XNIO-2 task-1] INFO o.s.c.sleuth.log.Slf4jSpanListener - Starting span: MilliSpan(begin=1454394526140, end=0, name=http/info, traceId=908b24a3-143f-4949-8f86-5df867e3985b, parents=[], spanId=908b24a3-143f-4949-8f86-5df867e3985b, remote=false, exportable=false, annotations={}, processId=null, timelineAnnotations=[])
17:28:46.143 [XNIO-2 task-1] INFO o.s.c.sleuth.log.Slf4jSpanListener - Continued span: MilliSpan(begin=1454394526140, end=0, name=http/info, traceId=908b24a3-143f-4949-8f86-5df867e3985b, parents=[], spanId=908b24a3-143f-4949-8f86-5df867e3985b, remote=false, exportable=false, annotations={}, processId=null, timelineAnnotations=[])
17:28:46.146 [XNIO-2 task-1] INFO io.undertow.servlet - Initializing Spring FrameworkServlet 'dispatcherServlet'
17:28:46.146 [XNIO-2 task-1] INFO o.s.web.servlet.DispatcherServlet - FrameworkServlet 'dispatcherServlet': initialization started
17:28:46.170 [XNIO-2 task-1] INFO o.s.web.servlet.DispatcherServlet - FrameworkServlet 'dispatcherServlet': initialization completed in 24 ms
17:28:46.216 [XNIO-2 task-1] INFO o.s.c.sleuth.log.Slf4jSpanListener - Stopped span: MilliSpan(begin=1454394526140, end=1454394526215, name=http/info, traceId=908b24a3-143f-4949-8f86-5df867e3985b, parents=[], spanId=908b24a3-143f-4949-8f86-5df867e3985b, remote=false, exportable=false, annotations={}, processId=null, timelineAnnotations=[])
Am I missing something? I am currently using 1.0.0.M4
A skipped resource does not stop a span from being created, it only stops the data from being collected and exported. So your logs look normal to me. In snapshots you would see the "exportable" flag set to false in skipped resources.
I'm using HibernateJpaAutoConfiguration directly in a Spring unit test. While Hibernate and EntityManager is configured, no entities are scanned.
Exception
10:29:36.377 [main] INFO o.s.b.f.a.AutowiredAnnotationBeanPostProcessor - JSR-330 javax.inject.Inject' annotation found and supported for autowiring
10:29:36.505 [main] TRACE o.s.b.b.PropertiesConfigurationFactory - Property Sources: org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor$FlatPropertySources#65f8f5ae
10:29:36.638 [main] TRACE o.s.b.b.PropertiesConfigurationFactory - Property Sources: org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor$FlatPropertySources#65f8f5ae
10:29:36.716 [main] TRACE o.s.b.b.PropertiesConfigurationFactory - Property Sources: org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor$FlatPropertySources#65f8f5ae
10:29:36.818 [main] INFO o.s.o.j.LocalContainerEntityManagerFactoryBean - Building JPA container EntityManagerFactory for persistence unit 'default'
10:29:36.842 [main] INFO o.h.jpa.internal.util.LogHelper - HHH000204: Processing PersistenceUnitInfo [
name: default
...]
10:29:36.979 [main] INFO org.hibernate.Version - HHH000412: Hibernate Core {4.3.6.Final}
10:29:36.980 [main] INFO org.hibernate.cfg.Environment - HHH000206: hibernate.properties not found
10:29:36.982 [main] INFO org.hibernate.cfg.Environment - HHH000021: Bytecode provider name : javassist
10:29:37.234 [main] INFO o.h.annotations.common.Version - HCANN000001: Hibernate Commons Annotations {4.0.4.Final}
10:29:37.599 [main] INFO org.hibernate.dialect.Dialect - HHH000400: Using dialect: org.hibernate.dialect.PostgreSQL9Dialect
10:29:37.608 [main] INFO o.h.e.j.internal.LobCreatorBuilder - HHH000424: Disabling contextual LOB creation as createClob() method threw error : java.lang.reflect.InvocationTargetException
10:29:37.648 [main] INFO o.h.h.i.a.ASTQueryTranslatorFactory - HHH000397: Using ASTQueryTranslatorFactory
10:29:37.742 [main] INFO o.h.tool.hbm2ddl.SchemaUpdate - HHH000228: Running hbm2ddl schema update
10:29:37.742 [main] INFO o.h.tool.hbm2ddl.SchemaUpdate - HHH000102: Fetching database metadata
10:29:37.744 [main] INFO o.h.tool.hbm2ddl.SchemaUpdate - HHH000396: Updating schema
10:29:37.745 [main] INFO o.h.tool.hbm2ddl.SchemaUpdate - HHH000232: Schema update complete
My workaround is to create my own LocalContainerEntityManagerFactoryBean as follows:
final LocalContainerEntityManagerFactoryBean factoryBean = new LocalContainerEntityManagerFactoryBean();
factoryBean.setPersistenceUnitName("buzzPU"); // persistence.xml
factoryBean.setDataSource(dataSource);
factoryBean.setJpaVendorAdapter(jpaVendorAdapter);
factoryBean.setPersistenceXmlLocation("classpath*:META-INF/donotparsepersistence.xml");
factoryBean.setPackagesToScan("org.soluvas.buzz.core.jpa");
Note that I don't use META-INF/persistence.xml
From the Spring Boot reference...
62.4 Separate #Entity definitions from Spring configuration
Spring Boot tries to guess the location of your #Entity definitions, based on the #EnableAutoConfiguration it finds. To get more control, you can use the #EntityScan annotation, e.g.
#Configuration
#EnableAutoConfiguration
#EntityScan(basePackageClasses=City.class)
public class Application {
//...
}
Using the following also helps:
#EntityScan("org.soluvas.buzz.core.jpa")
It is an alias for 'basePackages' property that configures a list of packages to scan for annotated entities.
This annotation provides an alternative to manually setting
LocalContainerEntityManagerFactoryBean.setPackagesToScan(String...)
and is particularly useful if you want to configure entity scanning in
a type-safe way, or if your LocalContainerEntityManagerFactoryBean is
auto-configured.