简体   繁体   English

如何使用命令行从不同路径启动Glassfish域

[英]How to start glassfish domain from different path using command line

I'm trying to start my local domain from a command line, for some reason my domain was created in a different location so I tried the following command to start the domain: 我正在尝试从命令行启动本地域,由于某种原因,我的域是在其他位置创建的,因此我尝试使用以下命令来启动域:

C:\\Program Files (x86)\\glassfish4\\glassfish\\bin>asadmin start-domain C:\\Users\\Abraham\\personal_domain C:\\ Program Files(x86)\\ glassfish4 \\ glassfish \\ bin> asadmin起始域C:\\ Users \\ Abraham \\ personal_domain

but it doesn't work, I got the following error: 但它不起作用,出现以下错误:

There is no such domain directory: 没有这样的域目录:

C:\\Program Files (x86)\\glassfish4\\glassfish\\domains\\C:\\Users\\Abraham\\personal_domain Command start-domain failed. C:\\ Program Files(x86)\\ glassfish4 \\ glassfish \\ domains \\ C:\\ Users \\ Abraham \\ personal_domain命令启动域失败。

Do I have to add another attribute in the command?, What am I missing? 我是否必须在命令中添加另一个属性?,我缺少什么?

From NetBeans, it runs fine and I can access to my application but I want to be able to start it from command line 从NetBeans可以正常运行,我可以访问我的应用程序,但我希望能够从命令行启动它

Firstly, to find more information about any asadmin subcommand, you can use help to find the man page for that command in one of two ways: 首先,要查找有关任何asadmin子命令的更多信息,可以使用以下两种方法之一使用help来查找该命令的手册页:

Either: 要么:

asadmin help start-domain

or 要么

asadmin start-domain --help

Secondly, to start a domain from a different location, you need to first specify the domains directory - a folder where the actual domain folder sits, and then the domain name . 其次,要从其他位置启动域,您需要首先指定domains目录 -实际域文件夹所在的文件夹,然后是domain name This will look a lot like you've just typed out the full path to the domain directory, but do be aware that there is a space in between the end of the path and the name of the domain. 这看起来很像您刚刚输入了域目录的完整路径,但是请注意,路径末尾和域名称之间有一个空格。

eg if I wanted to start a domain called " myDomain " in a folder C:\\Users\\me\\domains , I could do this: 例如,如果我想在文件夹C:\\Users\\me\\domains启动一个名为“ myDomain ”的C:\\Users\\me\\domains ,则可以这样做:

asadmin start-domain --domaindir C:\Users\me\domains myDomain

Note the space in between domains and myDomain . 注意domainsmyDomain之间的空间。

So, in your case, you would need to use: 因此,在您的情况下,您将需要使用:

asadmin start-domain --domaindir C:\Users\Abraham personal_domain

First I would make sure that the domain personal_domain is known by the glassfish server. 首先,我将确保glassfish服务器知道该域personal_domain The following statement lists all the known domains. 以下语句列出了所有已知域。

C:\Program Files (x86)\glassfish4\glassfish\bin>asadmin list-domains

If the asadmin list-domains list personal-domain , I would try to start the domain using the domain name instead of the domain path and the --domaindir option. 如果asadmin list-domains列出personal-domain ,我将尝试使用域名而不是域路径--domaindir选项启动域。

C:\Program Files (x86)\glassfish4\glassfish\bin>asadmin start-domain personal_domain --domaindir C:\Users\me\domains

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM