struts,spring,hibernate的项目中,出错时tomcat无任何提示只有浏览器HTTP Status 404 - Servlet action is not available。
spring调试
applicationContext.xml中
注释掉
<bean id="dataSource"
class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="java:comp/env/jdbc/mgzst"></property>
</bean>
替换成
<bean id="dataSource"
class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
<property name="driverClassName">
<value>oracle.jdbc.driver.OracleDriver</value><!--记得加入jar -->
</property>
<property name="url">
<value>jdbc:oracle:thin:@localhost:1521:mis</value>
</property>
<property name="username">
<value>stmg</value>
</property>
<property name="password">
<value>stmg</value>
</property>
</bean>
写一测试类
public class TestItem {
/**
* @param args
* @throws Exception
*/
public static void main(String[] args) throws Exception {
ApplicationContext ctx = new ClassPathXmlApplicationContext(
"applicationContext.xml");
IItemDAO id = (IItemDAO) ctx.getBean("iitemdaoimpl"); //IItemDAO为DAO接口,iitemdaoimpl为spring中注册的bean id
System.out.println(id.queryAll());//queryAll()是方法名
}
}
查看具体出错原因!
---------------------------------------
org.hibernate.PropertyNotFoundException: Could not find a getter for empDeptId in class com.legend.shipment.Temployee
这个问题表明:
1)getter()方法写错了,没有按照javaBean的规则写.
2)*.hmb.xml中的属性名和pojo中的是否一致.注意:属性名是否多了空格. javabean 变量名和set name是否一致
分享到:
相关推荐
一直出现HTTP Status 404 - Servlet action is not available -------------------------------------------------------------------------------- type Status report message Servlet action is not available...
HTTP Status 404 - There is no Action mapped for namespace and action name BackMemberGroupAudit..doc
一直出现HTTP Status 404 - Servlet action is not available
HTTP_Status_404的处理方案~
对http status 404 几种解决方案
HTTP_Status_404(The_requested_resource_is_not_available)的几种解决方案_补充
错误提示如下图: 出现这种情况的原因通常是因为先安装了Framework,后安装的IIS; 运行cmd,输入: 代码如下:C:\Windows\Microsoft.NET\Framework\V4.0.30319\aspnet...Win7中IIS出现“HTTP 错误 404.17 – Not Foun
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格式的文档。 谁需要读这份文档 这份...
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 ...
python库。 资源全名:openvpn_status-0.1.1-py2.py3-none-any.whl
解决camera运行出现uvcvideo: Non-zero status (-71) in video completion handler.
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
node-status-codes - Node.js http.STATUS_CODES ponyfill
并使用端口服务器和您的应用程序进行调用:{-# LANGUAGE OverloadedStrings #-}import Network.HTTP.Types ( status200 )import Network.Waiimport Network.Wai.Servletimport Network.Wai.Servlet....
npm i react-native-statusbar-props 自动链接项目 react-native link react-native-statusbar-props 手动链接项目 安卓 settings.gradle include ":react-native-statusbar-props" project(":react-native-status...
RAMI 4.0 英文版 ,参考模型
alfred-http-status-codes 使用 Alfred 搜索获取有关 HTTP 状态代码的快速信息,然后按 Enter 以获取有关每个代码的更深入信息。 如何使用 要调用alfred-http-status-codes ,只需键入http后跟您想了解更多信息的...