Skip to content

Cannot deploy war file to the Tomcat with Spring Boot 2.2.0.M3 #350

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

Closed
thpy opened this issue Jun 10, 2019 · 23 comments
Closed

Cannot deploy war file to the Tomcat with Spring Boot 2.2.0.M3 #350

thpy opened this issue Jun 10, 2019 · 23 comments

Comments

@thpy
Copy link

thpy commented Jun 10, 2019

I can run as spring boot, but I can't run on tomcat, my spring boot is 2.2.0.M3

Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'menuMapper' defined in file [D:\Program Files\apache-tomcat-8.0.15\webapps\menu\WEB-INF\classes\com\foxconn\menu\mapper\MenuMapper.class]: Unsatisfied dependency expressed through bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.mybatis.spring.boot.autoconfigure.MybatisAutoConfiguration': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.boot.context.properties.ConfigurationPropertiesBindException: Error creating bean with name 'mybatis-org.mybatis.spring.boot.autoconfigure.MybatisProperties': Could not bind properties to 'MybatisProperties' : prefix=mybatis, ignoreInvalidFields=false, ignoreUnknownFields=true; nested exception is org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under 'mybatis.configuration.incomplete-cache-refs[0].arg0' to org.apache.ibatis.builder.MapperBuilderAssistant
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireByType(AbstractAutowireCapableBeanFactory.java:1520)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1400)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:592)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515)
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:204)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.resolveBeanByName(AbstractAutowireCapableBeanFactory.java:452)
	at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.autowireResource(CommonAnnotationBeanPostProcessor.java:542)
	at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.getResource(CommonAnnotationBeanPostProcessor.java:512)
	at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor$ResourceElement.getResourceToInject(CommonAnnotationBeanPostProcessor.java:652)
	at org.springframework.beans.factory.annotation.InjectionMetadata$InjectedElement.inject(InjectionMetadata.java:224)
	at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:116)
	at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessProperties(CommonAnnotationBeanPostProcessor.java:333)
	... 43 more
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.mybatis.spring.boot.autoconfigure.MybatisAutoConfiguration': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.boot.context.properties.ConfigurationPropertiesBindException: Error creating bean with name 'mybatis-org.mybatis.spring.boot.autoconfigure.MybatisProperties': Could not bind properties to 'MybatisProperties' : prefix=mybatis, ignoreInvalidFields=false, ignoreUnknownFields=true; nested exception is org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under 'mybatis.configuration.incomplete-cache-refs[0].arg0' to org.apache.ibatis.builder.MapperBuilderAssistant
	at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:780)
	at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:219)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1345)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1191)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515)
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
	at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:393)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1325)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1164)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515)
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
	at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:277)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1273)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1193)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireByType(AbstractAutowireCapableBeanFactory.java:1505)
	... 57 more
Caused by: org.springframework.boot.context.properties.ConfigurationPropertiesBindException: Error creating bean with name 'mybatis-org.mybatis.spring.boot.autoconfigure.MybatisProperties': Could not bind properties to 'MybatisProperties' : prefix=mybatis, ignoreInvalidFields=false, ignoreUnknownFields=true; nested exception is org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under 'mybatis.configuration.incomplete-cache-refs[0].arg0' to org.apache.ibatis.builder.MapperBuilderAssistant
	at org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor.bind(ConfigurationPropertiesBindingPostProcessor.java:126)
	at org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor.postProcessBeforeInitialization(ConfigurationPropertiesBindingPostProcessor.java:99)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:414)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1775)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:593)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515)
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
	at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:277)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1273)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1193)
	at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:868)
	at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:771)
	... 79 more
