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

Kathey Marsden commented on DERBY-1272:
---------------------------------------

Hi Ramin,

Thank you for your continued work on this patch. With the patch I do not see 
the initializer error pointing my classpath to the classes directory, but I 
don't really understand how your changes sought to fix it. Could you explain.

Running lang/triggerGeneral.sql I see a JVM crash with both IBM 1.5 and Sun 1.6 
JDK's.  The problem seems to arise from the fact that sysinfo registers the JCC 
driver in the following code in
package org.apache.derby.impl.tools.sysinfo.Main.checkFile(String filename)

{
                    c = Class.forName("com.ibm.db2.jcc.DB2Driver");
                    m = c.getMethod("getJCCBuildNumber", null);
                    o = c.newInstance();
                    build = (Integer)m.invoke(o,null);
}       } catch (ClassNotFoundException cnfe) {
                    c = Class.forName("com.ibm.db2.jcc.DB2Version");
                    m = c.getMethod("getBuildNumber", null);
                    o = c.newInstance();
                    build = (Integer)m.invoke(o,null);
                } 


Then there seems to be some bug in JCC that we are getting the T2 driver for 
jdbc:default:connection.  But it seems like a bad side effect of sysinfo that 
the JCC Driver is getting loaded.  I think it would be acceptable for sysinfo 
to just use 
com.ibm.db2.jcc.DB2Version.getBuildNumber.

Here is the thread that fails.

NULL           ----------------------
3XMTHREADINFO      "main" (TID:0x41431300, sys_thread_t:0x000382D8, state:R, 
native ID:0x000012E0) prio=5
4XESTACKTRACE          at com/ibm/db2/jcc/uw/UWConnection.DBConnect(Native 
Method)
4XESTACKTRACE          at 
com/ibm/db2/jcc/uw/UWConnection.a(UWConnection.java:673)
4XESTACKTRACE          at com/ibm/db2/jcc/uw/f.b(f.java:254)
4XESTACKTRACE          at 
com/ibm/db2/jcc/uw/UWConnection.a(UWConnection.java:610)
4XESTACKTRACE          at 
com/ibm/db2/jcc/uw/UWConnection.b(UWConnection.java:463)
4XESTACKTRACE          at 
com/ibm/db2/jcc/uw/UWConnection.<init>(UWConnection.java:255)
4XESTACKTRACE          at com/ibm/db2/jcc/DB2Driver.connect(DB2Driver.java:236)
4XESTACKTRACE          at 
java/sql/DriverManager.getConnection(DriverManager.java:562)
4XESTACKTRACE          at 
java/sql/DriverManager.getConnection(DriverManager.java:208)
4XESTACKTRACE          at 
org/apache/derbyTesting/functionTests/tests/lang/userDefMethods.derby388(userDefMethods.java:89)
4XESTACKTRACE          at 
org/apache/derby/exe/ac12564092x0116xa132x1d95xffffa334cdd074.g0(Bytecode PC:36)
4XESTACKTRACE          at sun/reflect/NativeMethodAccessorImpl.invoke0(Native 
Method)
4XESTACKTRACE          at 
sun/reflect/NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64(Compiled
 Code))
4XESTACKTRACE          at 
sun/reflect/DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43(Compiled
 Code))
4XESTACKTRACE          at 
java/lang/reflect/Method.invoke(Method.java:615(Compiled Code))
4XESTACKTRACE          at 
org/apache/derby/impl/services/reflect/ReflectMethod.invoke(ReflectMethod.java:46)
4XESTACKTRACE          at 
org/apache/derby/impl/sql/execute/CallStatementResultSet.open(CallStatementResultSet.java:57)
4XESTACKTRACE          at 
org/apache/derby/impl/sql/GenericPreparedStatement.execute(GenericPreparedStatement.java:370(Compiled
 Code))
4XESTACKTRACE          at 
org/apache/derby/impl/jdbc/EmbedStatement.executeStatement(EmbedStatement.java:1228)
4XESTACKTRACE          at 
org/apache/derby/impl/jdbc/EmbedStatement.execute(EmbedStatement.java:618)
4XESTACKTRACE          at 
org/apache/derby/impl/jdbc/EmbedStatement.execute(EmbedStatement.java:550)
4XESTACKTRACE          at 
org/apache/derby/impl/tools/ij/ij.executeImmediate(ij.java:330(Compiled Code))
4XESTACKTRACE          at 
org/apache/derby/impl/tools/ij/utilMain.doCatch(utilMain.java:508)
4XESTACKTRACE          at 
org/apache/derby/impl/tools/ij/utilMain.runScriptGuts(utilMain.java:350)
4XESTACKTRACE          at 
org/apache/derby/impl/tools/ij/utilMain.go(utilMain.java:248)
4XESTACKTRACE          at org/apache/derby/impl/tools/ij/Main.go(Main.java:215)
4XESTACKTRACE          at 
org/apache/derby/impl/tools/ij/Main.mainCore(Main.java:181)
4XESTACKTRACE          at org/apache/derby/impl/tools/ij/Main.main(Main.java:73)
4XESTACKTRACE          at org/apache/derby/tools/ij.main(ij.java:59)
NULL 

There is a white space diff in AllPackages.  There is commented out code that 
should be removed.  There should be comments explaining the class 
DumpTempWriter, what bothPlaces means and the run method.


> Change sysinfo to print to error log (derby.log) on boot of derby  if 
> derby.stream.error.logSeverityLevel=0
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1272
>                 URL: https://issues.apache.org/jira/browse/DERBY-1272
>             Project: Derby
>          Issue Type: Improvement
>          Components: Tools
>    Affects Versions: 10.1.2.1, 10.1.3.1, 10.2.1.6
>            Reporter: Kathey Marsden
>            Assignee: Ramin Moazeni
>            Priority: Minor
>         Attachments: derby-1272-pre.diff, derby-1272-pre2.diff, 
> derby-1272-pre3.diff, derby-1272-v4.diff, DERBY-1272v5.diff, 
> DERBY-1272v6.diff, DERBY-1272v6.stat, DERBY-1272v8.diff
>
>
> It is often very difficult to collect correct sysinfo output from user 
> environments because  sysinfo run from the commandline does not have the same 
> classpath as the jvm that started Derby or Derby was loaded with a custom 
> classloader.
> It would be very helpful in assisting users in diagnosing their issues if 
> sysinfo dumped to the error log if  derby.stream.error.logSeverityLevel=0  or 
> even by default.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to