标题:[求助]java.lang.ClassCastException: java.lang.Class这个错误是什么原因造 ...
只看楼主
xqiang
Rank: 1
等 级:新手上路
帖 子:291
专家分:0
注 册:2006-2-23
 问题点数:0 回复次数:3 
[求助]java.lang.ClassCastException: java.lang.Class这个错误是什么原因造成的?

对这个不是很懂,想问问高手们,为什么会报这个错误?
谢谢

HTTP Status 500 -

--------------------------------------------------------------------------------

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: java.lang.ClassCastException: java.lang.Class
org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:516)
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:423)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:226)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:397)
javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)


root cause

java.lang.ClassCastException: java.lang.Class
org.hibernate.type.SortedSetType.wrap(SortedSetType.java:49)
org.hibernate.event.def.WrapVisitor.processArrayOrNewCollection(WrapVisitor.java:84)
org.hibernate.event.def.WrapVisitor.processCollection(WrapVisitor.java:51)
org.hibernate.event.def.AbstractVisitor.processValue(AbstractVisitor.java:101)
org.hibernate.event.def.WrapVisitor.processValue(WrapVisitor.java:98)
org.hibernate.event.def.AbstractVisitor.processEntityPropertyValues(AbstractVisitor.java:55)
org.hibernate.event.def.AbstractSaveEventListener.visitCollectionsBeforeSave(AbstractSaveEventListener.java:333)
org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:250)
org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:167)
org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:101)
org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:186)
org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:175)
org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:98)
org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl.java:502)
org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:494)
org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:490)
org.simplecart.dao.BaseDAO.makePersistent(BaseDAO.java:105)
org.simplecart.webapp.actions.InitializeDatabaseAction.execute(InitializeDatabaseAction.java:123)
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:421)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:226)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:397)
javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)


note The full stack trace of the root cause is available in the Apache Tomcat/6.0.2 logs.


--------------------------------------------------------------------------------

Apache Tomcat/6.0.2

搜索更多相关主题的帖子: java lang Class The 
2007-01-30 09:49
支离破碎
Rank: 6Rank: 6
等 级:贵宾
威 望:23
帖 子:737
专家分:0
注 册:2007-1-4
得分:0 
类型不匹配.你看一下你的二个类的类型是否对的

人生漂泊無依,有如浮萍菱花,隨水飄流,你会在我这里停留吗?
[url=http://51mynet.]http://51mynet.[/url]
2007-01-30 10:27
xqiang
Rank: 1
等 级:新手上路
帖 子:291
专家分:0
注 册:2006-2-23
得分:0 

应该没有错啊,
我现在怀疑是有什么包没有加进去,但又不知道是什么包,不过应该但Hibernate有关
对上面补充一些服务端的错误:

WARN RequestProcessor:509 - Unhandled Exception thrown: class java.lang.ClassCastException

这个错误是什么意思?和上面的有关吗?


相信自己可以的!!! http://www.
2007-01-30 12:07
支离破碎
Rank: 6Rank: 6
等 级:贵宾
威 望:23
帖 子:737
专家分:0
注 册:2007-1-4
得分:0 
org.simplecart.dao.BaseDAO.makePersistent(BaseDAO.java:105)

看一下你的这个DAO类。

人生漂泊無依,有如浮萍菱花,隨水飄流,你会在我这里停留吗?
[url=http://51mynet.]http://51mynet.[/url]
2007-01-30 14:07



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-118808-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.018423 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved