启动glassfish时,发生如下异常:
xxx@xxx:/opt$ asadmin start-domain domain1
Jan 9, 2008 2:49:18 PM com.sun.enterprise.util.ASenvPropertyReader setSystemProperties
SEVERE: property_reader.unknownHost
java.net.UnknownHostException: xxx: xxx
at java.net.InetAddress.getLocalHost(InetAddress.java:1353)
at com.sun.enterprise.util.net.NetUtils.getCanonicalHostName(NetUtils.java:102)
at com.sun.enterprise.util.ASenvPropertyReader.setSystemProperties(ASenvPropertyReader.java:201)
at com.sun.enterprise.cli.commands.S1ASCommand.<init>(S1ASCommand.java:164)
at com.sun.enterprise.cli.commands.BaseLifeCycleCommand.<init>(BaseLifeCycleCommand.java:101)
at com.sun.enterprise.cli.commands.StartDomainCommand.<init>(StartDomainCommand.java:78)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at java.lang.Class.newInstance0(Class.java:355)
at java.lang.Class.newInstance(Class.java:308)
at com.sun.enterprise.cli.framework.CommandFactory.createCommand(CommandFactory.java:91)
at com.sun.enterprise.cli.framework.CLIMain.invokeCommand(CLIMain.java:160)
at com.sun.enterprise.cli.framework.CLIMain.main(CLIMain.java:79)
Starting Domain domain1, please wait.
Log redirected to /opt/glassfish/domains/domain1/logs/server.log.
Redirecting output to /opt/glassfish/domains/domain1/logs/server.log
Domain domain1 is ready to receive client requests. Additional services are being started in background.
java.net.UnknownHostException: hongzeguo: hongzeguo
CLI156 Could not start the domain domain1.
Solution:
xxx@xxx:/opt$ nslookup xxx
Server: 202.106.46.151
Address: 202.106.46.151#53
** server can't find xxx: NXDOMAIN
Check your /etc/hosts file. Does it have an entry with actual name and ip address of your box?
For example: append follows to /etc/hosts
127.0.0.1 xxx