[jboss-jira] [JBoss JIRA] (AS7-5527) add-user utility reports "No java.io.Console available to interact with user." when used silently with su and piped to a file.

Tom Jenkinson (JIRA) jira-events at lists.jboss.org
Mon Sep 10 13:27:32 EDT 2012


Tom Jenkinson created AS7-5527:
----------------------------------

             Summary: add-user utility reports "No java.io.Console available to interact with user." when used silently with su and piped to a file.
                 Key: AS7-5527
                 URL: https://issues.jboss.org/browse/AS7-5527
             Project: Application Server 7
          Issue Type: Bug
    Affects Versions: 7.2.0.Alpha1
            Reporter: Tom Jenkinson


./add-user.sh from a script does not work anymore. In previous versions it worked. It has to do with the "theConsole" object being null.

In the same breadth, the --silent=true option in add-user.sh does not work anymore. Again has to do with the need for "theConsole" object being null.

The --silent=true option was added because in some environments, System.console() returns null[for example when the Izpack installer calls that script] and the add-user.sh script breaks because of its dependence on System.console() object to print stuff.

This is using a build (jboss-as-7.2.0.Alpha1-SNAPSHOT) of master from today:

[tom at tomsfc16 bin]$ sudo ./add-user.sh --silent=true foo bar > /tmp/capture.log 2>&1
[tom at tomsfc16 bin]$ cat /tmp/capture.log
Exception in thread "main" java.lang.IllegalStateException: JBAS015232: No java.io.Console available to interact with user.
at org.jboss.as.domain.management.security.AddPropertiesUser.<init>(AddPropertiesUser.java:97)
at org.jboss.as.domain.management.security.AddPropertiesUser.main(AddPropertiesUser.java:193)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.jboss.modules.Module.run(Module.java:270)
at org.jboss.modules.Main.main(Main.java:294)


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the jboss-jira mailing list