Java Springboot Issue Configuration Manager is null (Intellij) - spring-boot

I am getting unusal issue
ERROR TomcatStarter Error starting Tomcat context. Exception: org.springframework.beans.factory.UnsatisfiedDependencyException.
Below is the stack trace.
ERROR TomcatStarter Error starting Tomcat context. Exception: org.springframework.beans.factory.UnsatisfiedDependencyException. Message: Error creating bean with name 'jwtRequestFilter': Unsatisfied dependency expressed through field 'passwordEncoder'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'webSecurityConfig': Unsatisfied dependency expressed through method 'setContentNegotationStrategy' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration$EnableWebMvcConfiguration': Unsatisfied dependency expressed through method 'setConfigurers' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'swaggerWebMvcConfigurer' defined in class path resource [org/springdoc/webmvc/ui/SwaggerConfig.class]: Unsatisfied dependency expressed through method 'swaggerWebMvcConfigurer' parameter 1; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'indexPageTransformer' defined in class path resource [org/springdoc/webmvc/ui/SwaggerConfig.class]: Unsatisfied dependency expressed through method 'indexPageTransformer' parameter 3; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'swaggerWelcome': Injection of autowired dependencies failed; nested exception is {"prefix": "PLR", "code": "CCM-6117", "description": "Configuration Manager is null."}
Feb 03, 2023 7:14:57 PM org.apache.catalina.core.StandardService stopInternal
INFO: Stopping service [Tomcat]
19:14:58.065 [main] INFO com.walmart.platform.scm.client.impl.SCMImpl - Initiating SCM shutdown
ERROR SpringApplication Application run failed
org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:163)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:577)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:740)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:415)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:303)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1312)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1301)
at com.samsclub.lumos.LumosApplication.main(LumosApplication.java:39)
Caused by: org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat
at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.initialize(TomcatWebServer.java:142)
at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.<init>(TomcatWebServer.java:104)
at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.getTomcatWebServer(TomcatServletWebServerFactory.java:478)
at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.getWebServer(TomcatServletWebServerFactory.java:211)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.createWebServer(ServletWebServerApplicationContext.java:182)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:160)
This issue only comes when I run in local but when am package and run, it works fine!

Related

Spring boot application crashing on PCF (Pivotal Cloud Foundry) cloud