Caused by: org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under 'mybatis.configuration.incomplete-cache-refs[0].arg0' to org.apache.ibatis.builder.MapperBuilderAssistant
	at org.springframework.boot.context.properties.bind.Binder.handleBindError(Binder.java:250)
	at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:226)
	at org.springframework.boot.context.properties.bind.Binder.lambda$bindBean$3(Binder.java:341)
	at org.springframework.boot.context.properties.bind.ConstructorParametersBinder.bind(ConstructorParametersBinder.java:87)
	at org.springframework.boot.context.properties.bind.ConstructorParametersBinder.bind(ConstructorParametersBinder.java:65)
	at org.springframework.boot.context.properties.bind.ConstructorParametersBinder.bind(ConstructorParametersBinder.java:56)
	at org.springframework.boot.context.properties.bind.Binder.lambda$null$4(Binder.java:345)
	at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
	at java.util.ArrayList$ArrayListSpliterator.tryAdvance(ArrayList.java:1351)
	at java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:126)
	at java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:498)
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:485)
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
	at java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:152)
	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:464)
	at org.springframework.boot.context.properties.bind.Binder.lambda$bindBean$5(Binder.java:346)
	at org.springframework.boot.context.properties.bind.Binder$Context.withIncreasedDepth(Binder.java:449)
	at org.springframework.boot.context.properties.bind.Binder$Context.withBean(Binder.java:435)
	at org.springframework.boot.context.properties.bind.Binder$Context.access$500(Binder.java:389)
	at org.springframework.boot.context.properties.bind.Binder.bindBean(Binder.java:343)
	at org.springframework.boot.context.properties.bind.Binder.bindObject(Binder.java:279)
	at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:221)
	at org.springframework.boot.context.properties.bind.Binder.lambda$null$0(Binder.java:301)
	at org.springframework.boot.context.properties.bind.Binder$Context.withSource(Binder.java:425)
	at org.springframework.boot.context.properties.bind.Binder$Context.access$1000(Binder.java:389)
	at org.springframework.boot.context.properties.bind.Binder.lambda$bindAggregate$1(Binder.java:303)
	at org.springframework.boot.context.properties.bind.IndexedElementsBinder.bindIndexed(IndexedElementsBinder.java:113)
	at org.springframework.boot.context.properties.bind.IndexedElementsBinder.bindIndexed(IndexedElementsBinder.java:89)
	at org.springframework.boot.context.properties.bind.IndexedElementsBinder.bindIndexed(IndexedElementsBinder.java:71)
	at org.springframework.boot.context.properties.bind.CollectionBinder.bindAggregate(CollectionBinder.java:51)
	at org.springframework.boot.context.properties.bind.AggregateBinder.bind(AggregateBinder.java:58)
	at org.springframework.boot.context.properties.bind.Binder.lambda$bindAggregate$2(Binder.java:306)
	at org.springframework.boot.context.properties.bind.Binder$Context.withIncreasedDepth(Binder.java:449)
	at org.springframework.boot.context.properties.bind.Binder$Context.access$200(Binder.java:389)
	at org.springframework.boot.context.properties.bind.Binder.bindAggregate(Binder.java:305)
	at org.springframework.boot.context.properties.bind.Binder.bindObject(Binder.java:263)
	at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:221)
	at org.springframework.boot.context.properties.bind.Binder.lambda$bindBean$3(Binder.java:341)
	at org.springframework.boot.context.properties.bind.JavaBeanBinder.bind(JavaBeanBinder.java:83)
	at org.springframework.boot.context.properties.bind.JavaBeanBinder.bind(JavaBeanBinder.java:72)
	at org.springframework.boot.context.properties.bind.JavaBeanBinder.bind(JavaBeanBinder.java:54)
	at org.springframework.boot.context.properties.bind.Binder.lambda$null$4(Binder.java:345)
	at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
	at java.util.ArrayList$ArrayListSpliterator.tryAdvance(ArrayList.java:1351)
	at java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:126)
	at java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:498)
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:485)
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
	at java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:152)
	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:464)
	at org.springframework.boot.context.properties.bind.Binder.lambda$bindBean$5(Binder.java:346)
	at org.springframework.boot.context.properties.bind.Binder$Context.withIncreasedDepth(Binder.java:449)
	at org.springframework.boot.context.properties.bind.Binder$Context.withBean(Binder.java:435)
	at org.springframework.boot.context.properties.bind.Binder$Context.access$500(Binder.java:389)
	at org.springframework.boot.context.properties.bind.Binder.bindBean(Binder.java:343)
	at org.springframework.boot.context.properties.bind.Binder.bindObject(Binder.java:279)
	at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:221)
	at org.springframework.boot.context.properties.bind.Binder.lambda$bindBean$3(Binder.java:341)
	at org.springframework.boot.context.properties.bind.JavaBeanBinder.bind(JavaBeanBinder.java:83)
	at org.springframework.boot.context.properties.bind.JavaBeanBinder.bind(JavaBeanBinder.java:72)
	at org.springframework.boot.context.properties.bind.JavaBeanBinder.bind(JavaBeanBinder.java:54)
	at org.springframework.boot.context.properties.bind.Binder.lambda$null$4(Binder.java:345)
	at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
	at java.util.ArrayList$ArrayListSpliterator.tryAdvance(ArrayList.java:1351)
	at java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:126)
	at java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:498)
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:485)
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
	at java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:152)
	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:464)
	at org.springframework.boot.context.properties.bind.Binder.lambda$bindBean$5(Binder.java:346)
	at org.springframework.boot.context.properties.bind.Binder$Context.withIncreasedDepth(Binder.java:449)
	at org.springframework.boot.context.properties.bind.Binder$Context.withBean(Binder.java:435)
	at org.springframework.boot.context.properties.bind.Binder$Context.access$500(Binder.java:389)
	at org.springframework.boot.context.properties.bind.Binder.bindBean(Binder.java:343)
	at org.springframework.boot.context.properties.bind.Binder.bindObject(Binder.java:279)
	at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:221)
	at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:209)
	at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:191)
	at org.springframework.boot.context.properties.ConfigurationPropertiesBinder.bind(ConfigurationPropertiesBinder.java:98)
	at org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor.bind(ConfigurationPropertiesBindingPostProcessor.java:123)
	... 93 more
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.ibatis.builder.MapperBuilderAssistant]: Constructor threw exception; nested exception is java.lang.NullPointerException
	at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:213)
	at org.springframework.boot.context.properties.bind.ConstructorParametersBinder.bind(ConstructorParametersBinder.java:57)
	at org.springframework.boot.context.properties.bind.Binder.lambda$null$4(Binder.java:345)
	at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
	at java.util.ArrayList$ArrayListSpliterator.tryAdvance(ArrayList.java:1351)
	at java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:126)
	at java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:498)
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:485)
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
	at java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:152)
	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:464)
	at org.springframework.boot.context.properties.bind.Binder.lambda$bindBean$5(Binder.java:346)
	at org.springframework.boot.context.properties.bind.Binder$Context.withIncreasedDepth(Binder.java:449)
	at org.springframework.boot.context.properties.bind.Binder$Context.withBean(Binder.java:435)
	at org.springframework.boot.context.properties.bind.Binder$Context.access$500(Binder.java:389)
	at org.springframework.boot.context.properties.bind.Binder.bindBean(Binder.java:343)
	at org.springframework.boot.context.properties.bind.Binder.bindObject(Binder.java:279)
	at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:221)
	... 175 more
