Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ConditionalOnWebApplication not found after upgrading to 2.9.0 #2481

Closed
gionn opened this issue Jun 12, 2018 · 6 comments
Closed

ConditionalOnWebApplication not found after upgrading to 2.9.0 #2481

gionn opened this issue Jun 12, 2018 · 6 comments

Comments

@gionn
Copy link

gionn commented Jun 12, 2018

I have a classic Spring MVC application (4.3.14.RELEASE) and after upgrading from 2.8.0 to 2.9.0 I get:

[ERROR] com.sun.tools.javac.code.Symbol$CompletionFailure: class file for org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication not found

To workaround the issue, I created an empty annotation class into my classpath:

package org.springframework.boot.autoconfigure.condition;

public @interface ConditionalOnWebApplication
{
}
@dilipkrish dilipkrish added the bug label Jun 12, 2018
@dilipkrish
Copy link
Member

Thanks for reporting!

@dilipkrish
Copy link
Member

Could you try the lates 2.9.1-SNAPSHOT and see if it fixes it

@gionn
Copy link
Author

gionn commented Jun 13, 2018

CI says green! 🥇

@dilipkrish
Copy link
Member

Awesome! thank you for reporting back @gionn

@dilipkrish
Copy link
Member

Fixed via #2438

@cablegunmaster
Copy link

cablegunmaster commented Oct 8, 2019

Can there be a check in the whole project for import org.springframework.boot.* ?
As there are annotations used which uses spring boot and im just using spring.

For example in springfox-swagger2-2.9.2 I found @ConditionalOnWebApplication

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'swagger2ControllerMapping' defined in class path resource [springfox/documentation/swagger2/configuration/Swagger2DocumentationConfiguration.class]: Unsatisfied dependency expressed through method 'swagger2ControllerMapping' parameter 2; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'springfox.documentation.swagger2.mappers.ServiceModelToSwagger2Mapper' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
		at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:787)
		at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:528)
		at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1338)
		at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1177)
		at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:557)
		at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517)
		at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323)
		at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
		at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321)
		at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
		at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:879)
		at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:878)
		at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550)
		at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:401)
		at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:292)
		at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:103)
		at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4683)
		at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5146)
		at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
		at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:717)
		at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:690)
		at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:705)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants