从0开始学Java——eclipse下运行servlet程序警告:Setting property 'source' to 'org.eclipse.jst.jee.server:类名' did no...

在使用Eclipse 创建第一个 Servlet之后,并且配置好了tomcat,然后Run on server的之后,提示标题所示错误:

警告: [SetContextPropertiesRule]{Context} Setting property 'source' to 'org.eclipse.jst.jee.server:SecondServlet' did not find a matching property.  
 
bing之后,有人提到如下操作方法:

解决办法:

1、在server控制台内,在服务器上点右键--属性

2、general选项卡中点switch location

这时,location变为:/servers/tomcat6.0 server at localhost.server

3、在project explore中找到tomcat项目--Tomcat v6.0 Server at localhost.server  这个文件 ,双击打开

4、在最下面的server option里选中publis module context to separate xml file.保存。(保存时要先停止服务器)   
 
但是设置好之后发现还是存在该问题。
 
然后在stackoverflow上有人说了,这个根本不是问题,不用管。

This is not an error. This is a warning. The difference is pretty huge. This particular warning basically means that the <Context> element in Tomcat's server.xml contains an unknown attribute source and that Tomcat doesn't know what to do with this attribute and therefore will ignore it.

Eclipse WTP adds a custom attribute source to the project related <Context> element in the server.xml of Tomcat which identifies the source of the context (the actual project in the workspace which is deployed to the particular server). This way Eclipse can correlate the deployed webapplication with an project in the workspace. Since Tomcat version 6.0.16, any unspecified XML tags and attributes in the server.xml will produce a warning during Tomcat's startup, even though there is no DTD nor XSD for server.xml.

Just ignore it. Your web project is fine. It should run fine. This issue is completely unrelated to JSF.  
 
最后发现确实这个问题可以不用管,我的站点无法访问的问题是因为我的eclipse没有设置为自动编译,也就是代码没有编译我就开始运行了,手动编译一下之后就好了,傻x了吧
 
 



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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值