今天在执行语句查询时发现怎么都执行不了,换数据库别的表可以执行,以为是数据库表生成时哪里出了问题,一遍又一遍的对映射文件,数据库表,就是没有想出到底哪儿错了,还删了表重新生成表和索引,都没有办法。在网上看了一下资料突然明白,在Spring中没有配置BO。真晕!
出现错误是:
执行查询的时候出了如下错误:
net.sf.hibernate.QueryException: in expected: t [from TbApplyNew t]
at net.sf.hibernate.hql.FromParser.token(FromParser.java:102)
at net.sf.hibernate.hql.ClauseParser.token(ClauseParser.java:87)
at net.sf.hibernate.hql.PreprocessingParser.end(PreprocessingParser.java:139)
at net.sf.hibernate.hql.ParserHelper.parse(ParserHelper.java:30)
at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:146)
at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:133)
at net.sf.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:352)
at net.sf.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:330)
at net.sf.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:1368)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1332)
at net.sf.hibernate.impl.QueryImpl.list(QueryImpl.java:76)
at com.ninetowns.ods.srvvervst.ServiceVersionVisitManager.getVisitSuRecords(ServiceVersionVisitManager.java:79)
at com.ninetowns.ods.srvvervst.ServiceVersionVisitManagerTest.testGetVisitSuRecords(ServiceVersionVisitManagerTest.java:37)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:478)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:344)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
原因是使用了三层框架:struts+hibernate+spring,在spring配置文件中没有注入hibernate类对应的xml映射文件.
<bean id="hibernateMapping.strongbpm.bpmnew" class="com.strongit.finance.common.util.ListHelper">
<property name="mappings">
<list>
<!-- 业务表配置文件在此注入 -->
<value>com/strongit/strongbpm/bo/TbApplyNew.hbm.xml</value>
<value>com/strongit/strongbpm/bo/TbApporeNew.hbm.xml</value>
</list>
</property>
</bean>
如果没有使用spring,只是使用了hibernate那么则Hibernate类对应的xml映射文件中的表名和包、类没有修改过来,然后在hibernate.cfg.xml文件中添加对应的记录。
分享到:
相关推荐
expected time bounds for selection
good book to learn the "expected return
IE下使用uploadify上传报:Uploadify-Script5007 Object expected解决方案
Figure of expected result
该库提供了Expected类型-包装器,用于表示可能包含初始化值或错误的期望对象。 此外,此实现还允许存储引用: int k = 3 ; Expected< int> intRef (k); k = 1 ; assert (*intRef == 1 ); 整个实现在libExpected...
这里记录一下,以防以后再犯这样的错误。 我用pandas来读取json文件 调试是正常的。 服务跑起来是出现这样了这样的错误。 首先我的manager.文件与我处理数据的py文件不在同一级目录。 文件结构大致如下: project ...
列举IAR常见的错误,也可以当做IAR编译错误查询文档,非常全面
OpenOffice的文档Microsoft Excel File Format.描述了微软Excel .xls文档的基本格式,包括基本的流(stream)和常见的记录(record)。
KEIL编译错误信息
Expected sales amount -.xlsx
解决 VSCode 编辑 vue 项目报错 Expected indentation of 2 spaces but found 4解决 VSCode 编辑 vue 项目报错 Expected indentation of 2 spaces but found 4问题问题分析解决办法一解决办法二 解决 VSCode 编辑 ...
Risk parity is a type of asset allocation strategy that has become increasingly popular in the aftermath of the global financial crisis
多目标优化,模型优化,超体积期望提升算法
解决复现 PointNet 中出现的【dll = np.ctypeslib.load_library(‘render_balls_so’, ‘.’) OSError: no file with expected extension:】问题。只需要替换原作者代码中的文件就可以。
文档描述了feescale 编译工具Codewarrior编译出现的错误以及解决方法,感觉挺有用,分享分享
Annual Reports in Medicinal Chemistry provides timely and critical reviews of important topics in medicinal chemistry together with an emphasis on emerging topics in the biological sciences, which are...
Put simply, the new features in Java 8 along with the (less-obvious) changes in Java 9 are the biggest change to Java in the 21 years since Java 1.0 was released. Nothing has been taken away, so all ...
With the exception of the volatility pre- mium, our model is intentionally very similar to that of Fama and French (1992) , which is one of the most-cited papers in finance. The classic paper on the ...
Field Development Extensions of Orocual Field and Prediction of Expected Performance in a Fractured Reservoir.pdf
SN_29500-5_Part_5_Expected_values_for_electrical_connections,_electrical_connectors_and_sockets 可靠性设计