<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic System.console() sometimes returns null when using the command &amp;quot;java -cp .  com.cisco.axl.shn.AUBV&amp;quot; in Management</title>
    <link>https://community.cisco.com/t5/management/system-console-sometimes-returns-null-when-using-the-command/m-p/3484251#M1069</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I start my code with this sample : &lt;A href="https://developer.cisco.com/site/axl/learn/how-to/axl-java-sample-application.gsp" title="https://developer.cisco.com/site/axl/learn/how-to/axl-java-sample-application.gsp"&gt;https://developer.cisco.com/site/axl/learn/how-to/axl-java-sample-application.gsp&lt;/A&gt;&lt;/P&gt;&lt;P&gt;The problem I met is that, for example, when I ran the command "java -cp .&amp;nbsp; com.cisco.axl.shn.AUBV" in shell directly, everything went well, but when I put the command in a shell file, like "upgradeBEV.sh"&amp;nbsp; which is triggered by another server, &lt;CODE&gt;System.console() sometimes&lt;/CODE&gt; returns &lt;CODE&gt;null. The code about the console is :&lt;/CODE&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;SPAN style="color: #99cc00;"&gt;//verify JVM has a console&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Console cons = System.console();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(cons == null){&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&amp;nbsp; &lt;/TD&gt;&lt;TD&gt; System.err.println("The Cisco AXL Sample App requires a console.");&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&amp;nbsp; &lt;/TD&gt;&lt;TD&gt; System.exit(1);&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; } else {&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&amp;nbsp; &lt;/TD&gt;&lt;TD&gt; AUBV.informUser("%nWelcome to Alpha Daily Upgrade Tool.%n");&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sometimes more than one java are triggered, the time interval is about ten minutes, then some application could get the console while others could not. Seems AXL requires the console...&amp;nbsp; I'm using centOS 6.5 to run the script. How can I fix this problem? I'd like to run serveral scripts at the same time (or with minutes apart). Are there any ways to get multiple consoles? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Jialing&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 16 Jan 2017 08:23:44 GMT</pubDate>
    <dc:creator>jialinli</dc:creator>
    <dc:date>2017-01-16T08:23:44Z</dc:date>
    <item>
      <title>System.console() sometimes returns null when using the command "java -cp .  com.cisco.axl.shn.AUBV"</title>
      <link>https://community.cisco.com/t5/management/system-console-sometimes-returns-null-when-using-the-command/m-p/3484251#M1069</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I start my code with this sample : &lt;A href="https://developer.cisco.com/site/axl/learn/how-to/axl-java-sample-application.gsp" title="https://developer.cisco.com/site/axl/learn/how-to/axl-java-sample-application.gsp"&gt;https://developer.cisco.com/site/axl/learn/how-to/axl-java-sample-application.gsp&lt;/A&gt;&lt;/P&gt;&lt;P&gt;The problem I met is that, for example, when I ran the command "java -cp .&amp;nbsp; com.cisco.axl.shn.AUBV" in shell directly, everything went well, but when I put the command in a shell file, like "upgradeBEV.sh"&amp;nbsp; which is triggered by another server, &lt;CODE&gt;System.console() sometimes&lt;/CODE&gt; returns &lt;CODE&gt;null. The code about the console is :&lt;/CODE&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;SPAN style="color: #99cc00;"&gt;//verify JVM has a console&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Console cons = System.console();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(cons == null){&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&amp;nbsp; &lt;/TD&gt;&lt;TD&gt; System.err.println("The Cisco AXL Sample App requires a console.");&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&amp;nbsp; &lt;/TD&gt;&lt;TD&gt; System.exit(1);&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; } else {&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&amp;nbsp; &lt;/TD&gt;&lt;TD&gt; AUBV.informUser("%nWelcome to Alpha Daily Upgrade Tool.%n");&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sometimes more than one java are triggered, the time interval is about ten minutes, then some application could get the console while others could not. Seems AXL requires the console...&amp;nbsp; I'm using centOS 6.5 to run the script. How can I fix this problem? I'd like to run serveral scripts at the same time (or with minutes apart). Are there any ways to get multiple consoles? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Jialing&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Jan 2017 08:23:44 GMT</pubDate>
      <guid>https://community.cisco.com/t5/management/system-console-sometimes-returns-null-when-using-the-command/m-p/3484251#M1069</guid>
      <dc:creator>jialinli</dc:creator>
      <dc:date>2017-01-16T08:23:44Z</dc:date>
    </item>
    <item>
      <title>Re: System.console() sometimes returns null when using the command "java -cp .  com.cisco.axl.shn.AUBV"</title>
      <link>https://community.cisco.com/t5/management/system-console-sometimes-returns-null-when-using-the-command/m-p/3484252#M1070</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As the AXL service is just an HTTP web service, on its own there is no dependency on a Java console.&amp;nbsp; I suspect what you are experiencing is a limitation or issue with a Java WSDL framework you may be using, or perhaps the JVM version itself...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Jan 2017 16:53:57 GMT</pubDate>
      <guid>https://community.cisco.com/t5/management/system-console-sometimes-returns-null-when-using-the-command/m-p/3484252#M1070</guid>
      <dc:creator>dstaudt</dc:creator>
      <dc:date>2017-01-16T16:53:57Z</dc:date>
    </item>
  </channel>
</rss>

