Apache Tomcat/6.0.13 - Error report
<h1 font-familytahomaarialsans-serifcolorwhitebackground-colordfont-sizepx h font-familytahomaarialsans-serifcolorwhitebackground-colordfont-sizepx h font-familytahomaarialsans-serifcolorwhitebackground-colordfont-sizepx body font-familytahomaarialsans-serifcolorblackbackground-colorwhite b font-familytahomaarialsans-serifcolorwhitebackground-colord p font-familytahomaarialsans-serifbackgroundwhitecolorblackfont-sizepxa color blackaname color blackhr color d-->--<
HTTP Status 404 - Servlet action is not available
type
Status report
message
Servlet action is not available
description
The requested resource (Servlet action is not available) is not available.
Apache Tomcat/6.0.13
转网上解决经验一:
上网查了好多的答案,网上有很多的解释,出错的地方有很多中,最后我看到一位仁兄的一句话:
“>The requested
resource
(Servlet
action
is not
available
) is not
available
这些都是Struts
或Spring
基本配置出现问题,struts配置在web.xml中检查一下,Spring的配置也是web.xml,确认没有问题
”,让我缩小了搜索的范围,于是我老老实实的把web.xml 、applicationContext.xml、struts-config.xml这几个文件检查了一遍,不出我所料,在web.xml中我把
-
<context-param>
-
<param-name>contextConfigLocation</param-name>
-
<param-value>
-
/WEB-INF/classes/applicationContext.xml
-
</param-value>
-
</context-param>
|
中
contextConfigLocation的L写成l了, 把我痛苦了一个晚上,甚至都打算将苦苦配置起来的环境再配置一遍了,感谢那位仁兄啊,所以我给以后发生这种情况的同仁一个忠告:
只要出现
The
requested
resource
(Servlet
action
is not
available
) is not
available这种情况的首选就是好好检查web.xml 、applicationContext.xml、struts-config.xml这几个文件。
转网上解决经验二:
天
在调试程序总是出现这么一个问题:the requested resource (action ) is not available
搞了半天都没有弄明白是哪里出问题了
仔细看看自己的struts.xml中的配置也没有什么问题。很是郁闷,于是边玩边学调试着,后来索性还是Google一下吧
结果还真发现自己犯了一个比较愚蠢的问题 其他的地方都是检查过了
唯一就是忘记查看web.xml的配置。回头一看居然里面根本都没有配置相关的filter 这个郁闷啊
怎么就忘记写着东西了呢 所以结果你可想而知啦:服务器到哪里去找那action去啊。
现在将web.xml作用写在这里:web.xml是WEB工程的描述文件,例如WEB工程所用到的Servlet、Filter、Tablib等等等等都在这个里面进行描述,WEB工程启动的时候会在这个里面找到具体所用到的类的路径,由此进行加载。
接下来说说说这一类问题的处理方法:
问题: the requested resource (servlet action is not available ) is not available.
原因:
首先 1.、web.xml文件中未配置ActionServlet。
2、struts-config.xml文件未配置你要访问的Action。
3、你的jsp文件form标记中action属性的路径名称错误。
核查:
1、在web.xml文件中加上ActionServlet的配置信息
-
<
servlet
>
-
<
servlet-name
>
action
</
servlet-name
>
-
<
servlet-class
>
org.apache.struts.action.ActionServlet
</
servlet-class
>
-
<
init-param
>
-
<
param-name
>
config
</
param-name
>
-
<
param-value
>
/WEB-INF/struts-config.xml
</
param-value
>
-
</
init-param
>
-
<
init-param
>
-
<
param-name
>
debug
</
param-name
>
-
<
param-value
>
0
</
param-value
>
-
</
init-param
>
-
<
init-param
>
-
<
param-name
>
detail
</
param-name
>
-
<
param-value
>
0
</
param-value
>
-
</
init-param
>
-
<
load-on-startup
>
2
</
load-on-startup
>
-
</
servlet
>
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param> <param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param> <init-param>
<param-name>debug</param-name>
<param-value>0</param-value> </init-param>
<init-param> <param-name>detail</param-name>
<param-value>0</param-value> </init-param>
<load-on-startup>2</load-on-startup> </servlet>
2、在struts-config.xml文件检查你要访问的Action配置文件。
3、检查jsp文件form标记中action属性的路径名称是否与struts-config.xml文件中action标记的path属性的路径名称一致。
4、非以上情况的解决办法就是检查web容器的log日志,如果时tomcat则检查下logs目录下的localhost_log文件,看里边是
否记录有错误信息,然后根据错误信息提示将其纠正。
除了以上的 :
也有可能是找不到spring.jar包 。建议重新导入
自己的解决方法:
查看console输出:
1.org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'sessionFactory' defined in
ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation
of init method failed; nested exception is
java.io.FileNotFoundException: class path resource
2.Caused by:
java.io.FileNotFoundException: class path resource
[com/house/entity/HouseInfo.hbm.xm] cannot be opened because it does
not exist
3.Caused by:
org.springframework.beans.NotWritablePropertyException: Invalid
property 'developerDao' of bean class
[com.house.action.DevelopersAction]: Bean property 'developerDao' is
not writable or has an invalid setter method. Does the parameter type
of the setter match the return type of the getter?
看到这里速度回去看,果然是getter/setter出错了:
因为不能解析applicationContext.xml关联到的Action类,其中的getter/setter方法出错导致:
自己的代码如下:
/*public IDevelopersDao getClientInfo() {
return developerDao;
}
public void setClientInfo(IDevelopersDao developer) {
this.developerDao= developer;
}
*/
由于copy自己之前写的相同模块的代码,在写的过程中注重了参数的读取,和路径的书写
,以为这样一个模块下来不会出错,谁知道忘记了dao类的正确书写也会报404 servlet错,以后要更加小心,当然不免会遇到相似的问题,在此谨记。
也是代码问题,一般不需要重启PC,只要重启tomcat即可。
分享到:
相关推荐
HTTP Status 404 - There is no Action mapped for namespace and action name BackMemberGroupAudit..doc
一直出现HTTP Status 404 - Servlet action is not available -------------------------------------------------------------------------------- type Status report message Servlet action is not available...
一直出现HTTP Status 404 - Servlet action is not available
HTTP_Status_404的处理方案~
对http status 404 几种解决方案
错误提示如下图: 出现这种情况的原因通常是因为先安装了Framework,后安装的IIS; 运行cmd,输入: 代码如下:C:\Windows\Microsoft.NET\Framework\V4.0.30319\aspnet...Win7中IIS出现“HTTP 错误 404.17 – Not Foun
HTTP_Status_404(The_requested_resource_is_not_available)的几种解决方案_补充
The method setAttribute(String, Object) in the type ServletRequest is not applicable for the arguments (String, double) y2ssh.sg.chp1.action.AddAction.execute(AddAction.java:18) y2ssh.sg.chp1....
Java Servlet API说明文档 绪言 这是一份关于2.1版JavaServletAPI的说明文档,作为对这本文档的补充,你可以到http://java.sun.com/products/servlet/index.html下面下载Javadoc格式的文档。 谁需要读这份文档 这份...
download failed: assets/main/import/09/09f53264-cd95-4751-99ad-d516c164dd80._cconb.dbbin, status: 404(no response) Error: download failed: 疑问1: 您的源项目会有什么改变: 答1: 您的项目目录下的 .cconb...
Called by the servlet container to indicate to a servlet that the servlet is being taken out of service. destroy() - Method in class javax.servlet.GenericServlet Called by the servlet container to ...
解决camera运行出现uvcvideo: Non-zero status (-71) in video completion handler.
主要介绍了Tomcat报错:HTTP Status 500 (Wrapper cannot find servlet class)解决办法的相关资料,需要的朋友可以参考下
解决docker报错systemctl status docker.service and journalctl -xe
Statuspage-源码.rar
git-get-status 一个用于解析git status --porcelain小型node.js实用程序。安装 $ npm install git-get-status用法 var git_get_status = require('git-get-status');git_get_status(function(err, result){ var ...
资源来自pypi官网。 资源全名:py3status-ups-battery-status-0.1.3.tar.gz
并使用端口服务器和您的应用程序进行调用:{-# LANGUAGE OverloadedStrings #-}import Network.HTTP.Types ( status200 )import Network.Waiimport Network.Wai.Servletimport Network.Wai.Servlet....
最近在学习jsp和servlet,避免不了的要和tomcat打交道,但tomcat经常会出现各式各样的错误,下面是我总结的一些常见的解决方法,希望对大家有用。 1.未部署Web应用 2.URL输入错误 排错方法:首先,查看URL的IP...
npm i react-native-statusbar-props 自动链接项目 react-native link react-native-statusbar-props 手动链接项目 安卓 settings.gradle include ":react-native-statusbar-props" project(":react-native-status...