Caused by: java.lang.NullPointerException
	at org.apache.ibatis.builder.BaseBuilder.<init>(BaseBuilder.java:41)
	at org.apache.ibatis.builder.MapperBuilderAssistant.<init>(MapperBuilderAssistant.java:62)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:200)
	... 193 more
@thpy
Copy link
Author

thpy commented Jun 10, 2019

Any one can help?

@mallim
Copy link
Contributor

mallim commented Jun 10, 2019

What is your application.properties or applicaton.yml ?

@thpy
Copy link
Author

thpy commented Jun 10, 2019

This is my pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<parent>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-parent</artifactId>
		<version>2.2.0.M3</version>
		<relativePath/> <!-- lookup parent from repository -->
	</parent>
	<groupId>com.foxconn</groupId>
	<artifactId>menu</artifactId>
	<version>0.0.1-SNAPSHOT</version>
	<packaging>war</packaging>
	<name>menu</name>
	<description>菜單接口</description>

	<properties>
		<java.version>1.8</java.version>
	</properties>

	<dependencies>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-web</artifactId>
		</dependency>
		<dependency>
			<groupId>org.mybatis.spring.boot</groupId>
			<artifactId>mybatis-spring-boot-starter</artifactId>
			<version>2.0.1</version>
		</dependency>

		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-tomcat</artifactId>
			<!--scope>provided</scope-->
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-test</artifactId>
			<scope>test</scope>
			<exclusions>
				<exclusion>
					<groupId>org.junit.vintage</groupId>
					<artifactId>junit-vintage-engine</artifactId>
				</exclusion>
				<exclusion>
					<groupId>junit</groupId>
					<artifactId>junit</artifactId>
				</exclusion>
			</exclusions>
		</dependency>
		<dependency>
			<groupId>com.oracle</groupId>
			<artifactId>ojdbc6</artifactId>
			<version>11.2.0.4.0-atlassian-hosted</version>
		</dependency>
		<!--dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-jdbc</artifactId>
		</dependency-->
	</dependencies>

	<build>
		<finalName>menu</finalName>
		<plugins>
			<plugin>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-maven-plugin</artifactId>
			</plugin>
		</plugins>
	</build>

	<repositories>
		<repository>
			<id>spring-snapshots</id>
			<name>Spring Snapshots</name>
			<url>https://repo.spring.io/snapshot</url>
			<snapshots>
				<enabled>true</enabled>
			</snapshots>
		</repository>
		<repository>
			<id>spring-milestones</id>
			<name>Spring Milestones</name>
			<url>https://repo.spring.io/milestone</url>
		</repository>
	</repositories>
	<pluginRepositories>
		<pluginRepository>
			<id>spring-snapshots</id>
			<name>Spring Snapshots</name>
			<url>https://repo.spring.io/snapshot</url>
			<snapshots>
				<enabled>true</enabled>
			</snapshots>
		</pluginRepository>
		<pluginRepository>
			<id>spring-milestones</id>
			<name>Spring Milestones</name>
			<url>https://repo.spring.io/milestone</url>
		</pluginRepository>
	</pluginRepositories>

