You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Kristian Waagan (JIRA)" <ji...@apache.org> on 2012/08/21 12:53:38 UTC

[jira] [Updated] (DERBY-5908) Network server fails to start when JARs are located on a Windows share / network drive

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

Kristian Waagan updated DERBY-5908:
-----------------------------------

    Attachment: derby-5908-2a-network_server_url_handling.diff
                derby-5908-1a-network_server_url_handling.diff

Attaching patch 1a which changes the following:
 a) only report success if the new security manager was actually installed (I have no indication the security manager ever wasn't installed, this is a precation).
 b) changed URL handling to check both ProtectionDomain.getCodeSource() and CodeSource.getLocation() for null.
 c) added conversion step from URL to URI.
    This is known to fail in some cases, but I don't think it can happen when the VM is generating the URL in the first place (through CodeSource.getLocation()).
 d) Modify the URL/URI if it represents a Windows share.

I've also attached patch 2a, which does the same things but avoids using URI. It simplifies the error handling and is smaller. It uses regexp (String.replaceFirst), which should be fine since this won't run on J2ME anyway. It can also be done without regexp.

Unless someone thinks patch 1a has advantages over patch 2a, I plan to commit the latter. The one advantage I can imagine is if URL.toURI() is actually capable of correcting an invalid URL.
Also note that URL.getHost doesn't seem to work on a URL for "\\myshare\dir\file.ext", whereas URI.getHost does (after doing url.toURI()).

Patch ready for review.
                
> Network server fails to start when JARs are located on a Windows share / network drive
> --------------------------------------------------------------------------------------
>
>                 Key: DERBY-5908
>                 URL: https://issues.apache.org/jira/browse/DERBY-5908
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Server
>         Environment: Windows
>            Reporter: Kristian Waagan
>            Assignee: Kristian Waagan
>            Priority: Minor
>         Attachments: derby-5908-1a-network_server_url_handling.diff, derby-5908-2a-network_server_url_handling.diff
>
>
> As reported by Knut Anders on DERBY-5889:
> ---
> But I'm wondering if this might be a product issue and not a test issue. For example, when I try to start the network server on Windows using a derbynet.jar located on a network drive, it refuses to start unless I specify -noSecurityManager: 
> C:\cygwin\home\lroot\test> java -jar \\yme\cluwin\usr\local\share\java\derby\lib\10.9.1.0\derbynet.jar start 
> Tue Aug 14 22:23:33 CEST 2012 : Security manager installed using the Basic server security policy. 
> Startup failed due to missing functionality for org.apache.derby.iapi.services.stream.InfoStreams. Please ensure your classpath includes the correct Derby software. 
> ERROR XBM02: Startup failed due to missing functionality for org.apache.derby.iapi.services.stream.InfoStreams. Please ensure your classpath includes the correct Derby software. 
> at org.apache.derby.iapi.error.StandardException.newException(Unknown Source) 
> at org.apache.derby.iapi.services.monitor.Monitor.missingImplementation(Unknown Source) 
> at org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown Source) 
> at org.apache.derby.impl.services.monitor.BaseMonitor.startModule(Unknown Source) 
> at org.apache.derby.iapi.services.monitor.Monitor.startSystemModule(Unknown Source) 
> at org.apache.derby.impl.services.monitor.BaseMonitor.runWithState(Unknown Source) 
> at org.apache.derby.impl.services.monitor.FileMonitor.<init>(Unknown Source) 
> at org.apache.derby.iapi.services.monitor.Monitor.startMonitor(Unknown Source) 
> at org.apache.derby.iapi.jdbc.JDBCBoot.boot(Unknown Source) 
> at org.apache.derby.jdbc.EmbeddedDriver.boot(Unknown Source) 
> at org.apache.derby.jdbc.EmbeddedDriver.<clinit>(Unknown Source) 
> at java.lang.Class.forName0(Native Method) 
> at java.lang.Class.forName(Unknown Source) 
> at org.apache.derby.impl.drda.NetworkServerControlImpl.startNetworkServer(Unknown Source) 
> at org.apache.derby.impl.drda.NetworkServerControlImpl.blockingStart(Unknown Source) 
> at org.apache.derby.impl.drda.NetworkServerControlImpl.executeWork(Unknown Source) 
> at org.apache.derby.drda.NetworkServerControl.main(Unknown Source) 
> ---
> The workaround is to use "-noSecurityManager", but this is not recommended due to the security implications. A better option is to move the Derby installation off the network drive / share if possible and run the Derby server with the security manager.

--
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