Glassfish - 无法更新 http 端口。服务器关闭

Glassfish - Unable to update http port. Server shut down


我在尝试启动 Glassfish 4 时遇到问题。
我只搜索了这个错误,但没有找到类似的案例。

这是错误日志:

Unable to update http port. Server shut down.
org.eclipse.core.runtime.CoreException:
Could not save to L/Servers/GlassFish 4 at localhost [myDomain].server.

但是即使我遇到了这个错误,在 Eclipse 中,Glassfish 服务器的状态据说是[已启动,重新发布],我可以访问 Glassfish 管理控制台。

知道那里发生了什么吗?

感谢您的考虑。

您使用的是 8080 端口吗?

确保没有其他进程在监听,如果是 - 杀死它们。

netstat -a -n -o | find "8080"

这是一个老问题,但问题仍然发生在 Eclipse 2019-09 上,所以这是我发现的问题和解决方法。

这是由于点击服务器属性上的 Switch Location 按钮造成的

这将在 <workspace>/.metadata/.plugins/org.eclipse.wst.server.core/servers.xml

上删除此元素
<server auto-publish-setting="1" 
  glassfish.adminserverportnumber="4948" 
  glassfish.debugport="4909"
  glassfish.serverportnumber="4980" 
  glassfish.domainpath="/home/luis.munoz/projects/bin/glassfish3/glassfish/domains/domain-test/domain-test-1" 
  hostname="localhost"
  id="GlassFish 3.1 [domain-test-1]" 
  name="GlassFish 3.1 [domain-test-1]" 
  runtime-id="GlassFish 3.1" 
  server-type="glassfish.server" 
  server-type-id="glassfish.server"
  start-timeout="240" stop-timeout="240" timestamp="0" />

runtime-id 必须与 .plugins/org.eclipse.core.runtime/.settings/org.eclipse.wst.server.core.prefs

中的匹配

解决方法

  • 关闭 Eclipse,因为 servers.xml 已缓存。
  • 将元素重新添加到 servers.xml 以修复错误。根据需要更改详细信息。
  • 启动 Eclipse

服务器属性将再次显示 Location: [workspace metadata],启动 Glassfish 时将不会出现错误消息。