Setting property 'source' to 'org.eclipse.jst.jee.server [问题点数:40分]
链接地址:http://bbs.csdn.net/topics/390131469
警告: [SetContextPropertiesRule]{Context} Setting property 'source' to 'org.eclipse.jst.jee.server:Testweb' did not find a matching property.
在eclipse中启动tomcat时出现Setting property 'source' to 'org.eclipse.jst.jee.server:你的站点名' did not find a matching property错误 解决办法: 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.保存。(保存时要先停止服务器) 改完后还不行啊,还出这样的警告,但还能运行出静态页面页面,在调用数据库时就不行了就这样报错 java.sql.SQLException: General error at sun.jdbc.odbc.JdbcOdbc.createSQLException(Unknown Source) at sun.jdbc.odbc.JdbcOdbc.standardError(Unknown Source) at sun.jdbc.odbc.JdbcOdbc.SQLDriverConnect(Unknown Source) at sun.jdbc.odbc.JdbcOdbcConnection.initialize(Unknown Source) at sun.jdbc.odbc.JdbcOdbcDriver.connect(Unknown Source) at java.sql.DriverManager.getConnection(Unknown Source) at java.sql.DriverManager.getConnection(Unknown Source) at network.connectDB.dao.ConnDB.getConnection(ConnDB.java:81) at network.connectDB.dao.ConnDB.login(ConnDB.java:124) at network.login.action.LoginAction.execute(LoginAction.java:26) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:453) at com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:292) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:255) at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:256) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:176) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:265) at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:138) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:211) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:211) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:190) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) at org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:90) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:243) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:100) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:141) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:145) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:171) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:176) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:192) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:187) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:54) at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:510) at org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77) at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:928) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:539) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:300) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) |
#1 得分:0回复于: 2012-07-12 12:51:08
警告: [SetContextPropertiesRule]{Context} Setting property 'source' to 'org.eclipse.jst.jee.server:Testweb' did not find a matching property.
这个警告是可以忽略的,不影响程序的运行,我的也是这样,运行正常 出现这个警告,注意不是错误,是server.xml里面没有source这个属性导致的 |
链接地址:http://blog.csdn.net/z69183787/article/details/19911935
这是我于2013年9月4号晚遇到的问题,为了这个问题我一夜没睡!
对于这个问题,我相信我的方法已经能帮90%的人解决了!
当你用Eclipse运行web项目的时候,你就会看到控制台出现:
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:firstProject' did not find a matching property.
这样的字样,说的是server.xml的Service标签里的Engine标签里的Host标签里的Context标签配置了一个'source'属性,属性值是'org.eclipse.jst.jee.server:firstProject'.
但问题是Context标签是不支持source这个属性的,所以跳出了警告,所以大家也发现的是,尽管有警告,但是大部分人的程序是依然可以运行没有问题的,但少部分人的不能够运行。
也许你已经在网上查到很多像这样的问题,而且也给出了解决办法,但是你照着解决的方法去做了,警告依然存在!
那现在你就可以跟着我的步骤来做了:
我先说一下网上别人所说的步骤,埋个伏笔
1.双击Servers里的Tomcat v7.0 at localhost
2.然后跳出个界面:
看到没,在Server Options选项里有个Publish module contexts to separate XML files的选项,到这里我们也一样把勾勾上,不过问题不是这样就一定解决了,我说过有的朋友这样做了,问题依然没有解决,把勾勾上以后记得保存,如果警告依然存在的朋友们跟着我继续往下看。
3.
大家仔细对比下你自己的和我图片上的,你会发现你默认的选项应该是Use workspace metadata这个选项,只不过是笔者我改为了tomcat的安装路径罢了,因为Use workspace的路径文件夹不方便后面的讲解中要找的文件,所以笔者使用第2个tomcat安装目录来操作,而Deploy path:你如果没有改过的话,应该是叫wtpwebapps,因为在写文章之前,我已经改掉了也不清楚是不是这个名字了,但确定的一点是,它肯定不是webapps的,所以此处读者根据自己的Deploy path的值进行下面的操作。
好了准备工作差不多了,现在是重点来了,为什么好多人做了1.2步操作以后就好了而你自己的没好呢?
原因是,在做1 2 步操作之前你们已经运行过程序,而运行以后程序就会在tomcat文件夹下多了一个backup文件夹
里面的目录结构如图:
有没有很熟悉的感觉,没错这就是从tomcat目录里conf文件夹下拷贝过来的文件
接下来直接说操作好了:
4.
删除掉刚才的backup文件夹[backup所在位置根据第3步所说的,因为笔者使用的时tomcat安装目录所以就在目录下就直接发现了,但如果你用的是Use workspace metadata这个选项的话,你就在\workspace\.metadata\.plugins\org.eclipse.wst.server.core路径下可以看到里面有很多的文件,Eclipse就把项目发布到了这里,里面的目录结构和tomcat里面的差不多,总之把\workspace\.metadata\.plugins\org.eclipse.wst.server.core里面的文件全删除了就可以了]
5.
找到tomcat目录里的conf目录里的Catalina目录里有个localhost文件夹,把文件夹里面的文件全删除掉。
6.
此处告诉大家3.4.5步骤纯属告诉你们Eclipse发布的一个细节,删除上面的文件其实不用那么麻烦:
在Servers下Tomcat v7.0 at localhost里,首先右键-->移除里面已经添加的所有工程,然后右键-->Clean清空项目虚拟目录里的文件,然后重新运行你们的程序就可以了。
注意:如果有人想和我一样在第3步server locations里修改项目发布目录的话,只要发布过一次项目你会发现,server locations里面的选项是灰色的,不可以改,怎么办呢,这就需要你照着第6步里面的移除项目,清空文件,然后你就惊奇的发现,server locations可以修改了,OK,累了,我去,写了3个小时,希望能帮到你们解决你们的问题,See You!!!!