[ 
https://issues.apache.org/jira/browse/DERBY-6707?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14097779#comment-14097779
 ] 

Sai Zhang commented on DERBY-6707:
----------------------------------

Simply, the same problem occurs if an invalid value is specified for the 
"derby.stream.error.field" option, like:

derby.stream.error.field=hello


Here is the error message after issuing a query:

ij> CONNECT 'jdbc:derby:firstdb';
JAVA ERROR: java.lang.ExceptionInInitializerError
ij> select * from COUNTRIES;
IJ ERROR: Unable to establish connection
ij> Exception in thread "main" java.lang.NoClassDefFoundError: Could not 
initialize class org.apache.derby.jdbc.EmbeddedDriver
        at org.apache.derby.jdbc.AutoloadedDriver.getDriverModule(Unknown 
Source)
        at org.apache.derby.jdbc.AutoloadedDriver.connect(Unknown Source)
        at java.sql.DriverManager.getConnection(DriverManager.java:579)
        at java.sql.DriverManager.getConnection(DriverManager.java:243)
        at org.apache.derby.impl.tools.ij.utilMain.cleanupGo(Unknown Source)
        at org.apache.derby.impl.tools.ij.utilMain.go(Unknown Source)
        at org.apache.derby.impl.tools.ij.Main.go(Unknown Source)
        at org.apache.derby.impl.tools.ij.Main.mainCore(Unknown Source)
        at org.apache.derby.impl.tools.ij.Main.main(Unknown Source)
        at org.apache.derby.tools.ij.main(Unknown Source)
        at org.apache.derby.iapi.tools.run.main(Unknown Source)

> Inadequate error messages for configuration errors in Derby
> -----------------------------------------------------------
>
>                 Key: DERBY-6707
>                 URL: https://issues.apache.org/jira/browse/DERBY-6707
>             Project: Derby
>          Issue Type: Bug
>    Affects Versions: 10.10.2.0
>         Environment: All
>            Reporter: Sai Zhang
>              Labels: configuration, invald
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> Dear developers,
> Derby's error message for misconfiguration should be improved. Sometimes, the 
> dumped error messages is very unclear, and costs users extra time to figure 
> out a simple problem.
> Here is a reproducible example
> 1.  specify a wrong value for derby.stream.error.method option, and put the 
> following line in the derby.properties file
> derby.stream.error.method=hello   (obvious it is wrong)
> 2. 
> connect to a derby db, and issue a selection query
> 3. 
> derby simply dumped the following error message, which is hard to be 
> connected to the misconfigured option
> ij> CONNECT 'jdbc:derby:firstdb';
> JAVA ERROR: java.lang.ExceptionInInitializerError
> ij> select * from COUNTRIES;
> IJ ERROR: Unable to establish connection
> ij> Exception in thread "main" java.lang.NoClassDefFoundError: Could not 
> initialize class org.apache.derby.jdbc.EmbeddedDriver
>       at org.apache.derby.jdbc.AutoloadedDriver.getDriverModule(Unknown 
> Source)
>       at org.apache.derby.jdbc.AutoloadedDriver.connect(Unknown Source)
>       at java.sql.DriverManager.getConnection(DriverManager.java:579)
>       at java.sql.DriverManager.getConnection(DriverManager.java:243)
>       at org.apache.derby.impl.tools.ij.utilMain.cleanupGo(Unknown Source)
>       at org.apache.derby.impl.tools.ij.utilMain.go(Unknown Source)
>       at org.apache.derby.impl.tools.ij.Main.go(Unknown Source)
>       at org.apache.derby.impl.tools.ij.Main.mainCore(Unknown Source)
>       at org.apache.derby.impl.tools.ij.Main.main(Unknown Source)
> I would sugget to fix this problem by checking invalid configuration option 
> names, and improve error message (at least the error message should pinpoint 
> the likely misconfigured options).
> Please let me know your thoughts.
> Thanks
> -Sai



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to