Project runs in older version of IDEA, but not newer - spring

I have a spring boot application that runs and functions just fine in IDEA 15.0.4.
Today I tried running it in the latest release of IDEA 2016.1
and I get the following error
2016-03-17 10:06:17.888 WARN 84730 --- [ main] s.c.a.AnnotationConfigApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'configClientBootstrapConfiguration': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException
and then execution stops.
Is there an additional step I have to do to get this to work in the newer version?

I solved this by simply re-cloning the repository and setting up a new project.

Related

Deployment failure with the RPM built with latest jenkins

We recently upgraded to Jenkins 2.47 for our application. We used Jenkins 1.7 previously for building our applications. I observed a strange issue with the upgrade. The RPMs built with latest Jenkins are failing to deploy with the below error:
<Apr 10, 2017 5:01:43 PM GMT> <Warning> <HTTP> <BEA-101162> <User defined listener org.springframework.web.context.ContextLoaderListener failed: org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name : Bean with name has been injected into other beans in its raw version as part of a circular reference, but has eventually been wrapped. This means that said other beans do not use the final version of the bean. This is often the result of over-eager type matching - consider using 'getBeanNamesOfType' with the 'allowEagerInit' flag turned off, for example..
org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name : Bean with name has been injected into other beans in its raw version as part of a circular reference, but has eventually been wrapped. This means that said other beans do not use the final version of the bean. This is often the result of over-eager type matching - consider using 'getBeanNamesOfType' with the 'allowEagerInit' flag turned off, for example.
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:568)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:302)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298)
Truncated. see log file for complete stacktrace
>
<Apr 10, 2017 5:01:43 PM GMT> <Error> <Deployer> <BEA-149231> <Unable to set the activation state to true for the application .
weblogic.application.ModuleException:
at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1520)
at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:484)
at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)
Truncated. see log file for complete stacktrace
Caused By: org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name : Bean with name has been injected into other beans in its raw version as part of a circular reference, but has eventually been wrapped. This means that said other beans do not use the final version of the bean. This is often the result of over-eager type matching - consider using 'getBeanNamesOfType' with the 'allowEagerInit' flag turned off, for example.
I can build the same code on command line with maven (without running the job in Jenkins) and deploy the RPM without any deployment errors.
I could fix the issue by downgrading jenkins to 2.34
Thanks.

Installing Jasper WAR file -- Missing dependencies?

When I run the command: js-ant import-minimal-ce I get an exception error:
[java] Resource name: applicationContext-virtual-data-source.xml
Followed by:
[java] org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'executionOwnerVoter': Injection of
resouorg.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'executionOwnerVoter': Injection of resource
dependencies failed; nested exception
I can only best determine I am somehow missing a dependency (perhaps that of Hibernate.jar?) as this appears to occur when performing database operations.
Any ideas? Frustrated and out of options...
Alex

Tomcat but not Jetty: NoSuchMethodError: javax.persistence.JoinColumn.foreignKey()Ljavax/persistence/ForeignKey

I have recently upgraded my Wicket 6 application from Spring 3 to Spring 4.
When I run the application locally on Jetty 7, it runs fine.
When I deploy it to Tomcat 7, I get the following error:
[2014-05-07 10:20:47,121] ERROR [org.springframework.web.context.ContextLoader] Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: javax.persistence.JoinColumn.foreignKey()Ljavax/persistence/ForeignKey;
Is this a Tomcat issue or should I just go ahead and try to solve the nested exception java.lang.NoSuchMethodError: javax.persistence.JoinColumn.foreignKey()?
If the issue is indeed with the foreignKey, then why does the problem not occur on Jetty?
spring.version 4.0.4.RELEASE
hibernate.version 4.3.5.Final
dataSource: class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"
nested exception is java.lang.NoSuchMethodError: javax.persistence.JoinColumn.foreignKey()Ljavax/persistence/ForeignKey
This exception occurs of there are conflicting version of javax.persistence.ForeignKey class. Check your classpath and if you are using maven check the dependencies.
For me, issue fixed after downgrading my project to java 6 and hibernate-entitymanager version to 3.6.9.FINAL

How to setup swagger-springmvc 0.6.5 with a Spring 3.1.2 application

I am trying to use swagger-springmvc 0.6.6 in a Spring 3.1.2 project. But when I deploy the application to Tomcat it's failing with an exception.
There seems to be a problem with versions I am using. swagger-springmvc also brings in Spring 3.2.4 jars which are conflicting with Spring 3.1.2 jars.
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#2'
while setting bean property 'sourceList' with key [2]; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating bean with name
'org.springframework.security.web.DefaultSecurityFilterChain#2
.......
....nested exception is java.lang.ClassNotFoundException:
org.springframework.cache.ehcache.EhCacheFactoryBean
The org.springframework.cache.ehcache.EhCacheFactoryBean class is found in both Spring 3.1.2 and Spring 3.2.4.
When I try to run the app in my Local smachine its running without issues.
Could someone help me to resolve the issue?
Please refer to this sample configuration. It is a very plain vanilla setup which shows the bare minimum configuration required.
JDK 6
Tomcat 7
Spring 3.2.4
https://github.com/varoonverma/Swagger.git
Cheers,

Can't start application in IDE with <jar-find> error, but 'gradle bootRun' - works fine

So, i have a problem that can't solve.
I have a multi module gradle project with spring boot runners. With Jpa, Elastic, OrientDb and another configurations provided by spring-data and spring-integration. And i try to start my web application! Write web starter, make annotation scan, so when I use task 'gradle bootRun' - everything start perfectly - app works, all contexts up and life is good.BUT, when i try use my favorite IDE like Intellij idea, or colleague use Eclipse - get an error :
org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with
name 'org.springframework.integration.config.IdGenerato rConfigurer#0':
BeanPostProcessor before instantiation of bean failed; nested exception is
org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with
name org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration':
Initialization of bean failed; nested exception is java.lang.NoSuchMethodError:
org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration.setBeanFactory(Lo rg/springframework/beans/factory/BeanFactoryV
That cause by (projectName - is fake):
java.lang.RuntimeException: error trying to scan <jar-file>:
file:/home/<user>/project/<projectName>/classes/production/<projectName>-system-webapp/
But i have NO /projectName/classes/production/ folder! Anyway - with gradle it's work fine.
And to be honestly, before this another error catched:
Error creating bean with name 'entityManagerFactory' defined in class com.project.system.jpa.PepperJpaConfiguration: Invocation of init method failed
caused by:
error trying to scan <jar-file>: file:/home/<user>/project/<projectName>/classes/production/<projectName>-system-webapp/
Thank you for advice! Can give additional info.
P.S : Edited
So, the problem was solved:
I do not provide important error stacktrace like:
at org.hibernate.ejb.packaging.NativeScanner.getFilesInJar(NativeScanner.java:195)
at org.hibernate.ejb.Ejb3Configuration.addScannedEntries(Ejb3Configuration.java:506)
at org.hibernate.ejb.Ejb3Configuration.scanForClasses(Ejb3Configuration.java:861)
... 21 more
Caused by: java.io.IOException: invalid constant type: 18 at 50
And this was and JDK8-Hibernate-javassist problem https://hibernate.atlassian.net/browse/HHH-8286
When upgrade javassist version to 3.18.1-GA - all problems was solved(but why run through gradle worked perfectly...)

Resources