今天在开发的时候遇到这么个问题,我在进行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)