Deployment failure with the RPM built with latest jenkins - maven

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.

Related

Starting a fresh micronaut app on my machine gives io.micronaut.context.exceptions.BeanInstantiationException

I am trying to run this micronaut app newly on my computer. Note that it works fine on the other peers that are cloning the same application from our local git repo. What is surprising is that the error bean is not being referenced anywhere in the codebase. This is the error when I start ./gradlew run. Tried deleting everything from ~/.gradle/caches but to no avail.
12:35:55.928 [main] ERROR [,] io.micronaut.runtime.Micronaut - Error starting Micronaut server: Error instantiating bean of type [io.micronaut.management.health.indicator.service.ServiceReadyHealthIndicator$ApplicationEventListener$onServerStarted2$Intercepted]: Multiple possible bean candidates found: [io.micronaut.aop.InterceptorRegistry, io.micronaut.aop.InterceptorRegistry]
io.micronaut.context.exceptions.BeanInstantiationException: Error instantiating bean of type [io.micronaut.management.health.indicator.service.ServiceReadyHealthIndicator$ApplicationEventListener$onServerStarted2$Intercepted]: Multiple possible bean candidates found: [io.micronaut.aop.InterceptorRegistry, io.micronaut.aop.InterceptorRegistry]
at io.micronaut.context.DefaultBeanContext.doCreateBean(DefaultBeanContext.java:2267)
at io.micronaut.context.DefaultBeanContext.addCandidateToList(DefaultBeanContext.java:3601)
at io.micronaut.context.DefaultBeanContext.getBeanRegistrations(DefaultBeanContext.java:3477)
at io.micronaut.context.DefaultBeanContext.getBeansOfType(DefaultBeanContext.java:856)
at io.micronaut.context.event.ApplicationEventPublisherFactory$2.lambda$$0(ApplicationEventPublisherFactory.java:217)
at io.micronaut.core.util.SupplierUtil$2.initialize(SupplierUtil.java:77)
at io.micronaut.core.util.SupplierUtil$2.get(SupplierUtil.java:72)
at io.micronaut.context.event.ApplicationEventPublisherFactory$2.publishEvent(ApplicationEventPublisherFactory.java:229)
at io.micronaut.context.DefaultBeanContext.publishEvent(DefaultBeanContext.java:1650)
at io.micronaut.http.server.netty.NettyHttpServer.fireStartupEvents(NettyHttpServer.java:560)
at io.micronaut.http.server.netty.NettyHttpServer.start(NettyHttpServer.java:403)
at io.micronaut.http.server.netty.NettyHttpServer.start(NettyHttpServer.java:155)
at io.micronaut.runtime.Micronaut.lambda$start$2(Micronaut.java:77)
at java.base/java.util.Optional.ifPresent(Optional.java:178)
at io.micronaut.runtime.Micronaut.start(Micronaut.java:75)
at io.micronaut.runtime.Micronaut.run(Micronaut.java:311)
at io.micronaut.runtime.Micronaut.run(Micronaut.java:297)
at com.iss.datadesk.reportapi.Application.main(Application.java:17)
Caused by: io.micronaut.context.exceptions.NonUniqueBeanException: Multiple possible bean candidates found: [io.micronaut.aop.InterceptorRegistry, io.micronaut.aop.InterceptorRegistry]
at io.micronaut.context.DefaultBeanContext.findConcreteCandidate(DefaultBeanContext.java:2331)
at io.micronaut.context.DefaultApplicationContext.findConcreteCandidate(DefaultApplicationContext.java:451)
at io.micronaut.context.DefaultBeanContext.lastChanceResolve(DefaultBeanContext.java:3165)
at io.micronaut.context.DefaultBeanContext.findConcreteCandidateNoCache(DefaultBeanContext.java:3052)
at io.micronaut.context.DefaultBeanContext.findConcreteCandidate(DefaultBeanContext.java:2966)
at io.micronaut.context.DefaultBeanContext.getBeanInternal(DefaultBeanContext.java:2652)
at io.micronaut.context.DefaultBeanContext.getBean(DefaultBeanContext.java:824)
at io.micronaut.aop.chain.InterceptorChain.resolveInterceptors(InterceptorChain.java:205)
at io.micronaut.aop.chain.InterceptorChain.resolveIntroductionInterceptors(InterceptorChain.java:144)
at io.micronaut.management.health.indicator.service.ServiceReadyHealthIndicator$ApplicationEventListener$onServerStarted2$Intercepted.<init>(Unknown Source)
at io.micronaut.management.health.indicator.service.$ServiceReadyHealthIndicator$ApplicationEventListener$onServerStarted2$Intercepted$Definition.build(Unknown Source)
at io.micronaut.context.DefaultBeanContext.doCreateBean(DefaultBeanContext.java:2238)
... 17 common frames omitted

