求解:springboot项目打包至外部tomcat部署时启动报错(直接运行war文件没问题)

liuzhen12580 2019-05-07 10:47:42
 .   ____          _            __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.2.0.BUILD-SNAPSHOT)

2019-05-07 22:35:09.874 INFO 7460 --- [ost-startStop-1] c.g.excelimport.ExcelImportApplication : Starting ExcelImportApplication v0.0.1-SNAPSHOT on PC-201905010031 with PID 7460 (D:\Tomcat\apache-tomcat-8.5.29\webapps\ExcelImport-0.0.1-SNAPSHOT\WEB-INF\classes started by Administrator in D:\Tomcat\apache-tomcat-8.5.29\bin)
2019-05-07 22:35:09.880 INFO 7460 --- [ost-startStop-1] c.g.excelimport.ExcelImportApplication : No active profile set, falling back to default profiles: default
2019-05-07 22:35:09.926 INFO 7460 --- [ost-startStop-1] .e.DevToolsPropertyDefaultsPostProcessor : For additional web related logging consider setting the 'logging.level.web' property to 'DEBUG'
2019-05-07 22:35:10.655 WARN 7460 --- [ost-startStop-1] o.m.s.mapper.ClassPathMapperScanner : No MyBatis mapper was found in '[com.glaway.excelimport.dao.mapper]' package. Please check your configuration.
2019-05-07 22:35:11.339 INFO 7460 --- [ost-startStop-1] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 1413 ms
2019-05-07 22:35:11.683 WARN 7460 --- [ost-startStop-1] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'excelImportController': Unsatisfied dependency expressed through field 'excelImportService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'excelImportServiceImpl': Unsatisfied dependency expressed through field 'tableMapper'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'sysTableMapper' defined in file [D:\Tomcat\apache-tomcat-8.5.29\webapps\ExcelImport-0.0.1-SNAPSHOT\WEB-INF\classes\com\glaway\excelimport\dao\SysTableMapper.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-result-maps[0].arg0' to org.apache.ibatis.builder.MapperBuilderAssistant
2019-05-07 22:35:11.702 INFO 7460 --- [ost-startStop-1] ConditionEvaluationReportLoggingListener :

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2019-05-07 22:35:11.708 ERROR 7460 --- [ost-startStop-1] o.s.b.d.LoggingFailureAnalysisReporter :

***************************
APPLICATION FAILED TO START
***************************

Description:

Failed to bind properties under 'mybatis.configuration.incomplete-result-maps[0].arg0' to org.apache.ibatis.builder.MapperBuilderAssistant:

Reason: Failed to bind properties under 'mybatis.configuration.incomplete-result-maps[0].arg0' to org.apache.ibatis.builder.MapperBuilderAssistant

Action:

Update your application's configuration

07-May-2019 22:35:11.709 严重 [localhost-startStop-1] org.apache.catalina.core.ContainerBase.addChildInternal ContainerBase.addChild: start:
org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/ExcelImport-0.0.1-SNAPSHOT]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:754)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:730)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:986)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1857)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'excelImportController': Unsatisfied dependency expressed through field 'excelImportService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'excelImportServiceImpl': Unsatisfied dependency expressed through field 'tableMapper'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'sysTableMapper' defined in file [D:\Tomcat\apache-tomcat-8.5.29\webapps\ExcelImport-0.0.1-SNAPSHOT\WEB-INF\classes\com\glaway\excelimport\dao\SysTableMapper.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-result-maps[0].arg0' to org.apache.ibatis.builder.MapperBuilderAssistant
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:626)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:116)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:385)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1416)
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:199)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:868)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:877)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:142)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:782)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:404)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:319)
at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.run(SpringBootServletInitializer.java:159)
at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.createRootApplicationContext(SpringBootServletInitializer.java:139)
at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.onStartup(SpringBootServletInitializer.java:92)
at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:171)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5204)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 10 more
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'excelImportServiceImpl': Unsatisfied dependency expressed through field 'tableMapper'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'sysTableMapper' defined in file [D:\Tomcat\apache-tomcat-8.5.29\webapps\ExcelImport-0.0.1-SNAPSHOT\WEB-INF\classes\com\glaway\excelimport\dao\SysTableMapper.class]: Unsatisfied depende
...全文
321 6 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
liuzhen12580 2019-05-08
  • 打赏
  • 举报
回复
引用 1 楼 getdate的回复:
这个是不是由于资源文件的位置问题?
那请问资源文件目录需要注意哪些?
getdate 2019-05-08
  • 打赏
  • 举报
回复
引用 2 楼 liuzhen12580 的回复:
[quote=引用 1 楼 getdate的回复:]这个是不是由于资源文件的位置问题?
应该不会,同一个war包使用java -jar命令运行没有问题。[/quote] 你描述的应该是有误的. 首先你确定Java -jar 后面跟的是 war包? 那应该是jar; 其次,你想把springboot 发布到另外的Tomcat的时候,所以修改jar 为 war 了对吧? 这个时候,就应该看资源文件的路径了.
liuzhen12580 2019-05-08
  • 打赏
  • 举报
回复
引用 1 楼 getdate的回复:
这个是不是由于资源文件的位置问题?
应该不会,同一个war包使用java -jar命令运行没有问题。
getdate 2019-05-08
  • 打赏
  • 举报
回复
这个是不是由于资源文件的位置问题?
  • 打赏
  • 举报
回复
尝试下手动注入数据库相关的配置的bean,感觉自动配置好像出了问题
  • 打赏
  • 举报
回复
尝试下手动注入数据库相关的配置的bean,感觉自动配置好像出了问题
在Windows 10或Windows 11操作系统中,用户经常会遇到共享打印机出现的一系列错误代码,这些错误代码可能会阻碍打印机共享功能的正常使用。常见的错误代码包括0x00000057、0x00000709和0x0000011b,这些代码通常指出了不同的问题,比如权限不足、服务未运行或配置错误等。除此之外,还有一些故障提示如“连接失败”或“内存不足”,这些都可能影响到打印机共享的稳定性。 要解决这些故障,首先要确保打印机已经正确地连接到网络,并且在需要共享的电脑上进行了设置。确保打印机驱动程序是最新的,并且在共享设置中有错误配置。对于权限问题,需要检查网络上的用户账户是否具有足够的权限来访问共享打印机。同,也要确保打印机服务正在运行,特别是“Print Spooler”服务,因为这是打印机共享服务的核心组件。 在某些情况下,问题可能与操作系统的更新有关,如升级到最新版的Windows 10或Windows 11后可能出现的兼容性问题。这,可能需要查看微软的官方支持文档来获取特定的解决方案或更新。 对于错误代码0x00000057,这通常是由于有足够的权限来访问网络打印机或其共享资源,解决方法是确保网络打印机的权限设置正确,包括在组策略中设置相应的访问权限。而0x00000709错误可能是由于打印机驱动问题或打印机端口配置错误,可以尝试重新安装或更新打印机驱动来解决。至于0x0000011b错误,这往往是因为打印机队列服务的问题,检查并重启“Print Spooler”服务通常是解决这类问题的常见手段。 至于“连接失败”或“内存不足”这类故障,通常与客户端和打印机之间的网络连接以及打印机本地资源的使用情况有关。检查网络连接,确保打印机所在的网络段有故障或中断。同,如果打印机的打印队列长间得不到处理,可能会导致内存不足的情况,这可能需要清理打印队列或增加打印机的内存配置。 为了帮助用户更快速地解决这些问题,市面上出现了各种打印机共享错误修复工具。这些工具往往通过预设的修复程序来自动检测和修正打印机共享中常见的问题。它们可以快速检查打印机驱动、网络连接以及共享设置,并且能够提供一键修复功能,大幅减少了用户自行排查和解决问题的难度。 然而,在使用这些修复工具之前,用户应确保这些工具的来源是安全可靠的,避免因使用不当的修复工具而引发其他系统安全或隐私问题。用户可以到官方平台或者信誉良好的软件提供商处下载这些工具。通过细心检查打印机的共享设置,及更新驱动程序和服务,以及合理使用修复工具,大多数共享打印机的问题都可以得到有效的解决。

81,122

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