Derby
  1. Derby
  2. DERBY-3848

dblook fails to connect an authenticated database

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Duplicate
    • Affects Version/s: 10.4.1.3
    • Fix Version/s: None
    • Component/s: Tools
    • Labels:
      None
    • Environment:
    • Urgency:
      Normal

      Description

      dblook is not connecting an authenticated database.

      I create an authenticated database this way:

      1. ij
      2. connect 'jdbc:derby:dblooktest;create=true;user=test;password=test';
      3. CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.connection.requireAuthentication','true');
      4. CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.user.test', 'test');
      5. CREATE TABLE DBLOOKTESTTABLE(I INT NOT NULL PRIMARY KEY);
      6. disconnect;
      7. quit;

      And use dblook this way:

      8. dblook -d 'jdbc:derby:dblooktest;user=test;password=test';

      Then an error is reported (dblook.log contents are at the end of this description);

      Nevertheless, if I do not require authentication:

      9. CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.connection.requireAuthentication','false');

      Then dblook works properly:

      10. dblook -d 'jdbc:derby:dblooktest;user=test;password=test';
      11. dblook -d 'jdbc:derby:dblooktest';

      Thus, the same connection url that works in ij for an authenticated database does not in dblook.

      =========== dblook.log

      java.sql.SQLNonTransientConnectionException: Se ha producido una anomalía de autenticación de conexión. Razón: Autenticación no válida..
      at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
      at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
      at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
      at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
      at org.apache.derby.impl.jdbc.EmbedConnection.newSQLException(Unknown Source)
      at org.apache.derby.impl.jdbc.EmbedConnection.checkUserCredentials(Unknown Source)
      at org.apache.derby.impl.jdbc.EmbedConnection.<init>(Unknown Source)
      at org.apache.derby.impl.jdbc.EmbedConnection30.<init>(Unknown Source)
      at org.apache.derby.impl.jdbc.EmbedConnection40.<init>(Unknown Source)
      at org.apache.derby.jdbc.Driver40.getNewEmbedConnection(Unknown Source)
      at org.apache.derby.jdbc.InternalDriver.connect(Unknown Source)
      at org.apache.derby.jdbc.AutoloadedDriver.connect(Unknown Source)
      at java.sql.DriverManager.getConnection(DriverManager.java:582)
      at java.sql.DriverManager.getConnection(DriverManager.java:207)
      at org.apache.derby.tools.dblook.go(Unknown Source)
      at org.apache.derby.tools.dblook.<init>(Unknown Source)
      at org.apache.derby.tools.dblook.main(Unknown Source)
      Caused by: java.sql.SQLException: Se ha producido una anomalía de autenticación de conexión. Razón: Autenticación no válida..
      at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
      at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown Source)
      ... 17 more
      – **--> DEBUG: Se ha producido una anomalía de autenticación de conexión. Razón: Autenticación no válida..

      1. test.sh
        0.5 kB
        Dag H. Wanvik
      2. derby.log
        4 kB
        Antonio Sánchez
      3. dblook.log
        2 kB
        Antonio Sánchez

        Issue Links

          Activity

          Hide
          Dag H. Wanvik added a comment -

          I enclose a bash script which I used to try to reproduce the error on 10.4 trunk,
          but I failed. Notice that I included an explicit shutdown. If you add that, does it
          still fail?

          Show
          Dag H. Wanvik added a comment - I enclose a bash script which I used to try to reproduce the error on 10.4 trunk, but I failed. Notice that I included an explicit shutdown. If you add that, does it still fail?
          Hide
          Antonio Sánchez added a comment -

          Using 'test.sh' causes ij to complain:

          • "ERROR XJ015: Conclusión del sistema Derby."

          Because of the explicit shutdown :

          • connect 'jdbc:derby:;shutdown=true';

          when run in isolation or below 'disconnect' ('disconnect' alone works normally).

          dblook still fails to connect.

          – Note: I have used the scripts (ij, dblook) instead of directly the jre.

          Show
          Antonio Sánchez added a comment - Using 'test.sh' causes ij to complain: "ERROR XJ015: Conclusión del sistema Derby." Because of the explicit shutdown : connect 'jdbc:derby:;shutdown=true'; when run in isolation or below 'disconnect' ('disconnect' alone works normally). dblook still fails to connect. – Note: I have used the scripts (ij, dblook) instead of directly the jre.
          Hide
          Dag H. Wanvik added a comment -

          The message ERROR XJ015: Conclusión del sistema Derby
          is normal.

          Not sure why dblook can't connect, it works for me. Can you run the script I enclosed and
          attach the output and derby.log to this issue?

          Show
          Dag H. Wanvik added a comment - The message ERROR XJ015: Conclusión del sistema Derby is normal. Not sure why dblook can't connect, it works for me. Can you run the script I enclosed and attach the output and derby.log to this issue?
          Hide
          Antonio Sánchez added a comment -

          I am attaching both logs.

          I'm going to try this at other system(s) and will let you know.

          This is the OUTPUT:

          antonio@antonio-laptop:~/temp/derby$ ./test.sh
          Versión ij 10.4
          ij> ij> 0 filas insertadas/actualizadas/suprimidas
          ij> 0 filas insertadas/actualizadas/suprimidas
          ij> 0 filas insertadas/actualizadas/suprimidas
          ij> ij> ERROR XJ015: Conclusión del sistema Derby.
          ij> – Indicación de hora: 2008-08-27 14:37:47.679
          – Base de datos origen: dblooktest
          – URL de conexión: jdbc:derby:dblooktest
          – appendLogs: false

          – Nota: Se encontró por lo menos un mensaje de error/aviso
          – en la generación de DLL. Consulte el archivo dblook.log
          – para ver los mensajes.

          Show
          Antonio Sánchez added a comment - I am attaching both logs. I'm going to try this at other system(s) and will let you know. This is the OUTPUT: antonio@antonio-laptop:~/temp/derby$ ./test.sh Versión ij 10.4 ij> ij> 0 filas insertadas/actualizadas/suprimidas ij> 0 filas insertadas/actualizadas/suprimidas ij> 0 filas insertadas/actualizadas/suprimidas ij> ij> ERROR XJ015: Conclusión del sistema Derby. ij> – Indicación de hora: 2008-08-27 14:37:47.679 – Base de datos origen: dblooktest – URL de conexión: jdbc:derby:dblooktest – appendLogs: false – Nota: Se encontró por lo menos un mensaje de error/aviso – en la generación de DLL. Consulte el archivo dblook.log – para ver los mensajes.
          Hide
          Antonio Sánchez added a comment - - edited

          Just tried at different system with same results, although they are both Ubuntu 8.04.1 (2.6.24-19-generic). Not yet tried in Windows.

          <<<<< COMMENT UPDATE 1 >>>>>

          Works in Windows Home, java hotspot 1.6.0_04, derby 10.3.2.1 and 10.4.1.3.

          <<<<< COMMENT UPDATE 2 >>>>>

          Also working in Windows and java hotspot 1.6.0_07, derby 10.4.1.3. Unable to test with java 1.6.0_06 in Windows.

          NOTE: always testing using derby scripts at bin directory instead of jre call.

          <<<<< COMMENT UPDATE 3 >>>>> <b>¡¡¡FOUND!!!</b>

          OK, I think I got it. It works using jre instead of the scripts of the bin distribution, exactly as Dag's script does. But previosly running 'setEmbeddedCP' did nothing so I had to explicitly set and export $CLASSPATH by myself prior running the script.

          So, it seems there must be something wrong that causes 'dblook' bin distribution script not interacting well with my ubuntu operating system. The first ubuntu I tried had derby installed at /usr/local as root and has months installed; the second one is just installed and derby was user local installed.

          I'm sorry I am not good with scripting, any ideas of what the problem might be?

          Show
          Antonio Sánchez added a comment - - edited Just tried at different system with same results, although they are both Ubuntu 8.04.1 (2.6.24-19-generic). Not yet tried in Windows. <<<<< COMMENT UPDATE 1 >>>>> Works in Windows Home, java hotspot 1.6.0_04, derby 10.3.2.1 and 10.4.1.3. <<<<< COMMENT UPDATE 2 >>>>> Also working in Windows and java hotspot 1.6.0_07, derby 10.4.1.3. Unable to test with java 1.6.0_06 in Windows. NOTE: always testing using derby scripts at bin directory instead of jre call. <<<<< COMMENT UPDATE 3 >>>>> <b>¡¡¡FOUND!!!</b> OK, I think I got it. It works using jre instead of the scripts of the bin distribution, exactly as Dag's script does. But previosly running 'setEmbeddedCP' did nothing so I had to explicitly set and export $CLASSPATH by myself prior running the script. So, it seems there must be something wrong that causes 'dblook' bin distribution script not interacting well with my ubuntu operating system. The first ubuntu I tried had derby installed at /usr/local as root and has months installed; the second one is just installed and derby was user local installed. I'm sorry I am not good with scripting, any ideas of what the problem might be?
          Hide
          Dag H. Wanvik added a comment -

          I don't have a Ubuntu available now, is there someone who has a Ubuntu 8 installed who can check what lives in its bin to see if we can figure this out out?

          Show
          Dag H. Wanvik added a comment - I don't have a Ubuntu available now, is there someone who has a Ubuntu 8 installed who can check what lives in its bin to see if we can figure this out out?
          Hide
          Kristian Waagan added a comment -

          Triaged July 3, 2009: Assigned normal urgency.

          Show
          Kristian Waagan added a comment - Triaged July 3, 2009: Assigned normal urgency.
          Hide
          Denis Weerasiri added a comment -

          I tried this on

          Ubuntu 9.04
          Java(TM) SE Runtime Environment (build 1.6.0_06-b02)
          Derby - 10.5.3.0

          I didn't see any problem while connecting. Is this issue already resolved?

          Show
          Denis Weerasiri added a comment - I tried this on Ubuntu 9.04 Java(TM) SE Runtime Environment (build 1.6.0_06-b02) Derby - 10.5.3.0 I didn't see any problem while connecting. Is this issue already resolved?
          Hide
          Knut Anders Hatlen added a comment -

          I think this is the same issue as DERBY-4117, which was fixed in 10.5.1.1.

          The dblook script didn't properly quote the arguments, so instead of running the command

          java -cp ... org.apache.derby.tools.dblook -d 'jdbc:derby:dblooktest;user=test;password=test';

          it ran three commands

          java -cp ... org.apache.derby.tools.dblook -d jdbc:derby:dblooktest
          user=test
          password=test

          Show
          Knut Anders Hatlen added a comment - I think this is the same issue as DERBY-4117 , which was fixed in 10.5.1.1. The dblook script didn't properly quote the arguments, so instead of running the command java -cp ... org.apache.derby.tools.dblook -d 'jdbc:derby:dblooktest;user=test;password=test'; it ran three commands java -cp ... org.apache.derby.tools.dblook -d jdbc:derby:dblooktest user=test password=test
          Hide
          Knut Anders Hatlen added a comment -

          Closing as duplicate of DERBY-4117.

          Show
          Knut Anders Hatlen added a comment - Closing as duplicate of DERBY-4117 .

            People

            • Assignee:
              Unassigned
              Reporter:
              Antonio Sánchez
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development