错误记录与分析

来源:互联网 发布:外国人眼中的淘宝 编辑:程序博客网 时间:2024/05/02 06:11

 

 

在这儿记录一些自己常犯的错误,做一些“前车之鉴,后车之师”的事情吧。

 

1,save could not be completed。

 

 出现这个错误就是页面的编码和工程定义的编码不一致。我的错误发生在 保存JSP界面的时候。

解决方案: 首先,在jsp界面中一定要添加界面编码方式的说明:

 

<%@ page language="java" contentType="text/html; charset=utf-8"%>

 如果还是出现问题,那么就改一些你自己的系统默认编码配置:

 

window-->preferences-->MyEclipse Enterprise -->Files And Editors -->JSP。将其中编码选为:utf-8。

 

这样就可以了。

 

2,Oracle数据 库中 翻页的一些知识

 

 

select * from(    select my_table.*, rownum as my_rownum from    (        select * from (               select t.name               from hr_childcheckthreeyearold t            )    ) my_table        where rownum<=20)  where my_rownum >=1

3, Struts2,   spring   ,Hibernate的官方下载地址:

 

struts2 的下载地址:http://struts.apache.org/download.cgi#struts223

 

Spring 的下载地址:http://www.springsource.com/download/community?sid=1212978

 

Hibernate的官网下载地址:http://sourceforge.net/projects/hibernate/files/hibernate3/

 

JSF的下载地址:http://javaserverfaces.java.net/

 

 

4,居民健康档案中注意事项

 

1) 当将居民健康档案check下来之后,需要修改几个地方。第一就是要在JportSplashHandler中,将tomcat设置为本地的。即:ipText = "127.0.0.1";

2)需要将数据库设置为服务器上的数据库,即在applicationContext.xml中修改数据库地址。

3)假如check下来的程序有错误,则应该将其重构一下。点击src下面的plugin.xml中runtime。在runtime中的右下方有classpath,将bin删除,然后重构一些就可以了。

 

5,FileNotFoundException

在程序中遇到了org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from ServletContext resource [/WEB-INF/classes/service-registInfo.xml]; nested exception is java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/classes/service-registInfo.xml]

 

   上面的错误信息分析如下:org.springframework.beans.factory.BeanDefinitionStoreException,意味着是关于spring的错误。而后面的语句是说:service-registInfo.xml,这个.xml没有找到。这个时候你就应该去找一找是不是你已经建立了这个文件,如果没有建立,则建立;如果是建立了,则应该看看是不是放错了位置。因为如果你已经建立了这个文件,但是系统却说没有发现,那么显而易见,说明 1)你的文件放做了地方。 2)你在某个文件声明该.xml的路径是写错了。

 

6)

org.springframework.beans.factory.BeanCreationException:

Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/classes/applicationContext.xml]:

Invocation of init method failed; nested exception is org.hibernate.AnnotationException: No identifier specified for entity:

cn.com.hrs.pub.domain.PubRegistInfoType

 

       最后的原因是spring没有设置代理。即在我的domain文件中没有表明主键@Id

 

原创粉丝点击