即使端口未被占用也无法启动 Glassfish 3.1
我在新设置的 Debian“Squeeze”服务器上启动 Glassfish 3.1
时遇到问题。这是一个已设置的测试服务器,并且 Glassfish
安装已从工作服务器复制到另一台服务器。
我尝试运行:
# ./asadmin start-domain
There is a process already using the admin port 4848 -- it probably is another instance of a GlassFish server.
Command start-domain failed.
我还尝试重新启动域,因为我认为它可能正在运行:
# ./asadmin restart-domain
Server is not running, will attempt to start it...
There is a process already using the admin port 4848 -- it probably is another instance of a GlassFish server.
Command restart-domain failed.
此时我确认 Glassfish
没有运行,所以我检查端口 4848 是否被占用:
# netstat -aon | grep 4848
它没有返回任何内容。
我怀疑 Glassfish
是在 Glassfish
仍在运行时从源服务器复制的。也许还有某种 pid 文件或锁定文件也被复制了。
关于如何启动 Glassfish
有什么建议吗?
编辑
以下是执行 asadmin start-domain
命令后来自 domain1
的 server.log
文件:
Sep 12, 2011 11:18:02 AM com.sun.enterprise.admin.launcher.GFLauncherLogger info
INFO: JVM invocation command line:
/opt/glassfish3/jdk/bin/java
-cp
/opt/glassfish3/glassfish/modules/glassfish.jar
-XX:+UnlockDiagnosticVMOptions
-XX:MaxPermSize=192m
-XX:NewRatio=2
-Xmx512m
-client
-javaagent:/opt/glassfish3/glassfish/lib/monitor/flashlight-agent.jar
-Dosgi.shell.telnet.maxconn=1
-Djdbc.drivers=org.apache.derby.jdbc.ClientDriver
-Dfelix.fileinstall.disableConfigSave=false
-Dfelix.fileinstall.dir=/opt/glassfish3/glassfish/modules/autostart/
-Djavax.net.ssl.keyStore=/opt/glassfish3/glassfish/domains/domain1/config/keystore.jks
-Dosgi.shell.telnet.port=6666
-Djava.security.policy=/opt/glassfish3/glassfish/domains/domain1/config/server.policy
-Dfelix.fileinstall.log.level=2
-Dfelix.fileinstall.poll=5000
-Dcom.sun.aas.instanceRoot=/opt/glassfish3/glassfish/domains/domain1
-Dosgi.shell.telnet.ip=127.0.0.1
-Dcom.sun.enterprise.config.config_environment_factory_class=com.sun.enterprise.config.serverbeans.AppserverConfigEnvironmentFactory
-Djava.endorsed.dirs=/opt/glassfish3/glassfish/modules/endorsed:/opt/glassfish3/glassfish/lib/endorsed
-Dcom.sun.aas.installRoot=/opt/glassfish3/glassfish
-Djava.ext.dirs=/opt/glassfish3/jdk/lib/ext:/opt/glassfish3/jdk/jre/lib/ext:/opt/glassfish3/glassfish/domains/domain1/lib/ext
-Dfelix.fileinstall.bundles.startTransient=true
-Dfelix.fileinstall.bundles.new.start=true
-Djavax.net.ssl.trustStore=/opt/glassfish3/glassfish/domains/domain1/config/cacerts.jks
-Dorg.glassfish.additionalOSGiBundlesToStart=org.apache.felix.shell,org.apache.felix.gogo.runtime,org.apache.felix.gogo.shell,org.apache.felix.gogo.command
-Dcom.sun.enterprise.security.httpsOutboundKeyAlias=s1as
-DANTLR_USE_DIRECT_CLASS_LOADING=true
-Djava.security.auth.login.config=/opt/glassfish3/glassfish/domains/domain1/config/login.conf
-Dgosh.args=--nointeractive
-Djava.library.path=/opt/glassfish3/glassfish/lib:/opt/glassfish3/jdk/jre/lib/amd64/server:/opt/glassfish3/jdk/jre/lib/amd64:/opt/glassfish3/jdk/lib/amd64:/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
com.sun.enterprise.glassfish.bootstrap.ASMain
-domainname
domain1
-asadmin-args
--host,,,localhost,,,--port,,,4848,,,--secure=false,,,--terse=false,,,--echo=false,,,--interactive=true,,,start-domain,,,--verbose=false,,,--debug=false,,,--domaindir,,,/opt/glassfish3/glassfish/domains,,,domain1
-instancename
server
-verbose
false
-debug
false
-asadmin-classpath
/opt/glassfish3/glassfish/modules/admin-cli.jar
-asadmin-classname
com.sun.enterprise.admin.cli.AsadminMain
-upgrade
false
-type
DAS
-domaindir
/opt/glassfish3/glassfish/domains/domain1
-read-stdin
true
I'm having trouble starting Glassfish 3.1
on a newly setup Debian "Squeeze" server. This is a testing server that has been setup and the Glassfish
installation was copied from a working server to this other server.
I tried running:
# ./asadmin start-domain
There is a process already using the admin port 4848 -- it probably is another instance of a GlassFish server.
Command start-domain failed.
I also tried restarting the domain because I thought maybe it was running:
# ./asadmin restart-domain
Server is not running, will attempt to start it...
There is a process already using the admin port 4848 -- it probably is another instance of a GlassFish server.
Command restart-domain failed.
At this point I confirmed that Glassfish
was not running so I checked to see if port 4848 was occupied:
# netstat -aon | grep 4848
which returned nothing.
I have suspicion that Glassfish
was copied from the source server while Glassfish
was still running. Maybe there is some sort of pid file or lock file that was copied over as well.
Any suggestions on how to get Glassfish
to start?
Edit
Here's the server.log
file from domain1
after executing the asadmin start-domain
command:
Sep 12, 2011 11:18:02 AM com.sun.enterprise.admin.launcher.GFLauncherLogger info
INFO: JVM invocation command line:
/opt/glassfish3/jdk/bin/java
-cp
/opt/glassfish3/glassfish/modules/glassfish.jar
-XX:+UnlockDiagnosticVMOptions
-XX:MaxPermSize=192m
-XX:NewRatio=2
-Xmx512m
-client
-javaagent:/opt/glassfish3/glassfish/lib/monitor/flashlight-agent.jar
-Dosgi.shell.telnet.maxconn=1
-Djdbc.drivers=org.apache.derby.jdbc.ClientDriver
-Dfelix.fileinstall.disableConfigSave=false
-Dfelix.fileinstall.dir=/opt/glassfish3/glassfish/modules/autostart/
-Djavax.net.ssl.keyStore=/opt/glassfish3/glassfish/domains/domain1/config/keystore.jks
-Dosgi.shell.telnet.port=6666
-Djava.security.policy=/opt/glassfish3/glassfish/domains/domain1/config/server.policy
-Dfelix.fileinstall.log.level=2
-Dfelix.fileinstall.poll=5000
-Dcom.sun.aas.instanceRoot=/opt/glassfish3/glassfish/domains/domain1
-Dosgi.shell.telnet.ip=127.0.0.1
-Dcom.sun.enterprise.config.config_environment_factory_class=com.sun.enterprise.config.serverbeans.AppserverConfigEnvironmentFactory
-Djava.endorsed.dirs=/opt/glassfish3/glassfish/modules/endorsed:/opt/glassfish3/glassfish/lib/endorsed
-Dcom.sun.aas.installRoot=/opt/glassfish3/glassfish
-Djava.ext.dirs=/opt/glassfish3/jdk/lib/ext:/opt/glassfish3/jdk/jre/lib/ext:/opt/glassfish3/glassfish/domains/domain1/lib/ext
-Dfelix.fileinstall.bundles.startTransient=true
-Dfelix.fileinstall.bundles.new.start=true
-Djavax.net.ssl.trustStore=/opt/glassfish3/glassfish/domains/domain1/config/cacerts.jks
-Dorg.glassfish.additionalOSGiBundlesToStart=org.apache.felix.shell,org.apache.felix.gogo.runtime,org.apache.felix.gogo.shell,org.apache.felix.gogo.command
-Dcom.sun.enterprise.security.httpsOutboundKeyAlias=s1as
-DANTLR_USE_DIRECT_CLASS_LOADING=true
-Djava.security.auth.login.config=/opt/glassfish3/glassfish/domains/domain1/config/login.conf
-Dgosh.args=--nointeractive
-Djava.library.path=/opt/glassfish3/glassfish/lib:/opt/glassfish3/jdk/jre/lib/amd64/server:/opt/glassfish3/jdk/jre/lib/amd64:/opt/glassfish3/jdk/lib/amd64:/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
com.sun.enterprise.glassfish.bootstrap.ASMain
-domainname
domain1
-asadmin-args
--host,,,localhost,,,--port,,,4848,,,--secure=false,,,--terse=false,,,--echo=false,,,--interactive=true,,,start-domain,,,--verbose=false,,,--debug=false,,,--domaindir,,,/opt/glassfish3/glassfish/domains,,,domain1
-instancename
server
-verbose
false
-debug
false
-asadmin-classpath
/opt/glassfish3/glassfish/modules/admin-cli.jar
-asadmin-classname
com.sun.enterprise.admin.cli.AsadminMain
-upgrade
false
-type
DAS
-domaindir
/opt/glassfish3/glassfish/domains/domain1
-read-stdin
true
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(10)
首先检查 $HOSTNAME 和 etc/hosts 文件配置,而不是试图用 ps aux 或 netstat -aon 来查找问题。
响应> 如果您在 127.0.0.1 之后看不到“$HOSTNAME”,则服务器(或等)
响应,然后将其添加到字符串末尾。
再次尝试执行 start-domain 命令。
First of all check the $HOSTNAME and the etc/hosts file configuration , not try to find a problem with ps aux or netstat -aon .
response > server (or etc)
in response if you cannot see "$HOSTNAME" after 127.0.0.1 then add it end of the string .
Try again to execute the start-domain command.
检查 /etc/hosts 文件当前主机名是否转换为有效的 IP 地址。
我认为有些东西配置错误或者只是 IP 不存在。
当我将其改回(在我的情况下)为 127.0.0.1 地址(当然它可以是除工作和附加 IP 地址之外的任何其他地址)时,glassfish 可以再次正确启动。
Check your /etc/hosts file if the current hostname translates to a valid IP address.
I think something is misconfigured or simple the IP do not exists.
When I changed it back (in my situation) to the 127.0.0.1 address (of course it could be any other but working and attached IP address), the glassfish could be started properly again.
可能性很小:如果 Netbeans 正在运行,请将其关闭,然后重试。
Small chance: Close Netbeans if it is running and try again.
您是否尝试过
查看其他实例是否正在运行?
Have you tried
to see if other instances are running?
文件/etc/host没有带IP的PC名的问题
在文件中添加这一行。
ip_PC 名称_PC
192.144.168.2 miserver
这有效
http:// /jvm-java.blogspot.com.es/2010/12/glassfish-v3-linux-process-already.html
the problem that the file /etc/host havent PC name with IP
add this line in the file.
ip_PC name_PC
192.144.168.2 miserver
This works
http://jvm-java.blogspot.com.es/2010/12/glassfish-v3-linux-process-already.html
-步骤1
开始玻璃鱼
-步骤2
更改主机名
结果:启动glassfish时出错
解决方案:
1 退出主机名并只保留 localhost
2 启动 glassfish
3 停止 glassfish
4 添加主机名
5 启动 glassfish
它有效!
$ cat /etc/hosts
127.0.0.1 本地主机 本地主机.本地域 本地主机4 本地主机4.本地域4
::1 本地主机 本地主机.本地域 本地主机6 本地主机6.本地域6
192.168.1.2 YOURHOSTNAME
$ glassfish4/bin/asadmin 起始域
等待domain1启动.......
成功启动域:domain1
-step 1
start glassfish
-step 2
change the hostname
result: error starting glassfish
solution:
1 quit the hostname and just leave localhost
2 start glassfish
3 stop glassfish
4 add the hostname
5 start glassfish
and it works!!!
$ cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.1.2 YOURHOSTNAME
$ glassfish4/bin/asadmin start-domain
Waiting for domain1 to start .......
Successfully started the domain : domain1
我通过将新主机名添加到 /etc/host 来解决此问题
这是我的主机文件的内容:
然后尝试再次启动您的 asadmin
I resolve this by adding new hostname to /etc/host
this is content of my host file :
and then try start again your asadmin
当我为我的linux设置主机名时,我在centOS中遇到了类似的问题。
将您的主机名设置为 localhost ,您的问题可能会得到解决。
命令:主机名 localhost 或
在基于 redHat 的 linux 中编辑 /etc/sysconfig/network 文件。
祝你好运
I encountered similar problem in centOS when i set hostname for my linux.
set your hostname to localhost , probably your problem will be solved.
command : hostname localhost or
edit /etc/sysconfig/network file in redHat based linux.
goodluck
当我遇到这个错误时,原来是因为机器没有连接到网络,所以无法绑定到
/etc/hosts
和中设置的IP地址/etc/sysconfig/network-scripts/ifcfg-eth0
(我使用的是 CentOS)。一旦我启用网络(我的是虚拟机),它就可以正常工作。因此,在我的情况下,该消息具有误导性:(据 glassfish 所知)没有任何东西在所需 IP 地址上的端口 4848 上侦听,但在尝试连接到该端口时显然出现错误,因为机器本身没有未连接到网络。
When I encountered this error, it turned out to be because the machine wasn't connected to the network and so couldn't bind to the IP address that was set in
/etc/hosts
and/etc/sysconfig/network-scripts/ifcfg-eth0
(I'm using CentOS). As soon as I enabled the network (mine is a VM) it worked fine.So the message was misleading in my case: there wasn't (as far as glassfish could tell) anything listening on port 4848 on the desired IP address, but there was evidently an error when trying to attach to that port because the machine itself wasn't connected to the network.
最近(仅适用于 Amazon Web Services-AWS),我发现将服务器启动到 VPC 需要相当多的额外配置(一旦关闭)才能开始。一个关键线索:
应该有效。如果不起作用,很可能就是这个原因。
您可以:
1) 在 EC2-classic 中启动服务器
2) 配置您的 VPC/主机,以便能够成功运行上述命令。
希望有帮助。
Recently (only applicable on Amazon Web Services-AWS), I found that launching a server into VPC requires quite a bit of extra configuration (once off) to get started. A key clue:
should work. If it doesn't work, that's likely to be the reason.
You can either:
1) launch a server into EC2-classic
2) configure your VPC / host to be able to run the command above successfully.
Hope that helps.