Java Glassfish Server start-domain domain1 无法启动
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/23827820/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Glassfish Server start-domain domain1 won't start
提问by Srdan Ristic
I recently downloaded Glassfish 4.0 and I want to use it in NetBeans for making some Web Applications, but when I want to start the domain1 (asadmin> start-domain domain1) I keep getting this error:"There is a process already using the admin port 4848 -- it probably is another instance of a GlassFish server". Any clue what could be the problem?
我最近下载了 Glassfish 4.0,我想在 NetBeans 中使用它来制作一些 Web 应用程序,但是当我想启动域 1 (asadmin> start-domain domain1) 时,我不断收到此错误:“有一个进程已经在使用管理员端口 4848——它可能是 GlassFish 服务器的另一个实例”。任何线索可能是什么问题?
采纳答案by Sanjay Rabari
your system using port 4848 that is why. when glassfish starts its need three port numbers one for administrations, one for http applications other for https.
您的系统使用端口 4848 这就是原因。当 glassfish 开始时,它需要三个端口号,一个用于管理,一个用于 http 应用程序,另一个用于 https。
so in you system 4848 is already reserved by some program or server.
所以在你的系统中 4848 已经被一些程序或服务器保留了。
Or you can change default port number as per your need like below. type in command prompt.
或者您可以根据需要更改默认端口号,如下所示。键入命令提示符。
To change the HTTP port to 10080:
将 HTTP 端口更改为 10080:
asadmin set server.http-service.http-listener.http-listener-1.port=10080
asadmin set server.http-service.http-listener.http-listener-1.port=10080
To change the HTTPS port to 10443:
将 HTTPS 端口更改为 10443:
asadmin set server.http-service.http-listener.http-listener-2.port=10443
asadmin set server.http-service.http-listener.http-listener-2.port=10443
To change the administration server port to 14848:
要将管理服务器端口更改为 14848:
asadmin set server.http-service.http-listener.admin-listener.port=14848
asadmin set server.http-service.http-listener.admin-listener.port=14848
回答by ioreskovic
Do a
做一个
netstat -aon
netstat -aon
from command line and check which process is using your port. If it's not important, kill it as a quick'n'dirty solution.
从命令行并检查哪个进程正在使用您的端口。如果它不重要,请将其作为快速解决方案将其杀死。
回答by togomez
Glassfish could not resolve the host name. Diagnose the problem (on Linux) as follows:
Glassfish 无法解析主机名。诊断问题(在 Linux 上)如下:
- Open a Terminal.
- Type
hostname
. - Type:
ping $(hostname)
- 打开一个终端。
- 键入
hostname
。 - 类型:
ping $(hostname)
If the ping command fails (could not find the host), then add the host name to /etc/hosts
. This can be accomplished as follows:
如果 ping 命令失败(找不到主机),则将主机名添加到/etc/hosts
. 这可以按如下方式完成:
- Switch to root:
sudo su -
- Type:
echo "127.0.0.1 $(hostname)" >> /etc/hosts
- Kill GlassFish
- Restart GlassFish
- 切换到root:
sudo su -
- 类型:
echo "127.0.0.1 $(hostname)" >> /etc/hosts
- 杀死玻璃鱼
- 重启 GlassFish
回答by Roberto Rodriguez
1- Go to the configfolder inside your domain. (In my case: C:\Glassfish\glassfish\domains\mydomain\config\ )
1- 转到域内的config文件夹。(在我的情况下: C:\Glassfish\glassfish\domains\mydomain\config\ )
2-Open the file domain
2-打开文件域
3-Update the port number on these three lines:
4-Restart your domain:
4-重新启动您的域:
--Note For restarting the domain:
--注意重启域:
1-Open cmd console
1-打开cmd控制台
2-Navigate yo your domain
2-导航您的域
3-Execute: asadmin restart-domain mydomain
3-执行:asadmin restart-domain mydomain
--I hope it helps :-)
--我希望它有帮助:-)
回答by Saket Mehta
Try lsof -i:4848
on the terminal.
lsof -i:4848
在终端上试试。
Kill the java processes listed using the command kill -9 <PID>
.
使用命令杀死列出的 java 进程kill -9 <PID>
。
If you have a GUI task manager, say like Activity Monitor on OSX, then you can just kill the java
processes listed there.
如果你有一个 GUI 任务管理器,比如 OSX 上的活动监视器,那么你可以杀死java
那里列出的进程。
Hope this works for anyone facing this problem.
希望这适用于任何面临这个问题的人。
回答by B?a?ej Kocik
Solution can be this: in console type:
解决方案可以是这样的:在控制台类型中:
echo $HOSTNAME
then make sure the output follows 127.0.0.1 string in
然后确保输出遵循 127.0.0.1 字符串
/etc/hosts
For example:
例如:
127.0.0.1 dev.myserv.pl