org.hibernate.QueryException: addEntity() or addScalar() must be called on a sql query before executing the qury 问题的解决
2009-05-08 08:46
1106 查看
今天在开发的时候遇到这么个问题,我在进行WS的开发,在jboss
中启动工程就没问题,但是现在没有启动jboss,用的是本地调用的方式进行测试,找了半天原因,最后一看,发现jboss中的hibernate版本是3.2的,而自己eclipse中引入的版本是3.0的,换成3.2的问题解决。
org.hibernate.QueryException: addEntity() or addScalar() must be called on a sql query before executing the qu
ery. [select distinct Wapcontent.title,count(*) from useraccesslog,wapcontent where Useraccesslog.contentId=Wa
pcontent.contentId and Useraccesslog.createdate >='2008-08-07 15:11:49' and Useraccesslog.createdate <='2008-0
8-07 18:11:49' group by Useraccesslog.contentId order by count(*) desc]
at org.hibernate.impl.SQLQueryImpl.verifyParameters(SQLQueryImpl.java:169)
at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:140)
at com.zrrt.wapportal.dao.hibernate.UseraccesslogDAOHibernate$1.doInHibernate(UseraccesslogDAOHibernate.java:
118)
at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:356)
at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:329)
at com.zrrt.wapportal.dao.hibernate.UseraccesslogDAOHibernate.getUseraccesslogsByCpAContent(UseraccesslogDAOH
ibernate.java:113)
at com.zrrt.wapportal.service.impl.UseraccesslogManagerImpl.getUseraccesslogsByCpAContent(UseraccesslogManage
rImpl.java:69)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
中启动工程就没问题,但是现在没有启动jboss,用的是本地调用的方式进行测试,找了半天原因,最后一看,发现jboss中的hibernate版本是3.2的,而自己eclipse中引入的版本是3.0的,换成3.2的问题解决。
org.hibernate.QueryException: addEntity() or addScalar() must be called on a sql query before executing the qu
ery. [select distinct Wapcontent.title,count(*) from useraccesslog,wapcontent where Useraccesslog.contentId=Wa
pcontent.contentId and Useraccesslog.createdate >='2008-08-07 15:11:49' and Useraccesslog.createdate <='2008-0
8-07 18:11:49' group by Useraccesslog.contentId order by count(*) desc]
at org.hibernate.impl.SQLQueryImpl.verifyParameters(SQLQueryImpl.java:169)
at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:140)
at com.zrrt.wapportal.dao.hibernate.UseraccesslogDAOHibernate$1.doInHibernate(UseraccesslogDAOHibernate.java:
118)
at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:356)
at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:329)
at com.zrrt.wapportal.dao.hibernate.UseraccesslogDAOHibernate.getUseraccesslogsByCpAContent(UseraccesslogDAOH
ibernate.java:113)
at com.zrrt.wapportal.service.impl.UseraccesslogManagerImpl.getUseraccesslogsByCpAContent(UseraccesslogManage
rImpl.java:69)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
相关文章推荐
- org.hibernate.QueryException: addEntity() or addScalar() must be called on a sql query before executing the query 问题的解决
- org.hibernate.QueryException: addEntity() or addScalar() must be called on a sql query before executing the query
- android4.1 JELLY_BEAN:All WebView methods must be called on the same thread[问题已解决]
- Cause by:All WebView methods must be called on the same thread[问题已解决]
- android4.1 JELLY_BEAN:All WebView methods must be called on the same thread[问题已解决]
- org.hibernate.id.IdentifierGenerationException: ids for this class must be manually assigned before
- 出现org.hibernate.LazyInitializationException: could not initialize proxy - the owning Session was closed问题以及解决办法
- Git出现error: Your local changes to the following files would be overwritten by merge: ... Please, commit your changes or stash them before you can merge.的问题解决(Git代码冲突)
- Hibernate报错:org.hibernate.id.IdentifierGenerationException:ids for this class must be manually assigned before calling save()
- Caused by: org.hibernate.hql.internal.ast.QuerySyntaxException: table is not Mapped问题解决
- org.hibernate.QueryException: query must begin with SELECT or FROM: delete
- org.hibernate.id.IdentifierGenerationException: ids for this class must be manually assigned before calling
- org.hibernate.QueryException: query must begin with SELECT or FROM: delete
- The type org.apache.commons.lang.exception.NestableRuntimeException cannot be resolved. 问题解决
- org.hibernate.exception.SQLGrammarException:Could not execute JDBC batch update问题的解决
- 【hibernate】关于org.hibernate.ObjectNotFoundException: No row with the given identifier exists 的快捷解决问题
- 关于org.hibernate.ObjectNotFoundException: No row with the given identifier exists 的快捷解决问题
- XML2JSON 的【net.sf.json.JSONException: nu.xom.ParsingException must be followed by either attribute specifications, ">" or "/>"】问题解决办法
- Caused by: org.hibernate.hql.ast.QuerySyntaxException: TkltEmpQuitProcess is not mapped. 问题解决
- org.hibernate.id.IdentifierGenerationException: ids for this class must be manually assigned before calling save():