5 Replies Latest reply on Jul 8, 2002 1:06 AM by dudoes

    Can't findAll

    dudoes Newbie

      Hello,

      I have deploy my applicant to Weblogic Server 6.1 successfully with EJB1.1 on Oracle 8i, and now i want to migrate it to NEW JBOSS3.0 w/Tomcat4, but it can't "findall", say :

      ===================
      java.rmi.ServerException: can't find All....Find failed: java.sql.SQLException: ORA-00942: the table or view doesn't exist.
      ; nested exception is:
      javax.ejb.EJBException: can't find All....Find failed: java.sql.SQLException: ORA-00942: the table or view doesn't exist.

      javax.ejb.EJBException: can't find All....Find failed: java.sql.SQLException: ORA-00942: the table or view doesn't exist.

      at com.rongji.pms.applicant.ApplicantSessionBean.findAll(ApplicantSessionBean.java:580)
      at java.lang.reflect.Method.invoke(Native Method)
      at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:664)
      ==================

      then i find output on console:
      ======================
      [org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory] Using properties: {user=project, password=project}
      2002-07-04 00:22:05,829 DEBUG [org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory] Checking driver for URL: jdbc:oracle:thin:@localhost:1521:ORCL
      2002-07-04 00:22:05,829 DEBUG [org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory] Driver not yet registered for url: jdbc:oracle:thin:@localhost:1521:ORCL
      2002-07-04 00:22:05,869 DEBUG [org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory] Driver not yet registered for url: jdbc:oracle:thin:@localhost:1521:ORCL
      2002-07-04 00:22:05,869 DEBUG [org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory] Driver already registered for url: jdbc:oracle:thin:@localhost:1521:ORCL
      2002-07-04 00:22:16,104 DEBUG [org.jboss.ejb.plugins.jaws.jdbc.JDBCCommand] findAll command executing: SELECT projectId FROM ApplicantInfo
      2002-07-04 00:22:16,364 ERROR [org.jboss.ejb.plugins.jaws.jdbc.JDBCCommand] Exception caught executing SQL
      =============================

      I don't understand, I need you help,

      thanks very much.

        • 1. Re: Can't findAll
          Dain Sundstrom Master

          What is the problem? Do you want to map the entity to an existing table? If you do, you need to declare the mapping in the jbosscmp-jdbc.xml file. The is described in the JBossCMP documentation, or you can figure it out from the dtd in the docs/dtd directory of the JBoss distribution.

          • 2. Re: Can't findAll
            dudoes Newbie

            think u for you reply, i'm studying your suggestion and try again.
            can you tel me thatw hat difference jboss-ql with ejb-ql,plz give me a sample of SQL statement.

            below is correct ?

            ==========================



            findAll

            <query-method>
            <method-name>findAll</method-name>
            <method-params>
            </method-params>
            </query-method>
            <jboss-ql>
            SELECT OBJECT(p) FROM applicantInfo p
            </jboss-ql>


            ======================================


            • 3. Re: Can't findAll
              Dain Sundstrom Master

              Yes that is a correct JBossQL declaration. This declaration should be put in the jbosscmp-jdbc.xml file.

              JBossQL is an extension of EJB-QL with a new functions, clauses and a more flexable syntax (i.e., paramteres in IN and LIKE clauses). You do not need JBossQL for a findAll query.

              • 4. Re: Can't findAll
                dudoes Newbie

                Hi,dsundstrom:

                Happy Independence Day to you.

                I change my program code by your suggestion like the code mailed to you, deployed successfully, but run badly as before.

                I only put the jboss-ql tags in jbosscmp-jdbc.xml,
                is sure that the same jboss-ql tags should exist in ejb-jar.xml? or change it?

                I wish you give me some JBossQL and EJB-QL SQL statements because I need various "findByXXX".

                thanks very much.



                • 5. Re: Can't findAll
                  dudoes Newbie

                  Ok,thank everyone.