Derby
  1. Derby
  2. DERBY-3830

NPE connecting to a database with an empty username

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 10.4.1.3
    • Fix Version/s: None
    • Component/s: JDBC
    • Environment:
      EclipseLink 1.0
    • Urgency:
      Normal

      Description

      Connecting with username="" and password="" causes a NPE to be thrown:

      java.sql.SQLException: Java exception: ': java.lang.NullPointerException'.
      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.javaException(Unknown Source)
      at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown Source)
      at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown Source)
      at org.apache.derby.impl.jdbc.EmbedConnection.handleException(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:154)
      at org.eclipse.persistence.sessions.DefaultConnector.connect(DefaultConnector.java:97)
      ... 28 more
      Caused by: java.sql.SQLException: Java exception: ': java.lang.NullPointerException'.
      at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
      at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown Source)
      ... 43 more
      Caused by: java.lang.NullPointerException
      at java.util.Hashtable.put(Hashtable.java:394)
      at org.apache.derby.impl.jdbc.EmbedConnection.filterProperties(Unknown Source)
      at org.apache.derby.impl.jdbc.EmbedConnection.bootDatabase(Unknown Source)
      ... 37 more

      I am expecting to be able to create and connect to a database with an empty username/password combination

        Activity

        Hide
        Kristian Waagan added a comment -

        Can you please specify how you obtained the connection?
        I tried a few alternatives, but couldn't reproduce the error.
        Can you reproduce it locally?
        And which VM did you use?

        Since the values inserted into the Hashtable/Properties are taken from another Hashtable/Properties, I'm having some trouble understanding what's going on.

        Thanks,

        Show
        Kristian Waagan added a comment - Can you please specify how you obtained the connection? I tried a few alternatives, but couldn't reproduce the error. Can you reproduce it locally? And which VM did you use? Since the values inserted into the Hashtable/Properties are taken from another Hashtable/Properties, I'm having some trouble understanding what's going on. Thanks,
        Hide
        Sabari S Kumar added a comment -

        Can you put more details on this issue so that we can reproduce it.?

        Show
        Sabari S Kumar added a comment - Can you put more details on this issue so that we can reproduce it.?
        Hide
        Gili added a comment -

        Take EclipseLink (I used version 1.0.0 but a newer version should be fine) and try connecting to a local Derby database. The default EclipseLink configuration is that if you don't provide a username/password in persistence.xml it will try connecting with an empty-string username and password. I used Java6 update 10.

        Show
        Gili added a comment - Take EclipseLink (I used version 1.0.0 but a newer version should be fine) and try connecting to a local Derby database. The default EclipseLink configuration is that if you don't provide a username/password in persistence.xml it will try connecting with an empty-string username and password. I used Java6 update 10.
        Hide
        Kathey Marsden added a comment -

        Sabari are you working on this issue?

        Show
        Kathey Marsden added a comment - Sabari are you working on this issue?
        Hide
        Kristian Waagan added a comment -

        Triaged July 3, 2009: Assigned normal urgency. Unassigned Sabari due to inactivity - feel free to grab the issue again if you want to continue working on it!

        Show
        Kristian Waagan added a comment - Triaged July 3, 2009: Assigned normal urgency. Unassigned Sabari due to inactivity - feel free to grab the issue again if you want to continue working on it!

          People

          • Assignee:
            Unassigned
            Reporter:
            Gili
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:

              Development