</project>

@kazuki43zoo
Copy link
Member

Could you provide small reproduce project via GitHub?

@thpy
Copy link
Author

thpy commented Jun 10, 2019

My application.properties

server.port=8080
spring.jmx.enabled=false
server.servlet.context-path=/menu
spring.datasource.url=jdbc:oracle:thin:@******:1521/xtwl
spring.datasource.username=******
spring.datasource.password=*******
spring.datasource.driver-class-name=oracle.jdbc.OracleDriver
mybatis.configuration.cacheEnabled=false

@mallim
Copy link
Contributor

mallim commented Jun 10, 2019

Please check the documentation on this property: mybatis.configuration.cacheEnabled

Your error is related to this.

@thpy
Copy link
Author

thpy commented Jun 10, 2019

my project urlmyproject @kazuki43zoo

@kazuki43zoo
Copy link
Member

@thpy Thanks!

@thpy
Copy link
Author

thpy commented Jun 10, 2019

It 's also not work @mallim

server.port=8080
spring.jmx.enabled=false
server.servlet.context-path=/menu
spring.datasource.url=jdbc:oracle:thin:@*********:1521/xtwl
spring.datasource.username=*****
spring.datasource.password=*****
spring.datasource.driver-class-name=oracle.jdbc.OracleDriver

@thpy
Copy link
Author

thpy commented Jun 10, 2019

No solution?

@kazuki43zoo
Copy link
Member

I will investigating for fix this problem now.

I have one question. Is need to get configuration properties via JNDI? If you does not use JNDI, you can prevent this error as adding -Dspring.jndi.ignore=true on JVM argument of Tomcat.

@thpy
Copy link
Author

thpy commented Jun 10, 2019

Our production have JNDI for another project.

@kazuki43zoo
Copy link
Member

OK. The spring.jndi.ignore=true can specify on spring.properties just under classpath on your application too.

e.g.)

  • src/main/resources/spring.properties
spring.jndi.ignore=true

@kazuki43zoo
Copy link
Member

I've created spring-projects/spring-boot#17098.

@kazuki43zoo kazuki43zoo changed the title can not run on tomcat Cannot deploy war file to the Tomcat with Spring Boot 2.2.0 Jun 10, 2019
@kazuki43zoo
Copy link
Member

@thpy Probably, this issue belong the Spring Boot. Please watch the spring-projects/spring-boot#17098.

Thanks.

@thpy
Copy link
Author

thpy commented Jun 11, 2019

Ok, It's work when I add that. Thanks @kazuki43zoo

spring.jndi.ignore=true

@kazuki43zoo
Copy link
Member

Closed because this issue fixed via spring-boot 2.2.0.M4.

@thpy Please try again using spring-boot 2.2.0.M4 If you have a time.

@kazuki43zoo kazuki43zoo changed the title Cannot deploy war file to the Tomcat with Spring Boot 2.2.0 Cannot deploy war file to the Tomcat with Spring Boot 2.2.0.M3 Jun 19, 2019
@eheads
Copy link

eheads commented Jul 9, 2019

image

seems not working on yaml file.

image

@eheads
Copy link

eheads commented Jul 9, 2019

I tried

Closed because this issue fixed via spring-boot 2.2.0.M4.

@thpy Please try again using spring-boot 2.2.0.M4 If you have a time.

I tried 2.2.0M4 but seems like issue is still there:

image

@kazuki43zoo
Copy link
Member

kazuki43zoo commented Jul 9, 2019

seems not working on yaml file.

spring.jndi.ignore cannot specify on application.properties or application.yml. It need to specify the spring.properties just under classpath. See #350 (comment).

@kazuki43zoo
Copy link
Member

I tried 2.2.0M4 but seems like issue is still there:

It is not possible to judge the same problem only by the information of the screenshot.
Could you provide small reproduce project?

@planckzone
Copy link

[SOLVED]

I faced the same issue while creating a WAR from spring boot and deploying it to an external tomcat (eg: xampp provided tomcat which had Tomcat version: 7)

Was facing issue with the following:
Spring Boot Version: 2
Tomcat Version: 7

I installed a separate Tomcat Server with its latest version (9.0) and deployed the WAR there, which solved the issue for me.

@hazendaz
Copy link
Member

hazendaz commented Jan 7, 2020 via email

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

6 participants