老师你好,main 函数直接放在了java 目录之下 报错了 Application 放到包里面@ComponentScan这个注解又会失效

来源:10-3 返回cookies信息的get接口开发

慕田峪8226962

2020-01-30

在stack overflow有人说:Your code is in the default package, i.e. you have .java files in src/main/java with no package statement at the top. There’s a warning message in the log indicating that this is likely to cause problems: ** WARNING ** : Your ApplicationContext is unlikely to start due to a @ComponentScan of the default package.

图片描述

我把Application.java丢到包里面了,就到这个注释@ComponentScan报错了,就算去掉括号的内容也不行。

图片描述

写回答

1回答

大周

2020-02-07

往后学,后边就不用这种方式了。 这个就是一个过渡,把注解部分作为拆解,让你多理解一下。 

0
0

Java接口自动化测试实战,搞定理论基础+典型应用场景

打破传统测试用例设计方法,搞懂基于TestNG的接口自动化测试技术

2087 学习 · 920 问题

查看课程