I have deployed my spring boot application on PCF (Pivotal Cloud Foundry) cloud and it was running fine since last many days but suddenly from last 24 hours, this application is started crashing in every few minutes.
And getting below errors
[trade-data-service,,,] 15 --- [main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'reactiveHealthIndicatorRegistry' defined in class path resource [org/springframework/boot/actuate/autoconfigure/health/LegacyHealthEndpointCompatibilityConfiguration$LegacyReactiveHealthEndpointCompatibilityConfiguration.class]: Unsatisfied dependency expressed through method 'reactiveHealthIndicatorRegistry' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'reactiveHealthContributorRegistry' defined in class path resource [org/springframework/boot/actuate/autoconfigure/health/ReactiveHealthEndpointConfiguration.class]: Unsatisfied dependency expressed through method 'reactiveHealthContributorRegistry' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'discoveryCompositeHealthContributor' defined in class path resource [org/springframework/cloud/client/CommonsClientAutoConfiguration$DiscoveryLoadBalancerConfiguration.class]: Unsatisfied dependency expressed through method 'discoveryCompositeHealthContributor' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'eurekaHealthIndicator' defined in class path resource [org/springframework/cloud/netflix/eureka/EurekaClientAutoConfiguration$EurekaHealthIndicatorConfiguration.class]: Unsatisfied dependency expressed through method 'eurekaHealthIndicator' parameter 1; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'eurekaInstanceConfigBean' defined in class path resource [org/springframework/cloud/netflix/eureka/EurekaClientAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.cloud.netflix.eureka.EurekaInstanceConfigBean]: Factory method 'eurekaInstanceConfigBean' threw exception; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'vcap.application.uris[0]' in value "${vcap.application.uris[0]}"
[trade-data-service,,,] 15 --- [main] o.s.s.concurrent.ThreadPoolTaskExecutor : Shutting down ExecutorService 'applicationTaskExecutor' 
[trade-data-service,,,] 15 --- [main] o.apache.catalina.core.StandardService : Stopping service [Tomcat] 
If I check health of application using /actuator/health then it return application status is UP.
What could be the reason ?
Please help

Starting spring boot application, results in java.lang.RuntimeException

I'm implementing secret manager for rds mysql database for password. It's a spring boot application. While starting up, application is throwing the following error.
WARN o.s.b.w.s.c.AnnotationConfigServletWebServerApplicationContext.refresh - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Unsatisfied dependency expressed through method 'entityManagerFactory' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'entityManagerFactoryBuilder' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Unsatisfied dependency expressed through method 'entityManagerFactoryBuilder' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jpaVendorAdapter' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.orm.jpa.JpaVendorAdapter]: Factory method 'jpaVendorAdapter' threw exception; nested exception is java.lang.RuntimeException: Driver com.mysql.cj.jdbc.Driver claims to not accept jdbcUrl, jdbc-secretsmanager:mysql://dev-transaction-summary-db.cluster-csuuxb898zxl.us-east-1.rds.amazonaws.com:3306/transaction_summary?serverTimezone=UTC&useSSL=true&serverSslCert=/opt/rds-certs/rds-combined-ca-bundle.pem
INFO o.a.catalina.core.StandardService.log - Stopping service [Tomcat]
[localhost-startStop-1] WARN o.a.c.loader.WebappClassLoaderBase.log - The web application [ROOT] appears to have started a thread named [java-sdk-http-connection-reaper] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
java.lang.Thread.sleep(Native Method)

Flyway integration(Enterprise Version) in Spring Boot problem

Hello i got this error when i use flyway enterprise in my springboot project:
16:27:46 WARN o.s.b.w.s.c.AnnotationConfigServletWebServerApplicationContext - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.scheduling.annotation.ProxyAsyncConfiguration': Unsatisfied dependency expressed through method 'setConfigurers' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'springAsyncConfig': Unsatisfied dependency expressed through field 'customAsyncExceptionHandler'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'customAsyncExceptionHandler': Unsatisfied dependency expressed through field 'importHistoryRepository'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'importHistoryRepository': Cannot create inner bean '(inner bean)#31db34da' of type [org.springframework.orm.jpa.SharedEntityManagerCreator] while setting bean property 'entityManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#31db34da': Cannot resolve reference to bean 'entityManagerFactory' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration$FlywayConfiguration': Unexpected exception during bean creation; nested exception is java.lang.TypeNotPresentException: Type org.flywaydb.core.api.callback.FlywayCallback not present
Here is my pom.xml file:
<dependency>
<groupId>org.flywaydb.enterprise</groupId>
<artifactId>flyway-core</artifactId>
<version>6.0.3</version>
</dependency>
Related to this Issue Flyway 6.x.x is not compatible with Spring Boot < 2.2.0.
So you got 2 Choices:
Update Spring Boot to >= 2.2.0
Use flyway 5.x.x
Hope this helps

Spring 4 LTW not compatible with 64 bit JVM and Tomcat

As part of moving to Java 8 and in honor of Spring 4, I thought I'd upgrade to all 64 bit code. This application runs perfectly on 32 bit but load time weaving does not work (in fact doesn't even load) on 64 bit.
Specifics of the architecture:
Java 8.0.5 (32 or 64 bit as appropriate)
Tomcat 7.0.54 (32 or 64 bit as appropriate)
Spring 4.0.5
Eclipselink 2.5.1
Testing under Spring Tool Suite 3.5.1 on windows.
Deployment Target RHEL
JVM startup:
-javaagent:C:\Users\...\.m2\repository\org\springframework\spring-instrument\4.0.5.RELEASE\spring-instrument-4.0.5.RELEASE.jar
The offending Bean:
#Bean()
public LoadTimeWeaver loadTimeWeaver() {
return new org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver();
}
The error is pretty straightforward:
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'entityManagerFactory' defined in class path resource com/xxxx/config/DataContextConfig.class]:
Invocation of init method failed; nested exception is java.lang.IllegalStateException:
Must start with Java agent to use InstrumentationLoadTimeWeaver. See Spring documentation.
All I did was change to 64 bit JVM and use the 64 bit Tomcat container. Very many hours of Googling and trying different versions and agents have completely failed to turn up any solution. Any thoughts appreciated.
UPDATE:
It is a standard Eclipse Server config so I assume that basically means startup.sh start. The addional JVM properteries are below. Note that we are not deploying any AspectJ aspects at this time, that's the next release. The results are identical with or without the AspectJ weaver specified.
-javaagent:C:\Users\XXXXXX\.m2\repository\org\springframework\spring-instrument\4.0.5.RELEASE\spring-instrument-4.0.5.RELEASE.jar
-javaagent:C:\Users\XXXXXX\.m2\repository\org\aspectj\aspectjweaver\1.8.0\aspectjweaver-1.8.0.jar
-Dcatalina.base="C:\Users\XXXXXX\apache-tomcat-7.0.54-64bit"
-Dcatalina.home="C:\Users\XXXXXX\apache-tomcat-7.0.54-64bit"
-Dwtp.deploy="C:\Users\XXXXXX\apache-tomcat-7.0.54-64bit\webapps"
-Djava.endorsed.dirs="C:\Users\XXXXXX\apache-tomcat-7.0.54-64bit\endorsed"
Stacktrace:
20140529 13:25:48,873 localhost-startStop-1 ERROR Context initialization failed
org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'ieexbContextConfig': Injection of autowired dependencies failed;
nested exception is org.springframework.beans.factory.BeanCreationException:
Could not autowire field: com.xxx.yyyy.domain.FlowController com.xxx.yyyy.config.IeexbContextConfig.flowController;
nested exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'FlowController': Injection of autowired dependencies failed;
nested exception is org.springframework.beans.factory.BeanCreationException:
Could not autowire field: com.xxx.yyyy.repository.PendingQueueRepository com.xxx.yyyy.domain.FlowController.pendingQueueRepository;
nested exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'pend ingQueueRepository': Cannot create inner bean '(inner bean)#63244fdb' of type [org.springframework.orm.jpa.SharedEntityM anagerCreator] while setting bean property 'entityManager';
nested exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name '(inner bean)#63244fdb': Cannot resolve reference to bean 'entityManagerF actory' while setting constructor argument;
nested exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'entityManagerFactory' defined in class path resource [com/xxx/yyyy/config/IeexbDataCont extConfig.class]: Invocation of init method failed;
nested exception is java.lang.IllegalStateException: Must start with Java agent to use InstrumentationLoadTimeWeaver. See Spring documentation.
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:292)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1185)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:703)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:760)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:403)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4973)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5467)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:632)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1247)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1898)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: com.xxx.yyyy.domain.FlowController com.xxx.yyyy.config.IeexbContextConfig.flowController; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'FlowController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: com.xxx.yyyy.repository.PendingQueueRepository com.xxx.yyyy.domain.FlowController.pendingQueueRepository; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pendingQueueRepository': Cannot create inner bean '(inner bean)#63244fdb' of type [org.springframework.orm.jpa.SharedEntityManagerCreator] while setting bean property 'entityManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#63244fdb': Cannot resolve reference to bean 'entityManagerFactory' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [com/xxx/yyyy/config/IeexbDataContextConfig.class]: Invocation of init method failed; nested exception is java.lang.IllegalStateException: Must start with Java agent to use InstrumentationLoadTimeWeaver. See Spring documentation.
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:508)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:289)
... 26 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'FlowController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: com.xxx.yyyy.repository.PendingQueueRepository com.xxx.yyyy.domain.FlowController.pendingQueueRepository; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pendingQueueRepository': Cannot create inner bean '(inner bean)#63244fdb' of type [org.springframework.orm.jpa.SharedEntityManagerCreator] while setting bean property 'entityManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#63244fdb': Cannot resolve reference to bean 'entityManagerFactory' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [com/xxx/yyyy/config/IeexbDataContextConfig.class]: Invocation of init method failed; nested exception is java.lang.IllegalStateException: Must start with Java agent to use InstrumentationLoadTimeWeaver. See Spring documentation.
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:292)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1185)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1017)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:960)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:858)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:480)
... 28 more
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: com.xxx.yyyy.repository.PendingQueueRepository com.xxx.yyyy.domain.FlowController.pendingQueueRepository; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pendingQueueRepository': Cannot create inner bean '(inner bean)#63244fdb' of type [org.springframework.orm.jpa.SharedEntityManagerCreator] while setting bean property 'entityManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#63244fdb': Cannot resolve reference to bean 'entityManagerFactory' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [com/xxx/yyyy/config/IeexbDataContextConfig.class]: Invocation of init method failed; nested exception is java.lang.IllegalStateException: Must start with Java agent to use InstrumentationLoadTimeWeaver. See Spring documentation.
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:508)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:289)
... 39 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pendingQueueRepository': Cannot create inner bean '(inner bean)#63244fdb' of type [org.springframework.orm.jpa.SharedEntityManagerCreator] while setting bean property 'entityManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#63244fdb': Cannot resolve reference to bean 'entityManagerFactory' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [com/xxx/yyyy/config/IeexbDataContextConfig.class]: Invocation of init method failed; nested exception is java.lang.IllegalStateException: Must start with Java agent to use InstrumentationLoadTimeWeaver. See Spring documentation.
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:290)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:129)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1456)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1197)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1017)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:960)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:858)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:480)
... 41 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#63244fdb': Cannot resolve reference to bean 'entityManagerFactory' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [com/xxx/yyyy/config/IeexbDataContextConfig.class]: Invocation of init method failed; nested exception is java.lang.IllegalStateException: Must start with Java agent to use InstrumentationLoadTimeWeaver. See Spring documentation.
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:336)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:108)
at org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:632)
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:442)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1094)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:989)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:276)
... 54 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [com/xxx/yyyy/config/IeexbDataContextConfig.class]: Invocation of init method failed; nested exception is java.lang.IllegalStateException: Must start with Java agent to use InstrumentationLoadTimeWeaver. See Spring documentation.
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1553)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
... 62 more
Caused by: java.lang.IllegalStateException: Must start with Java agent to use InstrumentationLoadTimeWeaver. See Spring documentation.
at org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver.addTransformer(InstrumentationLoadTimeWeaver.java:88)
at org.springframework.orm.jpa.persistenceunit.SpringPersistenceUnitInfo.addTransformer(SpringPersistenceUnitInfo.java:82)
at org.eclipse.persistence.jpa.PersistenceProvider.createContainerEntityManagerFactory(PersistenceProvider.java:348)
at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:336)
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:318)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1612)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1549)
... 69 more
I ran into the same problem. But eventually the issue was not coming from spring-data-jpa but rather on Tomcat changes from 7.0.47 version (where everything is working) to 7.0.5x and tomcat 8.
Try removing spring-instrument.jar agent from your application WEB-INF/lib (and put a provided scope to this dependency if you're using Maven), this should resolve the issue.
I'm running a Spring 4.0.6 application with Eclipselink 2.5.2 and dynamic weaving with spring-data-jpa 1.6.2 on a Tomcat 8.0.9 server on Java 8, everything in 64 bits.
The 2 methods for weaving (agent at startup or spring-instrument.jar in Tomcat lib directory) are working.
Note: Make sure you are using aspectj 1.8.1 (comes with Spring 4.0.6)
The problem was that the current RELEASE of spring-data-jpa is 1.5.1. That version is obviously not compatible with 64 bit - although it works fine with Spring 4 in 32 bit Java 8 and Tomcat.
The solution was to pull in the SNAPSHOT build of 1.7.0 which does work with Spring 4 and 64 bit. See
spring-data-jpa project site for dependency and official Repository POM elements. I'm not sure if I'll try to get SNAPSHOT code released to our production or not. Hopefully they'll build a RELEASE soon.
It is worth noting that Eclipselink 2.5.1 is fully 64 bit ready.

SPRING Lookup failed for 'jdbc/ww2b/DataSource' in SerialContext

[#|2014-04-01T15:19:03.824+0200|INFO|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=76;_ThreadName=Thread-2;|15:19:03.822 [admin-thread-pool-4848(5)] ERROR o.s.web.context.ContextLoader - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'categoryUiDao': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in URL [jar:file:/C:/glassfish3/glassfish/domains/domain1/applications/web/WEB-INF/lib/core-2.6-SNAPSHOT.jar!/META-INF/spring/db-env.xml]: Cannot resolve reference to bean 'dataSource' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in URL [jar:file:/C:/glassfish3/glassfish/domains/domain1/applications/web/WEB-INF/lib/core-2.6-SNAPSHOT.jar!/META-INF/spring/db-env.xml]: Invocation of init method failed; nested exception is javax.naming.NamingException: Lookup failed for 'java:comp/env/jdbc/ww2b/DataSource' in SerialContext[myEnv={java.naming.factory.initial=com.sun.enterprise.naming.impl.SerialInitContextFactory, java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl, java.naming.factory.url.pkgs=com.sun.enterprise.naming} [Root exception is javax.naming.NamingException: Lookup failed for 'jdbc/ww2b/DataSource' in SerialContext[myEnv={java.naming.factory.initial=com.sun.enterprise.naming.impl.SerialInitContextFactory, java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl, java.naming.factory.url.pkgs=com.sun.enterprise.naming, com.sun.enterprise.naming.logicalName=java:comp/env/jdbc/ww2b/DataSource} [Root exception is javax.naming.NameNotFoundException: ww2b]]
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328) ~[spring-beans-3.0.5.RELEASE.jar:3.0.5.RELEASE]
what is wrong. When I build a project everything works but when I try to deploy to glassfish3 I get error.
Assuming your Spring application configuration is right it seems that the JNDI resource java:comp/env/jdbc/ww2b/DataSource is not correctly configured on the server.
You should configure JNDI resource on GlassFish as described in the Administrator Guide.

Resources