<main>
<script type="text/javascript">
var blogSensitiveWords = "";
jar中没有主清单属性【解决办法】
-
<build>
-
<plugin>
-
<groupId>org.springframework.boot
</groupId>
-
<artifactId>spring-boot-maven-plugin
</artifactId>
-
</plugin>
-
</plugins>
-
-
</build>
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2020-03-25 14:08:26.904 logback [main] ERROR o.s.boot.SpringApplication - Application run failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [org/mybatis/spring/boot/autoconfigure/MybatisAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.ibatis.session.SqlSessionFactory]: Factory method 'sqlSessionFactory' threw exception; nested exception is org.apache.ibatis.type.TypeException: The alias 'EmployeeRegisterDao' is already mapped to the value 'com.hy.oa.dao.redis.employee.EmployeeRegisterDao'.
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:627)
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:607)
Error creating bean with name 'sqlSessionFactory' defined in class path resource
注释掉下面就好了
-
#
# 所有POJO类所在包路径
-
#
mybatis.type-aliases-package=com.hy.oa.dao
-
#
-
#
# mapper映射文件
-
#
mybatis.mapper-locations=classpath*:/sql/**/*.xml
-
有的时候还不行,要加上下面这个
-
java运行jar命令提示没有主清单属性 -
-
<parent>
-
<groupId>org.springframework.boot
</groupId>
-
<artifactId>spring-boot-starter-parent
</artifactId>
-
<version>2.1.6.RELEASE
</version>
-
<relativePath/>
<!-- lookup parent from repository -->
-
</parent>
最终解决方案2020年7月5日
-
-
<build>
-
<plugins>
-
<plugin>
-
<groupId>org.apache.maven.plugins
</groupId>
-
<artifactId>maven-compiler-plugin
</artifactId>
-
<configuration>
-
<source>1.8
</source>
-
<target>1.8
</target>
-
</configuration>
-
</plugin>
-
<plugin>
-
<groupId>org.springframework.boot
</groupId>
-
<artifactId>spring-boot-maven-plugin
</artifactId>
-
<executions>
-
<execution>
-
<goals>
-
<goal>repackage
</goal>
-
</goals>
-
</execution>
-
</executions>
-
</plugin>
-
</plugins>
-
</build>
显示推荐内容
- 点赞 1
- 评论
- 收藏 1
- 手机看
分享到微信朋友圈
x扫一扫,手机阅读
</li>
<!--打赏结束-->
<li class="tool-item tool-active tool-more">
<a>
<img class="tool-more-img" src="https://csdnimg.cn/release/phoenix/template/new_img/lookMore.png" alt="">
</a>
<ul class="more-box">
<li class="item item-report"><a class="article-report">文章举报</a></li>
</ul>
</li>
<li class="tool-item">
<a class="tool-attend tool-bt-button tool-bt-attend" href="javascript:;">关注</a>
</li>
</ul>
<div style="display:flex">
<!-- <a class="tool-mover-open" id="btn-readmore" style="display: none;" data-type="0" data-report-view='{"mod":"popu_376","spm":"1001.2101.3001.4232","dest":"https://blog.csdn.net/bluewelkin/article/details/105090413","strategy":"packupbar","ab":"new"}' data-report-click='{"mod":"popu_376","spm":"1001.2101.3001.4232","dest":"https://blog.csdn.net/bluewelkin/article/details/105090413","strategy":"packupbar","ab":"new"}'>
<span>收起全文</span>
<img id="btn-close-img" style="display: block;" src="https://csdnimg.cn/release/phoenix/template/new_img/CommentArrow.png" alt="">
</a> -->
</div>
</div>
<a id="commentBox" name="commentBox"></a>
<!-- <div class="recommend-item-box type_hot_word">
<div class="content clearfix">
<div class="float-left">
<span>
<a href="https://java.csdn.net/" data-report-click='{"mod":"1586412712_001","ab":"new","dest":"https://java.csdn.net/","index":"索引#"}' data-report-view='{"mod":"1586412712_001","ab":"new","dest":"https://java.csdn.net/","index":"#"}' target="_blank">
Java</a>
</span>
<span>
<a href="https://c1.csdn.net/" data-report-click='{"mod":"1586412712_001","ab":"new","dest":"https://c1.csdn.net/","index":"索引#"}' data-report-view='{"mod":"1586412712_001","ab":"new","dest":"https://c1.csdn.net/","index":"#"}' target="_blank">
C语言</a>
</span>
<span>
<a href="https://python.csdn.net/" data-report-click='{"mod":"1586412712_001","ab":"new","dest":"https://python.csdn.net/","index":"索引#"}' data-report-view='{"mod":"1586412712_001","ab":"new","dest":"https://python.csdn.net/","index":"#"}' target="_blank">
Python</a>
</span>
<span>
<a href="https://cplus.csdn.net/" data-report-click='{"mod":"1586412712_001","ab":"new","dest":"https://cplus.csdn.net/","index":"索引#"}' data-report-view='{"mod":"1586412712_001","ab":"new","dest":"https://cplus.csdn.net/","index":"#"}' target="_blank">
C++</a>
</span>
<span>
<a href="https://csharp.csdn.net/" data-report-click='{"mod":"1586412712_001","ab":"new","dest":"https://csharp.csdn.net/","index":"索引#"}' data-report-view='{"mod":"1586412712_001","ab":"new","dest":"https://csharp.csdn.net/","index":"#"}' target="_blank">
C#</a>
</span>
<span>
<a href="https://vbn.csdn.net/" data-report-click='{"mod":"1586412712_001","ab":"new","dest":"https://vbn.csdn.net/","index":"索引#"}' data-report-view='{"mod":"1586412712_001","ab":"new","dest":"https://vbn.csdn.net/","index":"#"}' target="_blank">
Visual Basic .NET</a>
</span>
<span>
<a href="https://js.csdn.net/" data-report-click='{"mod":"1586412712_001","ab":"new","dest":"https://js.csdn.net/","index":"索引#"}' data-report-view='{"mod":"1586412712_001","ab":"new","dest":"https://js.csdn.net/","index":"#"}' target="_blank">
JavaScript</a>
</span>
<span>
<a href="https://php.csdn.net/" data-report-click='{"mod":"1586412712_001","ab":"new","dest":"https://php.csdn.net/","index":"索引#"}' data-report-view='{"mod":"1586412712_001","ab":"new","dest":"https://php.csdn.net/","index":"#"}' target="_blank">
PHP</a>
</span>
<span>
<a href="https://sql.csdn.net/" data-report-click='{"mod":"1586412712_001","ab":"new","dest":"https://sql.csdn.net/","index":"索引#"}' data-report-view='{"mod":"1586412712_001","ab":"new","dest":"https://sql.csdn.net/","index":"#"}' target="_blank">
SQL</a>
</span>
<span>
<a href="https://go.csdn.net/" data-report-click='{"mod":"1586412712_001","ab":"new","dest":"https://go.csdn.net/","index":"索引#"}' data-report-view='{"mod":"1586412712_001","ab":"new","dest":"https://go.csdn.net/","index":"#"}' target="_blank">
Go语言</a>
</span>
<span>
<a href="https://r.csdn.net/" data-report-click='{"mod":"1586412712_001","ab":"new","dest":"https://r.csdn.net/","index":"索引#"}' data-report-view='{"mod":"1586412712_001","ab":"new","dest":"https://r.csdn.net/","index":"#"}' target="_blank">
R语言</a>
</span>
<span>
<a href="https://assembly.csdn.net/" data-report-click='{"mod":"1586412712_001","ab":"new","dest":"https://assembly.csdn.net/","index":"索引#"}' data-report-view='{"mod":"1586412712_001","ab":"new","dest":"https://assembly.csdn.net/","index":"#"}' target="_blank">
Assembly language</a>
</span>
<span>
<a href="https://swift.csdn.net/" data-report-click='{"mod":"1586412712_001","ab":"new","dest":"https://swift.csdn.net/","index":"索引#"}' data-report-view='{"mod":"1586412712_001","ab":"new","dest":"https://swift.csdn.net/","index":"#"}' target="_blank">
Swift</a>
</span>
<span>
<a href="https://ruby.csdn.net/" data-report-click='{"mod":"1586412712_001","ab":"new","dest":"https://ruby.csdn.net/","index":"索引#"}' data-report-view='{"mod":"1586412712_001","ab":"new","dest":"https://ruby.csdn.net/","index":"#"}' target="_blank">
Ruby</a>
</span>
<span>
<a href="https://matlab.csdn.net/" data-report-click='{"mod":"1586412712_001","ab":"new","dest":"https://matlab.csdn.net/","index":"索引#"}' data-report-view='{"mod":"1586412712_001","ab":"new","dest":"https://matlab.csdn.net/","index":"#"}' target="_blank">
MATLAB</a>
</span>
<span>
<a href="https://plsql.csdn.net/" data-report-click='{"mod":"1586412712_001","ab":"new","dest":"https://plsql.csdn.net/","index":"索引#"}' data-report-view='{"mod":"1586412712_001","ab":"new","dest":"https://plsql.csdn.net/","index":"#"}' target="_blank">
PL/SQL</a>
</span>
<span>
<a href="https://perl.csdn.net/" data-report-click='{"mod":"1586412712_001","ab":"new","dest":"https://perl.csdn.net/","index":"索引#"}' data-report-view='{"mod":"1586412712_001","ab":"new","dest":"https://perl.csdn.net/","index":"#"}' target="_blank">
Perl</a>
</span>
<span>
<a href="https://vb.csdn.net/" data-report-click='{"mod":"1586412712_001","ab":"new","dest":"https://vb.csdn.net/","index":"索引#"}' data-report-view='{"mod":"1586412712_001","ab":"new","dest":"https://vb.csdn.net/","index":"#"}' target="_blank">
Visual Basic</a>
</span>
<span>
<a href="https://obj.csdn.net/" data-report-click='{"mod":"1586412712_001","ab":"new","dest":"https://obj.csdn.net/","index":"索引#"}' data-report-view='{"mod":"1586412712_001","ab":"new","dest":"https://obj.csdn.net/","index":"#"}' target="_blank">
Objective-C</a>
</span>
<span>
<a href="https://delphi.csdn.net/" data-report-click='{"mod":"1586412712_001","ab":"new","dest":"https://delphi.csdn.net/","index":"索引#"}' data-report-view='{"mod":"1586412712_001","ab":"new","dest":"https://delphi.csdn.net/","index":"#"}' target="_blank">
Delphi/Object Pascal</a>
</span>
<span>
<a href="https://www.csdn.net/unity/" data-report-click='{"mod":"1586412712_001","ab":"new","dest":"https://www.csdn.net/unity/","index":"索引#"}' data-report-view='{"mod":"1586412712_001","ab":"new","dest":"https://www.csdn.net/unity/","index":"#"}' target="_blank">
Unity3D</a>
</span>
<span>
<a href="https://www.csdn.net/gather_13/MtTaIg1sNS1kb3dubG9hZAO0O0OO0O0O.html" target="_blank">
c#存为组套 模板</a>
</span>
<span>
<a href="https://www.csdn.net/gather_2e/MtTaIg1sNi1ibG9n.html" target="_blank">
c# 停掉协程</a>
</span>
<span>
<a href="https://www.csdn.net/gather_12/MtTaIg1sOC1kb3dubG9hZAO0O0OO0O0O.html" target="_blank">
c# 图片颜色调整 最快</a>
</span>
<span>
<a href="https://www.csdn.net/gather_16/MtTaIg1sOS1kb3dubG9hZAO0O0OO0O0O.html" target="_blank">
c#多张图片上传</a>
</span>
<span>
<a href="https://www.csdn.net/gather_21/MtTaIg2sMS1ibG9n.html" target="_blank">
c# isnumeric</a>
</span>
<span>
<a href="https://www.csdn.net/gather_1d/MtTaIg2sMi1kb3dubG9hZAO0O0OO0O0O.html" target="_blank">
c# mono 脚本</a>
</span>
<span>
<a href="https://www.csdn.net/gather_17/MtTaIg2sMy1kb3dubG9hZAO0O0OO0O0O.html" target="_blank">
c# 模型 生成</a>
</span>
<span>
<a href="https://www.csdn.net/gather_18/MtTaIg2sNi1kb3dubG9hZAO0O0OO0O0O.html" target="_blank">
c# 如何快速的求和</a>
</span>
<span>
<a href="https://www.csdn.net/gather_11/MtTaIg2sOC1kb3dubG9hZAO0O0OO0O0O.html" target="_blank">
c#窗口隐藏</a>
</span>
<span>
<a href="https://www.csdn.net/gather_1e/MtTaIg2sOS1kb3dubG9hZAO0O0OO0O0O.html" target="_blank">
c# 动态注入il</a>
</span>
</div>
</div>
</div> -->
<div class="recommend-loading-box">
<img src="https://csdnimg.cn/release/phoenix/images/feedLoading.gif">
</div>
<!-- <div class="recommend-end-box">
<p class="text-center">没有更多推荐了,<a href="https://blog.csdn.net/" class="c-blue c-blue-hover c-blue-focus">返回首页</a></p>
</div> -->
</div>
<script src="https://csdnimg.cn/pubfooter/js/publib_footer-1.0.4.js" data-isfootertrack="false" type="text/javascript"></script><div></div>
</main>
</div>