Typecast error of postgres in Jboss while calling finder method in Ejb 2.1

41 Views Asked by At

First of all, things were working perfectly in my previous laptop, when I shifted my code to the new laptop I am getting this error, Basically, I am calling finder method in my EJB and code of it was working fine as in EJB-jar it looks like this

  <query>
    <query-method>
      <method-name>finduserrightsonform</method-name>
      <method-params>
        <method-param>java.lang.String</method-param>
        <method-param>java.lang.String</method-param>
      </method-params>
    </query-method>
    <ejb-ql>select object(o) from UserRightsOnForm o where o.ser_groups_users_id=?1 and o.ser_form_id=?2</ejb-ql>
  </query>

as both columns in DB are integers so as in my previous laptop Postgres auto-cast it's there, but what I am missing is strange.

so far as I tried

  1. cast using cast(columnname as character varying) e.g. it also through error
  2. change method param to Integer it will not work as well, in fact, stoped deployed the jar
  3. changing the Postgress versions to the previous one.
  4. casting like using ::smallint

Caused by: org.postgresql.util.PSQLException: ERROR: operator does not exist: integer = character varying ERROR [stderr] (EJB default - 3) Hint: No operator matches the given name and argument type(s). You might need to add explicit type casts.

its look like the environment maybe jar issue but what I am missing not catching it.

calling code:

sms.viewUserRightsOnFormImpl(userId, "validationForm", groupId);

defination:

Collection findUserRightOnForm(String user_id, String form_id) throws FinderException;

using Jdevelper 11g postgress 9.2 Jboss 6 EJB 2.1

Note: Tried all google links and stackover links almost wasted my 2 days.

0

There are 0 best solutions below