Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-7127738

Class not found

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: P5 P5
    • None
    • 7
    • core-libs
    • x86
    • windows_xp

      FULL PRODUCT VERSION :
      Microsoft Windows XP [Version 5.1.2600]
      (C) Copyright 1985-2001 Microsoft Corp.

      C:\Documents and Settings\Jon>java -version
      java version "1.7.0_04-ea"
      Java(TM) SE Runtime Environment (build 1.7.0_04-ea-b06)
      Java HotSpot(TM) Client VM (build 23.0-b09, mixed mode, sharing)



      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows XP [Version 5.1.2600]
      (C) Copyright 1985-2001 Microsoft Corp.



      EXTRA RELEVANT SYSTEM CONFIGURATION :
      TextPad 5.x

      A DESCRIPTION OF THE PROBLEM :
      The code snippet which I sourced from Core Java Volume 2 (7th Edition) ISBN 0-13-111826-9, chapter 4, is giving an error, which says that it cannot find a file which exists within the directory.

      REGRESSION. Last worked in version 7


      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      java.sql.SQLException: No suitable driver found for jdbc:postgresql:corejava
              at java.sql.DriverManager.getConnection(Unknown Source)
              at java.sql.DriverManager.getConnection(Unknown Source)
              at TestDB.getConnection(TestDB.java:82)
              at TestDB.runTest(TestDB.java:43)
              at TestDB.main(TestDB.java:20)
      Error: Could not find or load main class TestDB.class
      Press any key to continue . . .

      Command line log:
      Microsoft Windows XP [Version 5.1.2600]
      (C) Copyright 1985-2001 Microsoft Corp.

      C:\Documents and Settings\Jon>cd workspace

      C:\Documents and Settings\Jon\workspace>dir
       Volume in drive C has no label.
       Volume Serial Number is D80F-8634

       Directory of C:\Documents and Settings\Jon\workspace

      05/01/2012 21:49 <DIR> .
      05/01/2012 21:49 <DIR> ..
      18/09/2011 14:59 <DIR> .metadata
      11/09/2011 17:45 <DIR> .tags
      05/01/2012 19:12 <DIR> EmployeeSystem
      02/01/2012 22:13 <DIR> JavaDev
                     0 File(s) 0 bytes
                     6 Dir(s) 33,802,166,272 bytes free

      C:\Documents and Settings\Jon\workspace>cd JavaDev

      C:\Documents and Settings\Jon\workspace\JavaDev>dir
       Volume in drive C has no label.
       Volume Serial Number is D80F-8634

       Directory of C:\Documents and Settings\Jon\workspace\JavaDev

      02/01/2012 22:13 <DIR> .
      02/01/2012 22:13 <DIR> ..
      11/09/2011 17:51 <DIR> corejava7
      09/04/2011 18:14 <DIR> corejava8
      14/08/2011 09:31 2,487 Java CLI.lnk
      20/04/2008 11:44 241 Java Platform SE 6.url
      06/01/2012 15:56 <DIR> myCode Snippets
                     2 File(s) 2,728 bytes
                     5 Dir(s) 33,802,166,272 bytes free

      C:\Documents and Settings\Jon\workspace\JavaDev>cd corejava7\v2\v2ch4

      C:\Documents and Settings\Jon\workspace\JavaDev\corejava7\v2\v2ch4>dir
       Volume in drive C has no label.
       Volume Serial Number is D80F-8634

       Directory of C:\Documents and Settings\Jon\workspace\JavaDev\corejava7\v2\v2ch4


      11/07/2011 16:14 <DIR> .
      11/07/2011 16:14 <DIR> ..
      16/07/2011 21:43 <DIR> ExecSQL
      16/07/2005 10:26 <DIR> LDAPTest
      11/07/2011 15:54 <DIR> PostgresqlTest
      11/07/2011 19:24 <DIR> QueryDB
      16/07/2005 10:26 <DIR> RowSetTest
      06/01/2012 17:54 <DIR> TestDB
      12/07/2011 15:34 <DIR> ViewDB
                     0 File(s) 0 bytes
                     9 Dir(s) 33,802,166,272 bytes free

      C:\Documents and Settings\Jon\workspace\JavaDev\corejava7\v2\v2ch4>cd TestDB

      C:\Documents and Settings\Jon\workspace\JavaDev\corejava7\v2\v2ch4\TestDB>dir
       Volume in drive C has no label.
       Volume Serial Number is D80F-8634

       Directory of C:\Documents and Settings\Jon\workspace\JavaDev\corejava7\v2\v2ch4
      \TestDB

      06/01/2012 17:54 <DIR> .
      06/01/2012 17:54 <DIR> ..
      10/07/2011 17:22 119 database.properties
      10/07/2011 17:21 131 database.properties.old
      05/01/2012 19:11 551,290 postgresql-9.1-901.jdbc4.jar
      06/01/2012 06:02 124 run.bat
      06/01/2012 17:44 2,166 TestDB.class
      29/09/2004 18:45 2,192 TestDB.java
      06/01/2012 17:46 157 tp044cf2.BAT
                     7 File(s) 556,179 bytes
                     2 Dir(s) 33,802,166,272 bytes free

      C:\Documents and Settings\Jon\workspace\JavaDev\corejava7\v2\v2ch4\TestDB>prompt
      $g
      'prompt$g' is not recognized as an internal or external command,
      operable program or batch file.

      C:\Documents and Settings\Jon\workspace\JavaDev\corejava7\v2\v2ch4\TestDB>prompt
       $g

      >type run.bat
      @ECHO OFF
      C:
      java -Djdbc.drivers=org.postgresql.Driver TestDB
      java -cp postgresql-9.1-901.jdbc4.jar TestDB.class
      PAUSE

      >run
      java.sql.SQLException: No suitable driver found for jdbc:postgresql:corejava
              at java.sql.DriverManager.getConnection(Unknown Source)
              at java.sql.DriverManager.getConnection(Unknown Source)
              at TestDB.getConnection(TestDB.java:82)
              at TestDB.runTest(TestDB.java:43)
              at TestDB.main(TestDB.java:20)
      Error: Could not find or load main class TestDB.class
      Press any key to continue . . .

      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      Not found so far.

            lancea Lance Andersen
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: