-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 11 posts ] 
Author Message
 Post subject: Apache Tomcat Neustart nach "grammarException" erforderlich
PostPosted: Mon Jan 30, 2012 10:36 am 
Newbie

Joined: Mon Jan 30, 2012 10:28 am
Posts: 5
Hallo liebe Hibernate-Mitstreiter,
in der Entwicklungsphase wirft mein Projekt gelegentlich eine "grammarException" wenn ich eine ungültige SQL-Abfrage verursacht habe (z.B. Bedingung X > 1 obwohl Feld X vom Typ Text ist). Lästigerweise gelingt anschließend aber aus dem Projekt überhaupt kein Zugriff (auch keine anderer, korrekter) mehr auf die Postgres-Datenbank und es ist sogar ein Neustart des Apache-Tomcat-Servers nötig um wieder einen Zugriff zu bekommen. Das ist z.B. bei einer "nullPointException" nicht erforderlich. Was macht die "grammarException" so hartnäckig und kann man etwas dagegen tun?


Top
 Profile  
 
 Post subject: Re: Apache Tomcat Neustart nach "grammarException" erforderlich
PostPosted: Mon Jan 30, 2012 11:11 am 
Expert
Expert

Joined: Tue Jun 16, 2009 3:36 am
Posts: 990
Hallo HypoBob,

bitte bringe mal den kompletten stacktracke der "grammarException" hier wieder.
Und welche sind die folgenden Exceptions?
Welche Hibernate Version benutzt Du?


Top
 Profile  
 
 Post subject: Re: Apache Tomcat Neustart nach "grammarException" erforderlich
PostPosted: Tue Jan 31, 2012 4:00 am 
Newbie

Joined: Mon Jan 30, 2012 10:28 am
Posts: 5
Hallo pb00067,

ich habe mal den Fehler provoziert (Text > Zahl im SQL-String) und bekomme dann zunächst die weiter unten stehende Fehlermeldung. Nachfolgend bringt jedes beliebige (korrekte) Ansprechen der Datenbank nur noch die folgende Fehlermeldung (es ist dann ein Neustart des Tomcat erforderlich, auch keine neue Session hilft, Hibernate-Version ist 3.6.1):

Fehlermeldung bei jedem folgenden Datenbankanruf nach der grammarException (siehe unten):

org.hibernate.exception.GenericJDBCException: could not execute query
org.hibernate.exception.GenericJDBCException: could not execute query at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:140) at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:128) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66) at org.hibernate.loader.Loader.doList(Loader.java:2536) at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2276) at org.hibernate.loader.Loader.list(Loader.java:2271) at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:452) at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:363) at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196) at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1268) at org.hibernate.impl.QueryImpl.list(QueryImpl.java:102) at


Erste Fehlermeldung beim Absetzen des fehlerhaften SQL-Strings:

WARN ["http-bio-8080"-exec-8] (JDBCExceptionReporter.java:233) - SQL Error: 0, SQLState: 42883
ERROR ["http-bio-8080"-exec-8] (JDBCExceptionReporter.java:234) - ERROR: operator does not exist: text > integer
ERROR ["http-bio-8080"-exec-8] (MessstellenKarte.java:200) - Beim Aufbau der Messstellenkartenseite ist ein Fehler aufgetreten:
org.hibernate.exception.SQLGrammarException: could not execute query
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:92)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
at org.hibernate.loader.Loader.doList(Loader.java:2536)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2276)
at org.hibernate.loader.Loader.list(Loader.java:2271)
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:452)
at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:363)
at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1268)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)
at de.bws.dbe.logic.data.backend.dao.MessstelleDao.countAuswahlNichtAlsEntity(MessstelleDao.java:157)
at de.bws.dbe.logic.data.backend.services.AbfrageService.getAnzahlMessstellenFromMatview(AbfrageService.java:128)
at de.bws.dbe.actions.auswertung.MessstellenKarte.listenFuellen(MessstellenKarte.java:279)
at de.bws.dbe.actions.auswertung.MessstellenKarte.tryToStartKommendVonDatenabfrage(MessstellenKarte.java:230)
at de.bws.dbe.actions.auswertung.MessstellenKarte.startKommendVonPhyschem(MessstellenKarte.java:198)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:452)
at com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:291)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:254)
at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:176)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:263)
at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:133)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:207)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:207)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:190)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:94)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:314)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:100)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:141)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:267)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:142)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:166)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:176)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:190)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:187)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)
at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:485)
at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:395)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:244)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:550)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:380)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:243)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:188)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:288)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: org.postgresql.util.PSQLException: ERROR: operator does not exist: text > integer
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1592)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1327)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:192)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:451)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:350)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:254)
at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:208)
at org.hibernate.loader.Loader.getResultSet(Loader.java:1953)
at org.hibernate.loader.Loader.doQuery(Loader.java:802)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:274)
at org.hibernate.loader.Loader.doList(Loader.java:2533)
... 79 more


