java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String

错误 java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String
java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String
	at org.hibernate.type.descriptor.java.StringTypeDescriptor.unwrap(StringTypeDescriptor.java:39)
	at org.hibernate.type.descriptor.sql.VarcharTypeDescriptor$1.doBind(VarcharTypeDescriptor.java:63)
	at org.hibernate.type.descriptor.sql.BasicBinder.bind(BasicBinder.java:90)
	at org.hibernate.type.AbstractStandardBasicType.nullSafeSet(AbstractStandardBasicType.java:286)
	at org.hibernate.type.AbstractStandardBasicType.nullSafeSet(AbstractStandardBasicType.java:281)
	at org.hibernate.loader.Loader.bindPositionalParameters(Loader.java:1995)
	at org.hibernate.loader.Loader.bindParameterValues(Loader.java:1966)
	at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1901)
	at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1862)
	at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1839)
	at org.hibernate.loader.Loader.doQuery(Loader.java:910)
	at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:355)
	at org.hibernate.loader.Loader.doList(Loader.java:2554)
	at org.hibernate.loader.Loader.doList(Loader.java:2540)
	at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2370)
	at org.hibernate.loader.Loader.list(Loader.java:2365)
	at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:126)
	at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1718)
	at org.hibernate.internal.CriteriaImpl.list(CriteriaImpl.java:380)
	at org.springframework.orm.hibernate4.HibernateTemplate$35.doInHibernate(HibernateTemplate.java:1023)
	at org.springframework.orm.hibernate4.HibernateTemplate$35.doInHibernate(HibernateTemplate.java:1011)
	at org.springframework.orm.hibernate4.HibernateTemplate.doExecute(HibernateTemplate.java:340)
	at org.springframework.orm.hibernate4.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:308)
	at org.springframework.orm.hibernate4.HibernateTemplate.findByCriteria(HibernateTemplate.java:1011)
	at springMVC.NLoveB.dao.impl.DaoCommentImpl.UseridComment(DaoCommentImpl.java:91)

出现上面的错误 可能的错误就是你的参数不正确,注意看,错误提示给出了异常的入口类,也可出了异常和orm有关

本处错误是因为参数需要一个String  而我给出的是int

错误提示错误

Restrictions.eq("commenetapproved",1)

评论 抢沙发

昵称 (必填) 邮箱 (必填)
表情
  1. #1

    来自2222 回复给的评论 (2017-01-18 17:12:30)
    <script>alert(1)</script>

首页上一页12下一页尾页