You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by "viola.lu (JIRA)" <ji...@apache.org> on 2011/09/21 11:22:09 UTC
[jira] [Created] (GERONIMO-6168) Got IllegalArgumentException when
redirect undeploy output to a file on windows if server folder name is very
long
Got IllegalArgumentException when redirect undeploy output to a file on windows if server folder name is very long
------------------------------------------------------------------------------------------------------------------
Key: GERONIMO-6168
URL: https://issues.apache.org/jira/browse/GERONIMO-6168
Project: Geronimo
Issue Type: Bug
Security Level: public (Regular issues)
Components: commands
Affects Versions: 2.2, 2.1, 3.0
Reporter: viola.lu
Assignee: viola.lu
Priority: Minor
Fix For: 2.1.8, 2.2.2, 3.0
C:\Program Files\ISS\SiteProtector>"C:\Program Files\ISS\SiteProtector\JRE1.6.0_SR9\bin\java.exe" -jar "C:\Program Files\ISS\SiteProtector\JavaEE\Geronimo2.1.7\bin\deployer.jar" --offline undeploy "iss/HelpServer/1.0/war" > trunk.txt
There will be an IllegalArgumentException exception as below:
Exception in thread "main" java.lang.IllegalArgumentException: Need at least 10 spaces for printing, but indent=4 and endCol=1
at org.apache.geronimo.deployment.cli.DeployUtils.println(DeployUtils.java:116)
at org.apache.geronimo.deployment.cli.CommandStart.execute(CommandStart.java:66)
at org.apache.geronimo.deployment.cli.DeployTool.execute(DeployTool.java:171)
at org.apache.geronimo.kernel.util.MainConfigurationBootstrapper.main(MainConfigurationBootstrapper.java:45)
at org.apache.geronimo.cli.AbstractCLI.executeMain(AbstractCLI.java:67)
at org.apache.geronimo.cli.deployer.DeployerCLI.main(DeployerCLI.java:31)
----- End of batch file output --------
Error: The process returned 1.
In deploy command, we are using ConsoleReader.printString, no this kind of error.
But in undeploy command, we are using DeployUtil.println, which has some terminal width check, this will make error on windows if server folder and command is too long
int endCol = consoleReader.getTermwidth();
int start = consoleReader.getCursorBuffer().cursor;
// some terminals will give a terminal width of zero (e.g. emacs shell).
// in that case, default to a reasonable term width value.
if (endCol == 0) {
endCol = DEFAULT_WIDTH;
}
if (endCol - indent < 10) {
throw new IllegalArgumentException("Need at least 10 spaces for " +
"printing, but indent=" + indent + " and endCol=" + endCol);
}
Change DeployUtil.println method to ConsoleReader.printString
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Resolved] (GERONIMO-6168) Got IllegalArgumentException when
redirect undeploy output to a file on windows if server folder name is very
long
Posted by "viola.lu (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/GERONIMO-6168?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
viola.lu resolved GERONIMO-6168.
--------------------------------
Resolution: Fixed
> Got IllegalArgumentException when redirect undeploy output to a file on windows if server folder name is very long
> ------------------------------------------------------------------------------------------------------------------
>
> Key: GERONIMO-6168
> URL: https://issues.apache.org/jira/browse/GERONIMO-6168
> Project: Geronimo
> Issue Type: Bug
> Security Level: public(Regular issues)
> Components: commands
> Affects Versions: 2.1, 2.2, 3.0
> Reporter: viola.lu
> Assignee: viola.lu
> Priority: Minor
> Fix For: 2.1.8, 2.2.2, 3.0
>
>
> C:\Program Files\ISS\SiteProtector>"C:\Program Files\ISS\SiteProtector\JRE1.6.0_SR9\bin\java.exe" -jar "C:\Program Files\ISS\SiteProtector\JavaEE\Geronimo2.1.7\bin\deployer.jar" --offline undeploy "iss/HelpServer/1.0/war" > trunk.txt
> There will be an IllegalArgumentException exception as below:
> Exception in thread "main" java.lang.IllegalArgumentException: Need at least 10 spaces for printing, but indent=4 and endCol=1
> at org.apache.geronimo.deployment.cli.DeployUtils.println(DeployUtils.java:116)
> at org.apache.geronimo.deployment.cli.CommandStart.execute(CommandStart.java:66)
> at org.apache.geronimo.deployment.cli.DeployTool.execute(DeployTool.java:171)
> at org.apache.geronimo.kernel.util.MainConfigurationBootstrapper.main(MainConfigurationBootstrapper.java:45)
> at org.apache.geronimo.cli.AbstractCLI.executeMain(AbstractCLI.java:67)
> at org.apache.geronimo.cli.deployer.DeployerCLI.main(DeployerCLI.java:31)
> ----- End of batch file output --------
> Error: The process returned 1.
> In deploy command, we are using ConsoleReader.printString, no this kind of error.
> But in undeploy command, we are using DeployUtil.println, which has some terminal width check, this will make error on windows if server folder and command is too long
> int endCol = consoleReader.getTermwidth();
> int start = consoleReader.getCursorBuffer().cursor;
> // some terminals will give a terminal width of zero (e.g. emacs shell).
> // in that case, default to a reasonable term width value.
> if (endCol == 0) {
> endCol = DEFAULT_WIDTH;
> }
> if (endCol - indent < 10) {
> throw new IllegalArgumentException("Need at least 10 spaces for " +
> "printing, but indent=" + indent + " and endCol=" + endCol);
> }
> Change DeployUtil.println method to ConsoleReader.printString
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (GERONIMO-6168) Got IllegalArgumentException
when redirect undeploy output to a file on windows if server folder name is
very long
Posted by "viola.lu (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/GERONIMO-6168?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13109367#comment-13109367 ]
viola.lu commented on GERONIMO-6168:
------------------------------------
http://apache-geronimo.328035.n3.nabble.com/Error-on-calling-undeploy-command-using-java-lang-Process-td2936150.html
> Got IllegalArgumentException when redirect undeploy output to a file on windows if server folder name is very long
> ------------------------------------------------------------------------------------------------------------------
>
> Key: GERONIMO-6168
> URL: https://issues.apache.org/jira/browse/GERONIMO-6168
> Project: Geronimo
> Issue Type: Bug
> Security Level: public(Regular issues)
> Components: commands
> Affects Versions: 2.1, 2.2, 3.0
> Reporter: viola.lu
> Assignee: viola.lu
> Priority: Minor
> Fix For: 2.1.8, 2.2.2, 3.0
>
>
> C:\Program Files\ISS\SiteProtector>"C:\Program Files\ISS\SiteProtector\JRE1.6.0_SR9\bin\java.exe" -jar "C:\Program Files\ISS\SiteProtector\JavaEE\Geronimo2.1.7\bin\deployer.jar" --offline undeploy "iss/HelpServer/1.0/war" > trunk.txt
> There will be an IllegalArgumentException exception as below:
> Exception in thread "main" java.lang.IllegalArgumentException: Need at least 10 spaces for printing, but indent=4 and endCol=1
> at org.apache.geronimo.deployment.cli.DeployUtils.println(DeployUtils.java:116)
> at org.apache.geronimo.deployment.cli.CommandStart.execute(CommandStart.java:66)
> at org.apache.geronimo.deployment.cli.DeployTool.execute(DeployTool.java:171)
> at org.apache.geronimo.kernel.util.MainConfigurationBootstrapper.main(MainConfigurationBootstrapper.java:45)
> at org.apache.geronimo.cli.AbstractCLI.executeMain(AbstractCLI.java:67)
> at org.apache.geronimo.cli.deployer.DeployerCLI.main(DeployerCLI.java:31)
> ----- End of batch file output --------
> Error: The process returned 1.
> In deploy command, we are using ConsoleReader.printString, no this kind of error.
> But in undeploy command, we are using DeployUtil.println, which has some terminal width check, this will make error on windows if server folder and command is too long
> int endCol = consoleReader.getTermwidth();
> int start = consoleReader.getCursorBuffer().cursor;
> // some terminals will give a terminal width of zero (e.g. emacs shell).
> // in that case, default to a reasonable term width value.
> if (endCol == 0) {
> endCol = DEFAULT_WIDTH;
> }
> if (endCol - indent < 10) {
> throw new IllegalArgumentException("Need at least 10 spaces for " +
> "printing, but indent=" + indent + " and endCol=" + endCol);
> }
> Change DeployUtil.println method to ConsoleReader.printString
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira