Error at pipeline after increasing version of spring to latest one - spring

After upgrading spring.version from 5.3.18 to 5.3.19 I got the following error in the Jenkins. Do you know the reason behind that error ?
application-logs_1 | APPLICATION FAILED TO START
application-logs_1 | ***************************
application-logs_1 | Description:application-logs_1 | Parameter 6 of constructor in springfox.documentation.spring.web.plugins.DocumentationPluginsBootstrapper required a bean of type 'springfox.documentation.PathProvider' that could not be found.
application-logs_1 | Action:
application-logs_1 | Consider defining a bean of type'springfox.documentation.PathProvider' in your configuration.

Related

Unable to run Micronaut apps

I am exploring security oauth2.0 in micronaut framework with groovy.I generated project from micronaut site.
https://micronaut.io/launch/
Micronaut Version : 2.5.9
Language : Groovy
Build : Gradle
Test Framework : JUnit
When i got below error after running apps
[main] ERROR io.micronaut.runtime.Micronaut - Error starting Micronaut server: Bean definition [io.micronaut.security.oauth2.configuration.OauthClientConfigurationProperties] could not be loaded: Error instantiating bean of type [io.micronaut.security.oauth2.configuration.OauthClientConfigurationProperties]: Could not resolve placeholder ${OAUTH_CLIENT_ID}
io.micronaut.context.exceptions.BeanInstantiationException: Bean definition [io.micronaut.security.oauth2.configuration.OauthClientConfigurationProperties] could not be loaded: Error instantiating bean of type [io.micronaut.security.oauth2.configuration.OauthClientConfigurationProperties]: Could not resolve placeholder ${OAUTH_CLIENT_ID}
at io.micronaut.context.DefaultBeanContext.initializeContext(DefaultBeanContext.java:1568)
at io.micronaut.context.DefaultApplicationContext.initializeContext(DefaultApplicationContext.java:234)
at io.micronaut.context.DefaultBeanContext.readAllBeanDefinitionClasses(DefaultBeanContext.java:2905)
at io.micronaut.context.DefaultBeanContext.start(DefaultBeanContext.java:231)
at io.micronaut.context.DefaultApplicationContext.start(DefaultApplicationContext.java:180)
at io.micronaut.runtime.Micronaut.start(Micronaut.java:71)
at io.micronaut.runtime.Micronaut.run(Micronaut.java:311)
at io.micronaut.runtime.Micronaut.run(Micronaut.java:297)
at com.example.Application.main(Application.groovy:9)
Caused by: io.micronaut.context.exceptions.BeanInstantiationException: Error instantiating bean of type [io.micronaut.security.oauth2.configuration.OauthClientConfigurationProperties]: Could not resolve placeholder ${OAUTH_CLIENT_ID}
at io.micronaut.context.DefaultBeanContext.doCreateBean(DefaultBeanContext.java:2008)
at io.micronaut.context.DefaultBeanContext.createAndRegisterSingletonInternal(DefaultBeanContext.java:2768)
at io.micronaut.context.DefaultBeanContext.createAndRegisterSingleton(DefaultBeanContext.java:2754)
at io.micronaut.context.DefaultBeanContext.loadContextScopeBean(DefaultBeanContext.java:2292)
at io.micronaut.context.DefaultBeanContext.initializeContext(DefaultBeanContext.java:1562)
... 8 common frames omitted
Caused by: io.micronaut.context.exceptions.ConfigurationException: Could not resolve placeholder ${OAUTH_CLIENT_ID}
at io.micronaut.context.env.DefaultPropertyPlaceholderResolver$PlaceholderSegment.getValue(DefaultPropertyPlaceholderResolver.java:260)
at io.micronaut.context.env.DefaultPropertyPlaceholderResolver.resolveRequiredPlaceholders(DefaultPropertyPlaceholderResolver.java:86)
at io.micronaut.context.env.PropertySourcePropertyResolver.resolvePlaceHoldersIfNecessary(PropertySourcePropertyResolver.java:799)
at io.micronaut.context.env.PropertySourcePropertyResolver.getProperty(PropertySourcePropertyResolver.java:303)
at io.micronaut.context.DefaultApplicationContext.getProperty(DefaultApplicationContext.java:200)
at io.micronaut.context.AbstractBeanDefinition.resolveValue(AbstractBeanDefinition.java:1946)
at io.micronaut.context.AbstractBeanDefinition.getValueForMethodArgument(AbstractBeanDefinition.java:793)
at io.micronaut.security.oauth2.configuration.$OauthClientConfigurationPropertiesDefinition.injectBean(Unknown Source)
at io.micronaut.security.oauth2.configuration.$OauthClientConfigurationPropertiesDefinition.doBuild(Unknown Source)
at io.micronaut.context.AbstractParametrizedBeanDefinition.build(AbstractParametrizedBeanDefinition.java:118)
at io.micronaut.context.BeanDefinitionDelegate.build(BeanDefinitionDelegate.java:149)
at io.micronaut.context.DefaultBeanContext.doCreateBean(DefaultBeanContext.java:1979)
... 12 common frames omitted
> Task :run FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':run'.
> Process 'command 'C:\Program Files\Java\jdk1.8.0_121\bin\java.exe'' finished with non-zero exit value 1
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 14s
3 actionable tasks: 3 executed
Provide the oauth configuration as specified in the docs:
https://guides.micronaut.io/latest/micronaut-oauth2-github-gradle-java.html#oauth-2-0-configuration
i.e. client-id: '${OAUTH_CLIENT_ID:defaultToken}'
Replace defaultToken with whatever your token is

