10 Replies Latest reply on May 10, 2002 9:39 AM by hildebm

    Cannot connect to Oracle (3.0.0RC2)

    prilmeie

      Hello,

      I am trying to connect to an Oracle 8i database, but it always fails. The driver is in the classes12.zip, which I copied to the lib and the lib/ext folder (which one is the right to choose?).

      I took the standard oracle-service.xml and adapted it to my needs. The EJB should get their connection without having to specify which user name or password to use. Therefore I specified both values in the oracle-service.xml

      An extract from the log file is attached.

      Regards,
      Franz Prilmeier

        • 1. Re: Cannot connect to Oracle (3.0.0RC2)
          prilmeie

          forgot to attach some files.

          These are my login-config.xml, oracle-service.xml and one of my jboss.xml files

          • 2. Re: Cannot connect to Oracle (3.0.0RC2)
            davidjencks

            I am highly suspicious. There is no lib/ext directory in jboss 3.

            • 3. Re: Cannot connect to Oracle (3.0.0RC2)
              bjs_pd

              Hi prilmaie!

              Try to copy the classes12.zip into the /jboss/lib directory and rename it to classes12.jar. There is no way for JBOSS to extract ZIP-Files.

              CU
              BJ

              • 4. Re: Cannot connect to Oracle (3.0.0RC2)
                prilmeie

                I thought JBoss 3 makes no difference between .jar and .zip files? Yet your tip didn't help.

                thanks anyway.

                • 5. Re: Cannot connect to Oracle (3.0.0RC2)
                  davidjencks

                  Maybe there is a typo in this line:

                  <config-property name="ConnectionURL" type="java.lang.String">jdbc:oracle:thin:@localhort:1521:orcl</config-property>

                  localhort

                  • 6. Re: Cannot connect to Oracle (3.0.0RC2)
                    blanchardah

                    I'm using 3.0RC2

                    I too am having problems, but mine are a bit different. I'm connecting to an Oracle8i database and the oracle-service.xml *appears* to be loading properly. My oracle-service.xml was copied from the /docs/examples/jca directory. I simply added my connect info, and commented out the OracleDbRealm

                    However, even though I've set the minSize for the pool to be 2, I don't see any DB connections on Oracle. I've created a SessionBean that simply tries to query the database, but no luck. I'm writing some debug info at each step and its failing on the query (strange).

                    I'm getting a valid DataSource from the OracleDS JNDI lookup. I can then get a Connection and create a statement. However, no matter what I query the following exception gets raised:

                    java.sql.SQLException: Table not found: GUESTBOOK in statement [SELECT count(*) AS cnt FROM guestbook]

                    Any ideas?

                    Thank you,
                    Andy

                    • 7. Re: Cannot connect to Oracle (3.0.0RC2)
                      benw

                      Andy,

                      If it is coming back with "Table not found", then Oracle is trying to tell you it cannot find the table "guestbook". The best thing to try is to log in to Oracle using SQL*PLUS (or whatever database tool you use) and run the same query. BUT make sure you are logging in using the same login/password you put in the oracle-service.xml file. Most likely, it has to do with the table owned by another user than the one you logged in as.

                      Ben

                      • 8. Re: Cannot connect to Oracle (3.0.0RC2)
                        blanchardah

                        Ben,

                        Thanks for responding, but thats the first thing I tried. I *carefully* made sure there were no problems.

                        SELECT SYSDATE FROM DUAL
                        SELECT COUNT(*) FROM GUESTBOOK
                        SELECT COUNT(TABLE_NAME) FROM USER_TABLES;

                        Every query fails with "table not found". However, I'm not sure its actually Oracle generating the error -- could JBoss be issuing this error (bogusly)?

                        I'm just starting the switch from JRun to JBoss. I have no problem doing the same through JRun. In fact, I've tried various things that the account has permissions to (verifiable by logging in through SQL*Plus).

                        Any suggestions?

                        Thanks,
                        Andy

                        • 9. Re: Cannot connect to Oracle (3.0.0RC2)
                          davidjencks

                          There is no way JBoss can be generating these exceptions. If the Oracle specific queries such as

                          select sysdate from dual

                          don't work it suggests that you are not in fact connecting to oracle.

                          I'd try
                          Connection c = ...
                          log.info(c.getMetaData().getDriverVersion());

                          and things like that.

                          Could I ask why you chose not to use container managed security?

                          • 10. Re: Cannot connect to Oracle (3.0.0RC2)
                            hildebm

                            Hello Franz,

                            you have do put the classes12.zip into the lib directory. I am working with the attached oracle-service.xml file.

                            Good luck,
                            Markus