Spring-Boot-Admin application not starting because of error creating bean with name adminHandlerMapping

I am following this blog to try out a Spring-Boot-Admin application. And when I run the app it fails with the below error:
Application run failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name
'adminHandlerMapping' defined in class path resource [de/codecentric/boot/admin/server/config/AdminServerWebConfiguration$ServletRestApiConfirguation.class]:
Invocation of init method failed; nested exception is java.lang.StackOverflowError
I look further below and find these below lines:
at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.8.0_231]
at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49) [spring-boot-devtools-2.2.1.RELEASE.jar:2.2.1.RELEASE]
Caused by: java.lang.StackOverflowError: null
at de.codecentric.boot.admin.server.web.servlet.AdminControllerHandlerMapping.withPrefix(AdminControllerHandlerMapping.java:48) ~[spring-boot-admin-server-2.1.0.jar:2.1.0]
at de.codecentric.boot.admin.server.web.servlet.AdminControllerHandlerMapping.registerHandlerMethod(AdminControllerHandlerMapping.java:44) ~[spring-boot-admin-server-2.1.0.jar:2.1.0]
Not sure if there is some circular dependency in the jars. Any idea please?
The comment by #the hand of NOD made me relook into my pom.xml file and the pom.xml file provided in the blog
The problem lies in the version number of the spring-boot-starter-parent. The tutorial uses a version 2.1.0.RELEASE whereas the latest one when you prepare a project from Spring Intializr is 2.2.1.RELEASE
I downgraded to 2.1.0.RELEASE and it worked! With 2.2.1.RELEASE there is some dependency that is going cyclic with spring-boot-admin-starter-server
P.S. It seems that the codecentric team is already working upon it and would release the 2.2.0 compliant version by 22 Nov 2019 (https://github.com/codecentric/spring-boot-admin/milestones)
It works for me upgrade spring-boot-admin-starter-admin to 2.2.4 and using
spring-boot-starter-parent 2.2.8.RELEASE, spring-boot-admin-starter-client 2.1.6 on service's pom

Eclipse STS run Spring Boot locally with subprojects

I have the following project structure:
root project
|-- controller
|-- core
|-- widgets
|-- widgetA
|-- widgetB
These projects all get built into jars except controller. Then the jars are deployed to a class folder and controller uses context.xml to specify their location.
This all works great during deployment (except Tomcat's 'redeploy' doesn't redeploy, I suspect an issue with classloaders, but an unload/deploy works fine). However, we currently cannot run this locally in STS because the controller needs a bean from the 'widgets' project that the system can't locate.
The project begins fine when I execute the controller project as a Spring Boot App. It loads, and discovers the beans defined in the 'core' project. But for some reason the 'widgets' project is not scanned by Spring. Again, when this is deployed, Spring scans them all just fine (I assume because of the context.xml that defines the JarResources to load). But I just can't seem to figure out how to get STS to "see" the project.
Edit: For clarity, here is the error I am getting:
May 22, 2018 2:32:00 PM org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext refresh
WARNING: Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'Controller': Unsatisfied dependency expressed through field 'widgetMap'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'java.util.Map<java.lang.String, com.mycompany.project.widgets.WidgetInterface>' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {#org.springframework.beans.factory.annotation.Autowired(required=true)}
System is shutting down
May 22, 2018 2:32:00 PM org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor shutdown
INFO: Shutting down ExecutorService 'getAsyncExecutor'
May 22, 2018 2:32:00 PM org.apache.catalina.core.StandardService stopInternal
INFO: Stopping service [Tomcat]
May 22, 2018 2:32:00 PM org.springframework.boot.autoconfigure.logging.ConditionEvaluationReportLoggingListener logAutoConfigurationReport
INFO:
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
May 22, 2018 2:32:00 PM org.springframework.boot.diagnostics.LoggingFailureAnalysisReporter report
SEVERE:
***************************
APPLICATION FAILED TO START
***************************
Description:
Field widgetMap in com.mycompany.project.controller.Controller required a bean of type 'com.mycompany.project.widgets.WidgetInterface' that could not be found.
Action:
Consider defining a bean of type 'com.mycompany.project.widgets.WidgetInterface' in your configuration.
I resolved the issue.
Turns out I was not adding the individual widgets to my build path, but only the 'widgets' class.
Because I was using an #Autowired Map object, I needed at least one of my WidgetInterface implementations on the build path. Since the widget implementation projects were not present, it could not properly instantiate the map, and was erroring out.

Project runs in older version of IDEA, but not newer

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.

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