当前位置: 代码迷 >> Java Web开发 >> hibernate 连接oracle异常
  详细解决方案

hibernate 连接oracle异常

热度:2215   发布时间:2013-02-25 21:09:14.0
hibernate 连接oracle错误
我连接本机,和11库都没问题,连接12库就报错,这到底是什么问题啊,网上查了下好多人都说是hql语句问题,可是其他库又没问题呀。。。。用jdbc连接也没问题。。我本机,11 和12库表都是一样的

Java code
严重: Servlet.service() for servlet default threw exceptionjava.lang.IllegalStateException    at org.apache.catalina.connector.ResponseFacade.sendError(ResponseFacade.java:407)    at org.apache.struts2.dispatcher.Dispatcher.sendError(Dispatcher.java:752)    at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:505)    at org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)    at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)    at org.apache.struts2.dispatcher.ActionContextCleanUp.doFilter(ActionContextCleanUp.java:102)    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)    at java.lang.Thread.run(Unknown Source)


界面
Java code
Struts Problem ReportStruts has detected an unhandled exception:Messages:        1. ORA-00942: ???????   2.      FreeMarker template error!      Method public java.lang.String org.hibernate.exception.NestableRuntimeException.getMessage(int) threw an exception when invoked on org.hibernate.exception.SQLGrammarException: could not execute query      The problematic instruction:      ----------      ==> ${msg[0]} [on line 68, column 29 in org/apache/struts2/dispatcher/error.ftl]      ----------      Java backtrace for programmers:      ----------      freemarker.template.TemplateModelException: Method public java.lang.String org.hibernate.exception.NestableRuntimeException.getMessage(int) threw an exception when invoked on org.hibernate.exception.SQLGrammarException: could not execute query          at freemarker.ext.beans.SimpleMethodModel.exec(SimpleMethodModel.java:130)          at freemarker.ext.beans.SimpleMethodModel.get(SimpleMethodModel.java:138)          at freemarker.core.DynamicKeyName.dealWithNumericalKey(DynamicKeyName.java:111)          at freemarker.core.DynamicKeyName._getAsTemplateModel(DynamicKeyName.java:90)          at freemarker.core.Expression.getAsTemplateModel(Expression.java:89)          at freemarker.core.Expression.getStringValue(Expression.java:93)          at freemarker.core.DollarVariable.accept(DollarVariable.java:76)          at freemarker.core.Environment.visit(Environment.java:209)          at freemarker.core.MixedContent.accept(MixedContent.java:92)          at freemarker.core.Environment.visit(Environment.java:209)          at freemarker.core.IfBlock.accept(IfBlock.java:82)          at freemarker.core.Environment.visit(Environment.java:209)          at freemarker.core.IteratorBlock$Context.runLoop(IteratorBlock.java:179)          at freemarker.core.Environment.visit(Environment.java:416)          at freemarker.core.IteratorBlock.accept(IteratorBlock.java:102)          at freemarker.core.Environment.visit(Environment.java:209)          at freemarker.core.MixedContent.accept(MixedContent.java:92)          at freemarker.core.Environment.visit(Environment.java:209)          at freemarker.core.IfBlock.accept(IfBlock.java:82)          at freemarker.core.Environment.visit(Environment.java:209)          at freemarker.core.MixedContent.accept(MixedContent.java:92)          at freemarker.core.Environment.visit(Environment.java:209)          at freemarker.core.Environment.process(Environment.java:189)          at freemarker.template.Template.process(Template.java:237)          at org.apache.struts2.dispatcher.Dispatcher.sendError(Dispatcher.java:748)          at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:505)          at org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)          at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)          at org.apache.struts2.dispatcher.ActionContextCleanUp.doFilter(ActionContextCleanUp.java:102)          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)          at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)          at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)          at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)          at java.lang.Thread.run(Unknown Source)      Caused by: java.lang.NullPointerException          at freemarker.ext.beans.SimpleMemberModel.unwrapArguments(SimpleMemberModel.java:85)          at freemarker.ext.beans.SimpleMethodModel.exec(SimpleMethodModel.java:106)          ... 42 more
  相关解决方案