[ 
https://issues.apache.org/jira/browse/DERBY-5741?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Rick Hillegas updated DERBY-5741:
---------------------------------

    Attachment: derby-5741-01-aa-percolateDerbyErrorUp.diff

Attaching derby-5741-01-aa-percolateDerbyErrorUp.diff. This patch improves the 
error message seen in this situation. I am running full regression tests now.

It turns out that the user-supplied authentication service was throwing a more 
informative error. However, the informative part of that error was swallowed by 
EmbedConnection and the only error presented to the end-user was the triggering 
ClassNotFoundException.

I have changed the error returned by the user-supplied authentication service 
so that it survives munging by EmbedConnection.

This is what the error looks like now:

"ERROR XBM0M: Error creating an instance of a class named 'NATIVE'. This class 
name was the value of the derby.authentication.provider property and was 
expected to be the name of an application-supplied implementation of 
org.apache.derby.authentication.UserAuthenticator. The underlying problem was: 
java.lang.ClassNotFoundException: NATIVE"

Touches the following files:

--------

M       
java/engine/org/apache/derby/impl/jdbc/authentication/SpecificAuthenticationServiceImpl.java
M       java/engine/org/apache/derby/loc/messages.xml

Improved error message.

--------

M       
java/testing/org/apache/derbyTesting/functionTests/tests/lang/NativeAuthenticationServiceTest.java

Regression test for this case.

                
> Native user authentication: improve checking of syntax
> ------------------------------------------------------
>
>                 Key: DERBY-5741
>                 URL: https://issues.apache.org/jira/browse/DERBY-5741
>             Project: Derby
>          Issue Type: Improvement
>          Components: Services
>    Affects Versions: 10.9.0.0
>            Reporter: Dag H. Wanvik
>            Priority: Minor
>         Attachments: derby-5741-01-aa-percolateDerbyErrorUp.diff, repro2.sh
>
>
> Trying to set derby.authentication.provider to "NATIVE:" correctly gives an 
> error message complaining about the syntax:
> "ERROR XCY05: Invalid setting of the derby.authentication.provider property. 
> This property cannot be set to NATIVE::LOCAL unless credentials for the 
> database owner have been stored in the database using the 
> SYSCS_UTIL.SYSCS_CREATE_USER procedure."
> Trying to set it as "NATIVE" (no trailing colon) does not treat this the 
> value as a malformed NATIVE authentication specification. This leads to it 
> being interpreted as a used defined authentication class, so when I attempt 
> to connect after disconnection from the database I see:
> ERROR XJ040: Failed to start database 'cred' with class loader 
> sun.misc.Launcher$AppClassLoader@18d107f, see the next exception for details.
> ERROR XJ001: Java exception: 'NATIVE: java.lang.ClassNotFoundException'.
> Another thing is that the error message in the first place is out of date 
> now: we never shoudl be setting "NATIVE::LOCAL" explicitly, it id does once 
> the first user is created according to version 7.0 of the spec. See 
> DERBY-5742.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to