使用bootRun运行的项目,但不使用java -jar [英] Project running with bootRun but not with java -jar

查看:309
本文介绍了使用bootRun运行的项目,但不使用java -jar的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

gradle bootRun工作和java -jar有类似的问题不是

我用 ./ gradlew bootRun

当我使用 ./ gradlew bootRun 运行项目时,我的项目能够正常工作,但是不能与 java -jar build / libs / my_application运行。 jar 它会给我以下错误:

My project works when I run it with ./gradlew bootRun but not with java -jar build/libs/my_application.jar it gives me the following error:

org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.example.dao.UserDao.insert
    at org.apache.ibatis.binding.MapperMethod$SqlCommand.<init>(MapperMethod.java:230) ~[mybatis-3.4.2.jar!/:3.4.2]
    ...

这里有什么区别?为什么它不能和罐子一起运行?

What's the difference here? Why wouldn't it run with the jar?

推荐答案

考虑到你的后续评论,最可能的解释是 bootRun 从不区分大小写的文件系统读取文件。另一方面,jar中的定位文件区分大小写。

Given your follow up comment, the most likely explanation is that bootRun reads the file from a case insensitive file system. And on the other hand the locating files inside the jar is case sensitive.

这篇关于使用bootRun运行的项目,但不使用java -jar的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