views:

1443

answers:

2
exception 
javax.servlet.ServletException: org.hibernate.exception.GenericJDBCException: could not execute query
    org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:286)
    org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
    org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:803)


root cause 
org.hibernate.exception.GenericJDBCException: could not execute query
    org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:91)
    org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:79)
    org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
    org.hibernate.loader.Loader.doList(Loader.java:2153)
    org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2029)
    org.hibernate.loader.Loader.list(Loader.java:2024)
    org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:369)
    org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:300)
    org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:153)
    org.hibernate.impl.SessionImpl.list(SessionImpl.java:1127)
    org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
    org.cosmosociety.actions.BlogAction.execute(BlogAction.java:35)

My environment is postgre + tomcat + hibernate 3 + struts 1.x. I am going to take a look at hibernate 3 source code later. I will update everybody if I find the solution.

+2  A: 

Have you checked your permissions? If it is working locally and not on your hosting, you may have credentials issue.

David Rabinowitz
This is a great point. However, in my case, it does not seem to apply. Thank you.
Winston Chen
+1  A: 

Check for the differences between the 'hosting server' and your local machine.

Especially do a diff on the two schemas

For further debugging:

  • Activate SQL-Logging, so you get the offending sql-statement. If you can't do it globally do it programmatically before the command causing the exception and deactivate it afterwards.

  • Execute the sql statement on your machine and on the 'hosting server'

  • Assuming you get an exception on the hosting server, but still don't see the reason, simplify the sql statement step by step, until you find the problematic piece, which in turn should identify the problem pretty well.

Jens Schauder
Thanks, I will check through these points and update everybody here:)
Winston Chen