Top
 Profile  
 
 Post subject: Re: Apache Tomcat Neustart nach "grammarException" erforderlich
PostPosted: Tue Jan 31, 2012 4:38 am 
Expert
Expert

Joined: Tue Jun 16, 2009 3:36 am
Posts: 990
Quote:
Fehlermeldung bei jedem folgenden Datenbankanruf nach der grammarException (siehe unten):

org.hibernate.exception.GenericJDBCException: could not execute query
org.hibernate.exception.GenericJDBCException: could not execute query at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:140) at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:128) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66) at org.hibernate.loader.Loader.doList(Loader.java:2536) at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2276) at org.hibernate.loader.Loader.list(Loader.java:2271) at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:452) at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:363) at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196) at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1268) at org.hibernate.impl.QueryImpl.list(QueryImpl.java:102) at


Ist das wirklich alles (der komplette Stacktrace ?) was die Maschine in Folge rausspuckt ?


Top
 Profile  
 
 Post subject: Re: Apache Tomcat Neustart nach "grammarException" erforderlich
PostPosted: Tue Jan 31, 2012 5:10 am 
Newbie

Joined: Mon Jan 30, 2012 10:28 am
Posts: 5
Sorry, das war nicht alles. Hier das vollständige Listing eines sonst funktionierenden DB-Aufrufs nachdem zuvor die grammarException aufgetreten war. Ist vielleicht die Zeile "ERROR: current transaction is aborted, commands ignored until end of transaction block" ein Hinweis darauf, dass irgendein Prozess im Tomcat, der mit der fehlerhaften Abfrage gestartet wurde, noch läuft und nun alles (bis zum Tomcat-Neustart) blockiert????

INFO ["http-bio-8080"-exec-27] (AbfrageService.java:77) - hqlString: select new de.bws.dbe.logic.data.backend.objekte.MesswertEinerAuspraegung (sum(anzahl)) from Hydro matview where matview.ms_sicht=66 and matview.p_sicht=66
WARN ["http-bio-8080"-exec-27] (JDBCExceptionReporter.java:233) - SQL Error: 0, SQLState: 25P02
ERROR ["http-bio-8080"-exec-27] (JDBCExceptionReporter.java:234) - ERROR: current transaction is aborted, commands ignored until end of transaction block
ERROR ["http-bio-8080"-exec-27] (UntersuchungsbereichBasisAction.java:195) - Beim Aktualisieren des Objekts ist ein Fehler aufgetreten:
org.hibernate.exception.GenericJDBCException: could not execute query
at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:140)
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:128)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
at org.hibernate.loader.Loader.doList(Loader.java:2536)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2276)
at org.hibernate.loader.Loader.list(Loader.java:2271)
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:452)
at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:363)
at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1268)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)
at de.bws.dbe.logic.data.backend.dao.MesswertDao.countAuswahlNichtAlsEntity(MesswertDao.java:81)
at de.bws.dbe.logic.data.backend.services.AbfrageService.getAnzahlMesswerteFromMatview(AbfrageService.java:80)
at de.bws.dbe.actions.auswertung.UntersuchungsbereichBasisAction.praeFilterUeberpruefen(UntersuchungsbereichBasisAction.java:214)
at de.bws.dbe.actions.auswertung.UntersuchungsbereichBasisAction.tryToStart(UntersuchungsbereichBasisAction.java:201)
at de.bws.dbe.actions.auswertung.UntersuchungsbereichBasisAction.start(UntersuchungsbereichBasisAction.java:193)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:452)
at com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:291)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:254)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:100)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:176)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:263)
at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:133)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:207)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:207)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:190)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:94)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:243)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:100)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:141)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:267)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:142)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:166)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:176)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:190)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:187)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)
at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:485)
at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:395)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:244)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:550)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:380)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:243)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:188)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:288)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: org.postgresql.util.PSQLException: ERROR: current transaction is aborted, commands ignored until end of transaction block
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1592)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1327)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:192)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:451)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:350)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:254)
at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:208)
at org.hibernate.loader.Loader.getResultSet(Loader.java:1953)
at org.hibernate.loader.Loader.doQuery(Loader.java:802)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:274)
at org.hibernate.loader.Loader.doList(Loader.java:2533)
... 81 more


Top
 Profile  
 
 Post subject: Re: Apache Tomcat Neustart nach "grammarException" erforderlich
PostPosted: Tue Jan 31, 2012 7:33 am 
Expert
Expert

Joined: Tue Jun 16, 2009 3:36 am
Posts: 990
Quote:
Ist vielleicht die Zeile "ERROR: current transaction is aborted, commands ignored until end of transaction block" ein Hinweis darauf, dass irgendein Prozess im Tomcat, der mit der fehlerhaften Abfrage gestartet wurde, noch läuft und nun alles (bis zum Tomcat-Neustart) blockiert????


Haargenau!
Du musst daher die abgebrochene Transaktion beenden (rollback) und eine neue beginnen, bevor Du wieder auf die Persistenz zugreifts.


Last edited by pb00067 on Tue Jan 31, 2012 8:41 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Apache Tomcat Neustart nach "grammarException" erforderlich
PostPosted: Tue Jan 31, 2012 8:39 am 
Newbie

Joined: Mon Jan 30, 2012 10:28 am
Posts: 5
Prima! Die Sache ist also eingegrenzt! Allerdings ist mir noch nicht klar, wie ich den angestossenen, fehlerhaften Prozess an die Hammelbeine bekomme und ihn beenden kann. Angestossen wird mit:

Query qry = super.getSession().createQuery("select " + idFeld + " from Messstelle where " + bezeichnungFeld.......);
qry.setString(0, feldInhalt);
lstRueck = qry.list();

Die letzte Zeile wirft den Fehler. Ich sehe aber beim Objekt qry des Typs Query keine Methode es zu beenden (close o.ä.). An welcher Stelle kann ich den Zugriff killen?


Top
 Profile  
 
 Post subject: Re: Apache Tomcat Neustart nach "grammarException" erforderlich
PostPosted: Tue Jan 31, 2012 8:43 am 
Expert
Expert

Joined: Tue Jun 16, 2009 3:36 am
Posts: 990
Ich nehme an, dass Du die transaction mit

Code:
hiberantesession.getTransaction().rollback();


beenden kannst.

Mit einer neuen Transaktion sollte alles wieder funktionieren, zumindest theoretisch...

P.S.: Uebgrigens liegt das eigentliche Problem nicht bei Hibernate sondern beim JDBC-Treiber von Postgres,
denn es ist letzterer der die Folge-exceptinos wirft.


Top
 Profile  
 
 Post subject: Re: Apache Tomcat Neustart nach "grammarException" erforderlich
PostPosted: Tue Jan 31, 2012 8:49 am 
Expert
Expert

Joined: Tue Jun 16, 2009 3:36 am
Posts: 990
Lies mal das:

http://stackoverflow.com/questions/3672219/hibernate-error-current-transaction-is-aborted-commands-ignored-until-end-of-t


Top
 Profile  
 
 Post subject: Re: Apache Tomcat Neustart nach "grammarException" erforderlich
PostPosted: Wed Feb 01, 2012 5:51 am 
Newbie

Joined: Mon Jan 30, 2012 10:28 am
Posts: 5
Hallo,

mit

hiberantesession.getTransaction().rollback();

hatte ich keinen Erfolg (es kam die Meldung, dass das die Transaktion gar nicht erfolgreich gestartet werden konnte). Auch ein Close auf die Zugriffs-Session brachte keinen erfolgt. Auch wenn die Session anschließend geschlossen war (habe ich abgefragt) war der Datenbankzugriff weiterhin blockiert und erforderte den Tomcat-Neustart.

Gibt es noch irgendeine (gern auch Dampfhammer-) Methode um den Datenbankzugriff zurückzusetzen (vielleicht auch auf JDBC-Ebene) um ein Weiterarbeiten ohne Tomcat-Neustart zu ermöglichen?


Top
 Profile  
 
 Post subject: Re: Apache Tomcat Neustart nach "grammarException" erforderlich
PostPosted: Thu Feb 02, 2012 3:47 am 
Expert
Expert

Joined: Tue Jun 16, 2009 3:36 am
Posts: 990
Quote:
hiberantesession.getTransaction().rollback();

hatte ich keinen Erfolg (es kam die Meldung, dass das die Transaktion gar nicht erfolgreich gestartet werden konnte).


HypoBob, wenn Du weiterhin Exceptions lediglich nach eigenem Gutdünken interpretierst,
ohne die eigentliche Exception mit stacktrace wiederzugeben, kann Dir schlecht geholfen werden.

Und wo ruft Du das Rollback auf ? Kannst Du vielleicht Deinen Code mit dem Exceptionhandling wiedergeben
und dazu markieren an welchen Stellen die Exceptions geworfen werden?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 11 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.