Glassfish - bin/asadmin 创建网络侦听器失败

Glassfish - bin/asadmin create-network-listener is failing

我有一个非常奇怪的问题,似乎在 Internet 上的任何地方都不存在...我正在按照指南安装应用程序,我需要 "Create a new HTTP listeners for AJP connections"。我需要使用命令行而不是进入管理控制台,所以这可以自动化...

这是我尝试执行的命令 运行:

vagrant@ubuntu-1404:/home/glassfish$ sudo /home/glassfish/bin/asadmin create-network-listener –-address 127.0.0.1 --protocol http-listener-1 --listenerport 8009 --jkenabled true http-listener-ajp1

然后它要求输入以下内容

Enter the value for the listenerport option> 8009
Enter the value for the protocol option>  http-listener-1

然后打印出如下错误:

Command create-network-listener only accepts one operand
Usage: asadmin [asadmin-utility-options] create-network-listener
        [--address <address>] --listenerport <listenerport>
        [--threadpool <threadpool(default:http-thread-pool)>]
        --protocol <protocol> [--transport <transport(default:tcp)>]
        [--enabled[=<enabled(default:true)>]]
        [--jkenabled[=<jkenabled(default:false)>]]
        [--target <target(default:server)>] [-?|--help[=<help(default:false)>]]
        name
Command create-network-listener failed.

所以我再次尝试,使用以下命令(未指定任何选项):

vagrant@ubuntu-1404:/home/glassfish$ sudo /home/glassfish/bin/asadmin create-network-listener http-listener-ajp1
Enter the value for the listenerport option> 8009
Enter the value for the protocol option>  http-listener-1

并收到此错误:

remote failure: The specified protocol  http-listener-1 is not yet configured
Command create-network-listener failed.

原来我从指南中复制的文本有问题。破折号不是普通的破折号,它们是特殊字符“–”(看起来与正常的减号相同终端!)并将选项解释为常规文本,因此看起来每个选项实际上都是一个运算符。