Derby
  1. Derby
  2. DERBY-1772

Error 42Z78 "Failed to locate 'Xalan' API classes" should not have sqlstate class '42'

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 10.2.1.6
    • Fix Version/s: 10.2.1.6, 10.3.1.4
    • Component/s: SQL
    • Labels:
      None

      Description

      This is a run-time error but it has the SQL state '42' for compile error, and thus in Java SE 6 will have a SQLException of type SQLSyntaxErrorException.

      ERROR 38000: The exception 'java.sql.SQLSyntaxErrorException: Failed to locate '
      Xalan' API or implementation classes. XML operations are not permitted unless t
      hese classes are in your classpath.' was thrown while evaluating an expression.
      ERROR 42Z78: Failed to locate 'Xalan' API or implementation classes. XML operat
      ions are not permitted unless these classes are in your classpath.

        Activity

        Hide
        A B added a comment -

        Changes in trunk and 10.2 and no further comments, so closing the issue.

        Show
        A B added a comment - Changes in trunk and 10.2 and no further comments, so closing the issue.
        Hide
        A B added a comment -

        Patch has now been mega-merged to 10.2. I ran xmlSuite on Windows 2000 with ibm142 to make sure all is well, and also manually verified that the changes are in. So I'm setting Fixin, unchecking "Patch Available", and resolving this issue.

        Show
        A B added a comment - Patch has now been mega-merged to 10.2. I ran xmlSuite on Windows 2000 with ibm142 to make sure all is well, and also manually verified that the changes are in. So I'm setting Fixin, unchecking "Patch Available", and resolving this issue.
        Hide
        A B added a comment -

        Attaching the simplest patch possible for this issue--just changes SQLSTATE '42Z78' to a Derby-specific SQLSTATE, 'XML00'. I also moved SQLSTATE '42Z7Z' to 'XML01' since I believe it falls into the same category of "Derby-specific errors that are not covered by the SQLStandard."

        I read through the SQL standard definitions for SQLSTATES and none of them jumped out at me as being more appropriate than '42', so I just created a new set of SQLSTATEs, "XMLxx", for this particular issue. As I said, this was just the easiest way to go; if anyone can suggest a better SQLSTATE to fit the errors, please let me know. Otherwise, the d1772_v1.patch should be all it takes to resolve this issue.

        Note: Since we don't currently have any tests for cases where the classpath is missing the required Xalan/JAXP classes, there were no test/master files to update. The need to add tests for such scenarios is filed as part of DERBY-1758.

        Review/feedback/commit would be much appreciated.

        Show
        A B added a comment - Attaching the simplest patch possible for this issue--just changes SQLSTATE '42Z78' to a Derby-specific SQLSTATE, 'XML00'. I also moved SQLSTATE '42Z7Z' to 'XML01' since I believe it falls into the same category of "Derby-specific errors that are not covered by the SQLStandard." I read through the SQL standard definitions for SQLSTATES and none of them jumped out at me as being more appropriate than '42', so I just created a new set of SQLSTATEs, "XMLxx", for this particular issue. As I said, this was just the easiest way to go; if anyone can suggest a better SQLSTATE to fit the errors, please let me know. Otherwise, the d1772_v1.patch should be all it takes to resolve this issue. Note: Since we don't currently have any tests for cases where the classpath is missing the required Xalan/JAXP classes, there were no test/master files to update. The need to add tests for such scenarios is filed as part of DERBY-1758 . Review/feedback/commit would be much appreciated.
        Hide
        Daniel John Debrunner added a comment -

        Yes it's an error at compile time, but I was wrong on '42' meaning compile time, it's more specific than that.

        '42' from the SQL standard is: syntax error or access rule violation

        There is no syntax error in the query I'm submitting, so the exception should not be of type java.sql.SQLSyntaxErrorException which is driven by the 42 SQL state.

        Show
        Daniel John Debrunner added a comment - Yes it's an error at compile time, but I was wrong on '42' meaning compile time, it's more specific than that. '42' from the SQL standard is: syntax error or access rule violation There is no syntax error in the query I'm submitting, so the exception should not be of type java.sql.SQLSyntaxErrorException which is driven by the 42 SQL state.
        Hide
        A B added a comment -

        > This is a run-time error but it has the SQL state '42' for compile error,

        I guess that depends on what you mean by "run-time" error. In order to compile the query expression the Xalan classes have to be present. Derby checks to see if they are present when it first encounters the XML operator-i.e. at compile time-and then when the syntax of the SQL/XML operator has been successfully parsed, the XML query expression is itself compiled. All of this occurs as part of Derby compilation, hence the error code "42".

        But if that's too much of a technicality, I won't complain if the error message is changed...

        Show
        A B added a comment - > This is a run-time error but it has the SQL state '42' for compile error, I guess that depends on what you mean by "run-time" error. In order to compile the query expression the Xalan classes have to be present. Derby checks to see if they are present when it first encounters the XML operator- i.e. at compile time -and then when the syntax of the SQL/XML operator has been successfully parsed, the XML query expression is itself compiled. All of this occurs as part of Derby compilation, hence the error code "42". But if that's too much of a technicality, I won't complain if the error message is changed...

          People

          • Assignee:
            A B
            Reporter:
            Daniel John Debrunner
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development