You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by "DiskCrasher (via GitHub)" <gi...@apache.org> on 2023/03/18 02:44:27 UTC

[GitHub] [netbeans] DiskCrasher opened a new issue, #5676: Java DB drivers are not referencing correct Derby classes

DiskCrasher opened a new issue, #5676:
URL: https://github.com/apache/netbeans/issues/5676

   ### Apache NetBeans version
   
   Apache NetBeans 17
   
   ### What happened
   
   The default Java DB drivers shown under NetBeans Services window point to incorrect/outdated Derby classes resulting in ClassNotFound exceptions when attempting to use them. The correct classes are:
   
   `org.apache.derby.jdbc.EmbeddedDriver` - for Java DB (Embedded) located in derbytools.jar
   `org.apache.derby.client.ClientAutoloadedDriver` - for Java DB (Network) located in derbyclient.jar
   
   Additionally, even after the drivers are updated to point to these new classes, attempting to create a new database results in a ClassNotFound exception for `org.apache.derby.jdbc.ClientDriver`. It doesn't appear to be using the modified driver settings. Even the "sample" database throws a "The Java DB (Network) driver was not found" error upon connect which doesn't make sense since that driver exists.
   
   ### How to reproduce
   
   Install the default Derby DB in NetBeans 17 and attempt to use the provided Java DB drivers or connect to the "sample" database.
   
   ### Did this work correctly in an earlier version?
   
   No / Don't know
   
   ### Operating System
   
   Windows 11
   
   ### JDK
   
   Microsoft build of OpenJDK with Hotspot 17.0.6+10 (x64)
   
   ### Apache NetBeans packaging
   
   Apache NetBeans provided installer
   
   ### Anything else
   
   _No response_
   
   ### Are you willing to submit a pull request?
   
   Yes


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] OndroMih commented on issue #5676: Java DB drivers are not referencing correct Derby classes

Posted by "OndroMih (via GitHub)" <gi...@apache.org>.
OndroMih commented on issue #5676:
URL: https://github.com/apache/netbeans/issues/5676#issuecomment-1568935100

   It's not enough to replace derbyclient.jar with derbytools.jar. Both of them are required. So you need to add derbytools.jar but also keep the derbyclient.jar. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] DiskCrasher commented on issue #5676: Java DB drivers are not referencing correct Derby classes

Posted by "DiskCrasher (via GitHub)" <gi...@apache.org>.
DiskCrasher commented on issue #5676:
URL: https://github.com/apache/netbeans/issues/5676#issuecomment-1567705930

   I took a quick look at the code and changed both `DRIVER_PATH_NET` and `DRIVER_PATH_EMBEDDED` to point to `derbytools.jar`. I also modified line 548 to reflect the same. This did not resolve the problem as I'm now getting an "unable to find suitable driver" error on connection attempt for `org.apache.derby.jdbc.ClientDriver`. In doing some searching I found other classes that reference the old jar files so they may need to change as well?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] OndroMih commented on issue #5676: Java DB drivers are not referencing correct Derby classes

Posted by "OndroMih (via GitHub)" <gi...@apache.org>.
OndroMih commented on issue #5676:
URL: https://github.com/apache/netbeans/issues/5676#issuecomment-1566121251

   It looks like that the driver classes were moved to a new JAR `lib/derbytools.jar`. This JAR needs to be added to both Java DB Network and Embedded configurations. I think they need to be added in these 2 places:
   
   * https://github.com/apache/netbeans/blob/711207c11ba278c94b05d931ebd5fdc3a4b55d9f/ide/derby/src/org/netbeans/modules/derby/DerbyOptions.java#L253 - to register the drivers with this additional JAR
   * https://github.com/apache/netbeans/blob/711207c11ba278c94b05d931ebd5fdc3a4b55d9f/ide/derby/src/org/netbeans/modules/derby/DerbyDatabasesImpl.java#L545 - to add this additional JAR to the DbURLClassLoader to load the driver class. This is used during creation of a new DB
   
   I'm willing to submit a pull request when I have some time, but I won't be able to get to this in the following weeks. @DiskCrasher , if you'd like to submit a PR, go for it. I hope that with my advice, it should be pretty straightforward to fix this. 
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] DiskCrasher commented on issue #5676: Java DB drivers are not referencing correct Derby classes

Posted by "DiskCrasher (via GitHub)" <gi...@apache.org>.
DiskCrasher commented on issue #5676:
URL: https://github.com/apache/netbeans/issues/5676#issuecomment-1569440110

   I gave it another shot by adding derbytools.jar to both methods but still no success. When I look under Database/Drivers/Java DB and hit Customize it's not showing derbytools.jar listed under Driver Files. Manually adding it seems to work. I'm not familiar with this code (or Derby for that matter) so I'm probably missing something.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists