No embedded stylesheet instruction for file:奇怪的错误

       今天在看Spring的一些东西,刚开始看,编写了一个HelloWorld,中间除了不少错误,但是都排除了;但是,
最后的一个错误实在是摸不着头脑:
21:11:57,015 INFO  [main] Main  - javax.xml.transform.TransformerFactory=null
21:11:57,015 INFO  [main] Main  - java.endorsed.dirs=D:\Program Files\Java\jre6\lib\endorsed
21:11:57,031 INFO  [main] Main  - launchFile: E:\JavaWebAPP\.metadata\.plugins\org.eclipse.wst.xsl.jaxp.launching\launch\launch.xml
21:11:58,453 FATAL [main] Main  - No embedded stylesheet instruction for file: file:/E:/JavaWebAPP/myApp/config.xml
org.eclipse.wst.xsl.jaxp.debug.invoker.TransformationException: No embedded stylesheet instruction for file: file:/E:/JavaWebAPP/myApp/config.xml
at org.eclipse.wst.xsl.jaxp.debug.invoker.internal.JAXPSAXProcessorInvoker.transform(JAXPSAXProcessorInvoker.java:225)
at org.eclipse.wst.xsl.jaxp.debug.invoker.internal.JAXPSAXProcessorInvoker.transform(JAXPSAXProcessorInvoker.java:186)
at org.eclipse.wst.xsl.jaxp.debug.invoker.internal.Main.main(Main.java:73)
Caused by: org.eclipse.wst.xsl.jaxp.debug.invoker.TransformationException: No embedded stylesheet instruction for file: file:/E:/JavaWebAPP/myApp/config.xml
at org.eclipse.wst.xsl.jaxp.debug.invoker.internal.JAXPSAXProcessorInvoker.transform(JAXPSAXProcessorInvoker.java:214)
... 2 more

原因:
          我点击“运行”按钮的时候,是在config.xml配置文件下,而不是在main()所在的文件
原理:
         Eclipse并不会在project中寻找工程的入口点,而是从你编辑器中的当前文件开始运行,所以报错了!

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值