Package dependency issues in Apache Karaf 3.x with Spring 3.2.x Spring-dm 1.2.1

I am trying to deploy a camel bundle in karaf 3.0.1 which uses spring dm. When bundle is deployed, it is not getting resolved due to spring package dependency. Following are more details, please help me to resolve this issue. Do I need to revert back to spring 2.x version?
Complaining Package Dependency
------------------------------
org.springframework.osgi.context;version="[2.0,3)"
Installed Spring features
--------------------------
karaf#root()> feature:list -i | grep spring
camel-spring | 2.13.0 | x | camel-2.13.0 |
spring-dm | 1.2.1 | x | spring-3.0.1 | Spring DM support
spring | 3.2.4.RELEASE | x | spring-3.0.1 | Spring 3.2.x support
spring-jms | 3.2.4.RELEASE | x | spring-3.0.1 | Spring 3.2.x JMS support
spring-tx | 3.2.4.RELEASE | x | spring-3.0.1 | Spring 3.2.x Transaction (TX) support
spring | 4.0.2.RELEASE_1 | x | spring-3.0.1 | Spring 4.0.x support
Spring-dm feature info
----------------------
karaf#root()> feature:info spring-dm
Feature spring-dm 1.2.1
Description:
Spring DM support
Feature has no configuration
Feature has no configuration files
Feature depends on:
spring [2.5.6,4)
Feature contains followed bundles:
mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.cglib/3.0_1 start-level=30
mvn:org.springframework.osgi/spring-osgi-io/1.2.1 start-level=30
mvn:org.springframework.osgi/spring-osgi-core/1.2.1 start-level=30
mvn:org.springframework.osgi/spring-osgi-extender/1.2.1 start-level=30
mvn:org.springframework.osgi/spring-osgi-annotation/1.2.1 start-level=30
mvn:org.apache.karaf.deployer/org.apache.karaf.deployer.spring/3.0.1 start-level=30
mvn:org.apache.karaf.bundle/org.apache.karaf.bundle.springstate/3.0.1 start-level=30
Feature has no conditionals.

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

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...)

org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions

I am developing a OSGI based Spring MVC application, I am using Karaf for deploying the bundles. My spring MVC application is a war file. I placed my bundle file in the deploy directory
karaf#root()> web:list
ID | State | Web-State | Level | Web-ContextPath | Name
125 | Active | Deployed | 80 | /sample | tomcat-sample (0)
168 | Active | Deployed | 80 | /spring-kalees-mvc-host | spring-kalees-mvc-host (0.0.1.SNAPSHOT)
I am having a servlet(To verify teh bundle) and Others are Spring
Url: http://*a****t:8181/spring-kalees-mvc-host/hello (Servlet mapping) works fine
But,
Url : http://*a*****t:8181/spring-kalees-mvc-host/osgi/osgi.htm (Spring based controller ) is not working
It is throwing error like,
HTTP ERROR 503
Problem accessing /spring-kalees-mvc-host/osgi/saySomething. Reason:
org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are:
PropertyAccessException 1: org.springframework.beans.TypeMismatchException: Failed to convert property value of type 'java.lang.String' to required type 'java.lang.Class' for property 'contextClass'; nested exception is java.lang.IllegalArgumentException: Cannot find class [org.springframework.osgi.web.context.support.OsgiBundleXmlWebApplicationContext]
Caused by:
org.eclipse.jetty.servlet.ServletHolder$1: org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are:
PropertyAccessException 1: org.springframework.beans.TypeMismatchException: Failed to convert property value of type 'java.lang.String' to required type 'java.lang.Class' for property 'contextClass'; nested exception is java.lang.IllegalArgumentException: Cannot find class [org.springframework.osgi.web.context.support.OsgiBundleXmlWebApplicationContext]
at org.eclipse.jetty.servlet.ServletHolder.makeUnavailable(ServletHolder.java:483)
at org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:537)
at org.eclipse.jetty.servlet.ServletHolder.getServlet(ServletHolder.java:402)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:642)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1448)
at org.ops4j.pax.web.service.internal.WelcomeFilesFilter.doFilter(WelcomeFilesFilter.java:192)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1419)
In karaf log file, There was a error entry like below :
org.ops4j.pax.web.pax-web-extender-war - 3.0.0.M3 | Registration exception. Skipping.
java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener not found by org.danielsoft.learn.spring-kalees-mvc-host [167]
at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1460)[org.apache.felix.framework-4.0.3.jar:]
at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:72)[org.apache.felix.framework-4.0.3.jar:]
at
I specified the classpath like
<classpath>WEB-INF/lib,WEB-INF/lib/org.springframework.context-3.2.2.RELEASE.jar,WEB-INF/lib/org.springframework.context.support-3.2.2.RELEASE.jar,WEB-INF/classes/,.</classpath>
And packed war file with lib files(WEB-INF/lib)
My bundle information is
Any Idea on this error ?

Resources