0 Replies Latest reply on Feb 3, 2005 6:20 AM by salgiza

    Hibernate + Jboss not working

    salgiza

      Hi,
      we are considering to use Jboss 4.0 (using Hibernate) in our future developements. We have successfully compiled and executed a small java app using just Hibernate. However, we have been unable to port that small app to Hibernate on Jboss.
      Using the JBoss 4.0 manual, and googling around, I think we have correctly configured and deployed our app in Jboss (then, maybe not, because it's not working). However, when we try to execute a simple query, this is the resulting error:

      12:00:23,651 ERROR [LogInterceptor] EJBException in method: public abstract java.util.List com.aitanasbs.conexion400.interfaces.Fachada.getArticulos(java.lang.String) throws java.rmi.RemoteException:
      javax.ejb.EJBException: in expected: ob [from CdCliente ob where ob.CdClienteApellidos like '%Rafael%']


      We have both tried to connect to a MySQL and a DB2-400 database, and we are always getting the same error. Could anybody help us to find what the problem is? :-(

      This is the code that executes the query (we are using the classes created by the Eclipse plug-in Hibernate Synchronizer):

      Context ctx = new InitialContext();
      SessionFactory factory = (SessionFactory)ctx.lookup("java:/hibernate/SessionFactory");
      Session hsession = factory.openSession();
      return hsession.find("from CdCliente ob where ob.CdClienteApellidos like '%Rafael%'");
      


      We are using MySQL 4.1 + JBoss 4.0 on Windows, and developing with JBoss-IDE.