
各种错误
星晴coral
时光清浅,向爱则暖
展开
-
hibernate中出现Exception in thread "main" java.lang.NoClassDefFoundError: com/opensymphony/oscache/base
运行hibernate程序出现如下错误:Exception in thread "main" java.lang.NoClassDefFoundError: com/opensymphony/oscache/base/Configat org.hibernate.cache.OSCacheProvider.(OSCacheProvider.java:33)at sun.reflect.原创 2013-05-18 10:48:49 · 2757 阅读 · 0 评论 -
中文乱码问题-pageEncoding与charset区别, response和request的setCharacterEncoding 区别
pageEncoding与charset区别pageEncoding是设置的JSP页面源代码的字符编码格式,如果该项的值是utf-8,则JSP源代码里不能写汉字了,如果你用的是eclipse等工具的话,保存时他会提示有一个错误,改成gbk就没事了,就是这个道理charset是请求服务器以后返回过来的内容的字符编码(当浏览器得到此文件时以什么方式解码),即使pageEncoding设置了gb原创 2013-12-01 21:17:47 · 3508 阅读 · 0 评论 -
myeclipse导入现有项目出错
错误:在myeclipse中【file】->【import】->已有项目 出现:WebRoot中jsp文件里面红色叉错误修改方式:点击项目名称,鼠标右键->【myeclipse】->【Include From Validation】即可注:该修改方式指针对一部分该类型错误有效原创 2013-05-13 19:31:27 · 1055 阅读 · 0 评论 -
hibernate中one-to-one的foreign错误
此代码是:利用hibernate反向工程生成domain和domain的映射文件基于主键的1-1映射log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment).log4j:WARN Please initialize the log4j system properly.%%%%原创 2013-05-21 21:07:53 · 1202 阅读 · 0 评论 -
java.lang.Long cannot be cast to java.lang.Integer
public int postAmount(){ int postAmount = 0; session = HibernateSessionFactory.getSession(); String hql = "select count(*) from Post"; query = session.createQuery(hql); postAmount = (Integer原创 2013-05-29 10:11:06 · 7663 阅读 · 1 评论 -
myeclipse中出现 org.hibernate.MappingException: Unknown entity: cn.itcast.hibernate.domain.User
在Hibernate配置文件hibernate.cfg.xml中没有添加映射文件的位置举例:可以添加以下信息mapping resource="cn/itcast/hibernate/domain/User.hbm.xml"/>原创 2013-05-03 17:03:09 · 2351 阅读 · 0 评论 -
hibernate中一对一param named "property" is required for foreign id generation strategy错误
两个类Person、IdCardPerson:主键id private Integer id; private String name; private IdCard idCard;IdCard:主键id 外键id (此处的id即为Person里面的id) private Integer id; private Person person; private Date u原创 2013-05-12 15:14:37 · 2327 阅读 · 0 评论 -
hibernate中Cannot use identity column key generation with <union-subclass> mapping for错误
log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment).log4j:WARN Please initialize the log4j system properly.%%%% Error Creating SessionFactory %%%%org.hibernate.Mapp原创 2013-05-23 12:03:17 · 3175 阅读 · 0 评论 -
hibernate中映射异常的一种
log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment).log4j:WARN Please initialize the log4j system properly.%%%% Error Creating SessionFactory %%%%org.hibernate.Inva原创 2013-05-22 14:35:07 · 1094 阅读 · 0 评论 -
hibernate The content of element type "session-factory" must match "(property*,mapping*,(class-cache
log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment).log4j:WARN Please initialize the log4j system properly.%%%% Error Creating SessionFactory %%%%org.hibernate.Mapp原创 2013-05-20 16:13:26 · 3304 阅读 · 0 评论 -
org.apache.jasper.JasperException: The absolute uri: http://java.sun.com/jsp/jstl/core cannot be res
异常:org.apache.jasper.JasperException: The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed with this applicationat org.apache.ja原创 2014-02-17 10:05:22 · 3704 阅读 · 0 评论