Having an issue deploying a Spring 3.0.7 MVC web application to Tomcat via Eclipse and the WST plugin. Getting this error message:
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'messageSource' defined in ServletContext
resource [/WEB-INF/beans/appContext.xml]: BeanPostProcessor before
instantiation of bean failed; nested exception is
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name
'org.springframework.transaction.config.internalTransactionAdvisor':
Cannot resolve reference to bean
'org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#0'
while setting bean property 'transactionAttributeSource'; nested
exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name
'org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#0':
Initialization of bean failed; nested exception is
java.lang.IllegalArgumentException: error at ::0 can't find referenced
pointcut webLayer
Any ideas? Thanks.
Got past this issue for now. Was using the wrong version of JDK for our project (1.7 instead of 1.6).
You can try updating the pom to use aspectjrt-1.7 / aspectjweaver-1.7 for 1.7 java.
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>1.7.4</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>1.7.4</version>
</dependency>
Related
I'm working on a Spring Boot project. I got a weird error when I start AppRun
Below is the error:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'xxManagerFactory' defined in class path resource [xxDataSourceConfig.class]: Initialization of bean failed; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'refreshEventListener' defined in class path resource [org/springframework/cloud/autoconfigure/RefreshAutoConfiguration.class]: Unsatisfied dependency expressed through method 'refreshEventListener' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'configDataContextRefresher' defined in class path resource [org/springframework/cloud/autoconfigure/RefreshAutoConfiguration.class]: Post-processing of merged bean definition failed; nested exception is java.lang.IllegalStateException: Failed to introspect Class [org.springframework.cloud.context.refresh.ConfigDataContextRefresher] from ClassLoader [jdk.internal.loader.ClassLoaders$AppClassLoader#3b192d32]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:603)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517)
enter image description here
I've checked springboot version and spring cloud version:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.6.RELEASE</version>
<relativePath/>
</parent>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>Hoxton.SR3</version>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
I can build jar file, but I can not run the service.
Please Help! THanks a lot!
Recently, I have upgraded to Spring 5.3.20 from 4.0.5.RELEASE and I have changed the other dependencies versions also. It is getting successfully build, but when I try to run, it is giving error after jetty.
Upgraded versions in Pom.xml:
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java-version>1.8</java-version>
<org.springframework-version>5.3.20</org.springframework-version>
<org.springframework-security-version>5.6.3</org.springframework-security-version>
<org.apache.tiles-version>3.0.4</org.apache.tiles-version>
<!-- <org.hibernate-version>5.6.10.Final</org.hibernate-version> --> <!-- 4.3.5.Final -->
<org.hibernate-version>5.3.7.Final</org.hibernate-version><!-- 5.1.17.Final -->
<org.aspectj-version>1.6.10</org.aspectj-version>
<org.slf4j-version>1.7.7</org.slf4j-version>
<jackson.version>2.11.3</jackson.version> <!-- 2.11.3 -->
<!-- <jackson.version>2.14.1</jackson.version> -->
</properties>
The build is successful (using maven) but when I try to run the code I am getting this error after jetty,
Error -
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.filterChains': Cannot resolve reference to bean 'org.springframework.security.web.DefaultSecurityFilterChain#31' while setting bean property 'sourceList' with key [31];
nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.web.DefaultSecurityFilterChain#31': Cannot resolve reference to bean 'concurrencyFilter' while setting constructor argument with key [2];
nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'concurrencyFilter' defined in ServletContext resource [/WEB-INF/spring/security.xml]: Instantiation of bean failed;
nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.security.web.session.ConcurrentSessionFilter]: No default constructor found;
nested exception is java.lang.NoSuchMethodException: org.springframework.security.web.session.ConcurrentSessionFilter.<init>()
Can anybody help me to resolve this error. Would really appreciate any help.
during context initialization - cancelling refresh attempt:
org.springframework.beans.factory.UnsatisfiedDependencyException:
Error creating bean with name 'taxLotsController': Unsatisfied
dependency expressed through field 'taxLotsService'; nested exception
is org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'taxLotsServiceImpl': Lookup method resolution
failed; nested exception is java.lang.IllegalStateException: Failed to
introspect Class [com.frk.fds.api.service.impl.TaxLotsServiceImpl]
from ClassLoader [ParallelWebappClassLoader
Please check your dependency on pom.xml maybe some dependency problem occurs:
you can try with this:
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-catalina</artifactId>
<version>9.0.37</version>
</dependency>
Maybe your TaxLotsServiceImpl class referring to another class i.e. is missing right now.
Please find out these missing dependencies if there are any.
Project successfuly runs in IntelliJ IDEA 2018.1.1 with JDK 1.8.0_221
When our new staff-mates tryed to start it in IntelliJ IDEA 2019.1.1 they both get en error:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'postgresqlEntityManager' defined in com.configuration.PostgresqlConfiguration: Invocation of init method failed; nested exception is java.lang.TypeNotPresentException: Type javax.annotation.meta.When not present
Do you have any ideas how to fix it?
That helped us:
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
<version>3.0.2</version>
</dependency>
I am using Spring Boot to implement a spark application. I build an uber jar, and use spark-submit to execute the application. But I got the following exception:
18/06/05 15:32:37 ERROR SpringApplication: Application run failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'gsonBuilder' defined in class path resource
[org/springframework/boot/autoconfigure/gson/GsonAutoConfiguration.class]:
Bean instantiation via factory method failed; nested exception is
org.springframework.beans.BeanInstantiationException: Failed to
instantiate [com.google.gson.GsonBuilder]: Factory method
'gsonBuilder' threw exception; nested exception is
java.lang.BootstrapMethod
Error: java.lang.NoSuchMethodError: com.google.gson.GsonBuilder.setLenient()Lcom/google/gson/GsonBuilder;
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:587)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1254)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1103)
.....
The exception is still there even if I put the following dependency in my pom.xml:
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.5</version>
<scope>compile</scope>
</dependency>
How can I resolve this dependency issue?
Maybe you can use #SpringBootApplication(exclude = {GsonAutoConfiguration.class}) to disable gson autoconfiguration.