yml配置文件读取出错 Exception in thread “main“ while scanning for the next token found character ‘\t(TAB)‘

这几天在学习springboot的微服务项目,在配置文件方面也想尝试下新的yml配置,就想把原来项目properties写的文件转换成yml试一下(老项目是之前检出在了Myeclipse里面),结果写好了yml配置文件,项目启动时候报了如下错误:

Exception in thread "main" while scanning for the next token

found character '\t(TAB)' that cannot start any token. (Do not use \t(TAB) for indentation)
 in 'reader', line 9, column 3:
      dubbo:
      ^


at org.yaml.snakeyaml.scanner.ScannerImpl.fetchMoreTokens(ScannerImpl.java:420)
at org.yaml.snakeyaml.scanner.ScannerImpl.checkToken(ScannerImpl.java:226)

.......

原因是因为我在yml配置文件中用了Tab键来缩进,所以导致spring启动读取yml配置文件不能正确读取。

注意我在上面标红的地方,yml配置中使用Tab来缩进确实不符合yml的语法规则,但是我试了一下在另一个开发工具IDEA中yml配置使用Tab来缩进项目启动是没有报错的,可能是是IDEA开发工具比较厉害的一点,不过我们还是要注意尽量不要使用Tab来缩进。

还有很多类似的启动报错,很可能就是你的yml配置文件里面有问题,这个时候我们就要仔细检查下yml文件书写是否符合规范,贴一个YAML语言教程地址:http://www.ruanyifeng.com/blog/2016/07/yaml.html?f=tt 里面有写yml文件的语法规则,大家可以去看看。
————————————————
版权声明:本文为CSDN博主「Ranger-」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/cfl083716/article/details/79001993

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
Nmap, or Network Mapper, is a free, open source tool that is available under the GNU General Public License as published by the Free Software Foundation. It is most often used by network administrators and IT security professionals to scan corporate networks, looking for live hosts, specific services, or specific operating systems. Part of the beauty of Nmap is its ability to create IP packets from scratch and send them out utilizing unique methodologies to perform the above-mentioned types of scans and more. This book provides comprehensive coverage of all Nmap features, including detailed, real-world case studies. . Understand Network Scanning Master networking and protocol fundamentals, network scanning techniques, common network scanning tools, along with network scanning and policies. . Get Inside Nmap Use Nmap in the enterprise, secure Nmap, optimize Nmap, and master advanced Nmap scanning techniques. . Install, Configure, and Optimize Nmap Deploy Nmap on Windows, Linux, Mac OS X, and install from source. . Take Control of Nmap with the Zenmap GUI Run Zenmap, manage Zenmap scans, build commands with the Zenmap command wizard, manage Zenmap profiles, and manage Zenmap results. . Run Nmap in the Enterprise Start Nmap scanning, discover hosts, port scan, detecting operating systems, and detect service and application versions . Raise those Fingerprints Understand the mechanics of Nmap OS fingerprinting, Nmap OS fingerprint scan as an administrative tool, and detect and evade the OS fingerprint scan. . "Tool" around with Nmap Learn about Nmap add-on and helper tools: NDiff--Nmap diff, RNmap--Remote Nmap, Bilbo, Nmap-parser. . Analyze Real-World Nmap Scans Follow along with the authors to analyze real-world Nmap scans. . Master Advanced Nmap Scanning Techniques Torque Nmap for TCP scan flags customization, packet fragmentation, IP and MAC address spoofing, adding decoy scan source IP addresses, add random data to sent packets, manipulate time-to-live fields, and send packets with bogus TCP or UDP checksums.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

万事俱备,就差一个程序员了

谢谢您,赏俺根辣条,尝尝鲜.谢

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值