linux - Glassfish - bin/asadmin create-network-listener 失败

标签 linux ubuntu glassfish

我有一个非常奇怪的问题,似乎在互联网上的任何地方都不存在...我正在按照指南安装应用程序,我需要“为 AJP 连接创建一个新的 HTTP 监听器”。我需要使用命令行而不是进入管理控制台,这样这就可以自动化...

这是我尝试运行的命令:

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.

最佳答案

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

关于linux - Glassfish - bin/asadmin create-network-listener 失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43387431/

相关文章:

linux - 如何使用系统调用 "execvp"为另一个程序运行命令

ubuntu - 如何将Java Hotspot Server VM设置为客户端模式?

ubuntu - 查找同一字符串多次出现的情况

python-2.7 - 无法安装 Tensorflow(内存错误)

java - 当(非 Web、非 JSF)事件调用时,需要更新浏览器上的数据

glassfish - Vaadin "Cookies Disabled"Chrome 中的消息

linux - rsync从mac到linux : colon replacement

linux - 为守护进程/根进程设置环境变量

python - Cron 作业语法

mysql - Glassfish 4 身份验证(JDBCRealm 和 JPA 2)适用于 Dery,但不适用于 MySQL