HQL works on Tomcat not on Oracle AppServer 10.1.3?

190 views Asked by At

When running an app on Tomcat I don't get any error. When running on Oracle (OC4J) 10.1.3 I get the following:

org.hibernate.hql.ast.QuerySyntaxError: unexpected end of subtree [   
SELECT c, cc, pa, ta      
  FROM com.test.CASE c
  LEFT OUTER JOIN c.personadmin pa           
  LEFT OUTER JOIN c.termadmin ta           
  LEFT OUTER JOIN c.caseChannel cc     
 WHERE c.case_id IN ()  
ORDER BY c.case_id, cc.caseChannelCd ]
...
Caused by: <AST>: unexpected end of subtree

Seems like a library issue but I haven't found any inconsisntency (regarding Hibernate) between environments yet.

What might cause this type of error?

Edit:

Here's the source:

    String hql = "   SELECT c, cc, pa, ta " 
               + "     FROM CASE c " 
               + "          LEFT OUTER JOIN c.personadmin pa "
               + "          LEFT OUTER JOIN c.termadmin ta "
               + "          LEFT OUTER JOIN c.caseChannel cc "
               + "    WHERE c.case_id IN (:caseIds) "
               + " ORDER BY c.case_id, cc.caseChannelCd ";

    Query query = getSession().createQuery(hql);
    query.setParameterList("caseIds", caseIdList);
    results = query.list();
1

There are 1 answers

3
jpkroehling On BEST ANSWER

It's really strange that this error happens in one container, but not on the other. I'd say the problem is here:

WHERE c.case_id IN ()

Thus, it implies that it would also fail on Tomcat. So, I would first verify if the query you are running is exactly the same in both.