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 "INDIKA KUMARA (JIRA)" <ji...@apache.org> on 2017/07/13 13:51:00 UTC
[jira] [Comment Edited] (DERBY-5261) NetworkServerControl prints
usage message twice on some errors
[ https://issues.apache.org/jira/browse/DERBY-5261?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16085721#comment-16085721 ]
INDIKA KUMARA edited comment on DERBY-5261 at 7/13/17 1:50 PM:
---------------------------------------------------------------
I have fixed DERBY-5261 bug.
When it is run with the command "java -jar derbynet.jar abc" it give same error twice. I searched what was the error. I was able to find it in java file "NetworkServerControlImpl.java" at lines 2476 and 2309.Same error message print in the method "private int findCommand(String [] args)"(line 2476) and calling place of it(line 2309). after I commented line 2476 and test it again with the command "java -jar derbynet.jar abc" then it print error message once only.
I attach patch file with this.
Index: drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java
===================================================================
--- drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java (revision 1800176)
+++ drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java (working copy)
@@ -2473,8 +2473,6 @@
}
// didn't find command
- consolePropertyMessage("DRDA_UnknownCommand.U",
- (String) commandArgs.firstElement());
}
} catch (Exception e) {
if (e.getMessage().equals(NetworkServerControlImpl.UNEXPECTED_ERR))
was (Author: kumara1234):
I have fixed DERBY-5261 bug.
When it is run with the command "java -jar derbynet.jar abc" it give same error twice. I searched what was the error. I was able to find it in java file "NetworkServerControlImpl.java" at lines 2476 and 2309.Same error message print in the method "private int findCommand(String [] args)"(line 2476) and calling place of it(line 2309). after I commented line 2476 and test it again with the command "java -jar derbynet.jar abc" then it print error message once only.
I attach patch file with this.
> NetworkServerControl prints usage message twice on some errors
> --------------------------------------------------------------
>
> Key: DERBY-5261
> URL: https://issues.apache.org/jira/browse/DERBY-5261
> Project: Derby
> Issue Type: Bug
> Components: Network Server
> Affects Versions: 10.8.1.2
> Reporter: Knut Anders Hatlen
> Assignee: INDIKA KUMARA
> Priority: Minor
> Labels: derby_triage10_9
>
> If you invoke NetworkServerControl with an invalid command, the usage message will be printed twice.
> $ java -jar derbynet.jar abc
> Mon Jun 06 10:14:25 CEST 2011 : Command abc is unknown.
> Usage: NetworkServerControl <commands>
> Commands:
> start [-h <host>] [-p <portnumber>] [-noSecurityManager] [-ssl <sslmode>]
> shutdown [-h <host>][-p <portnumber>] [-ssl <sslmode>] [-user <username>] [-password <password>]
> ping [-h <host>][-p <portnumber>] [-ssl <sslmode>]
> sysinfo [-h <host>][-p <portnumber>] [-ssl <sslmode>]
> runtimeinfo [-h <host>][-p <portnumber>] [-ssl <sslmode>]
> logconnections {on|off} [-h <host>][-p <portnumber>] [-ssl <sslmode>]
> maxthreads <max>[-h <host>][-p <portnumber>] [-ssl <sslmode>]
> timeslice <milliseconds>[-h <host>][-p <portnumber>] [-ssl <sslmode>]
> trace {on|off} [-s <session id>][-h <host>][-p <portnumber>] [-ssl <sslmode>]
> tracedirectory <traceDirectory>[-h <host>][-p <portnumber>] [-ssl <sslmode>]
> Mon Jun 06 10:14:25 CEST 2011 : No command given.
> Usage: NetworkServerControl <commands>
> Commands:
> start [-h <host>] [-p <portnumber>] [-noSecurityManager] [-ssl <sslmode>]
> shutdown [-h <host>][-p <portnumber>] [-ssl <sslmode>] [-user <username>] [-password <password>]
> ping [-h <host>][-p <portnumber>] [-ssl <sslmode>]
> sysinfo [-h <host>][-p <portnumber>] [-ssl <sslmode>]
> runtimeinfo [-h <host>][-p <portnumber>] [-ssl <sslmode>]
> logconnections {on|off} [-h <host>][-p <portnumber>] [-ssl <sslmode>]
> maxthreads <max>[-h <host>][-p <portnumber>] [-ssl <sslmode>]
> timeslice <milliseconds>[-h <host>][-p <portnumber>] [-ssl <sslmode>]
> trace {on|off} [-s <session id>][-h <host>][-p <portnumber>] [-ssl <sslmode>]
> tracedirectory <traceDirectory>[-h <host>][-p <portnumber>] [-ssl <sslmode>]
> Printing it once should be enough.
> The same problem is seen if you don't specify a required argument for an option. For example "java -jar derbynet start -p" (no port number).
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)