Eclipse 和 GlassFish:远程部署和调试
我目前正在使用 Eclipse 开发一个相当简单的 Java EE 动态 Web 应用程序。我刚刚使用 Eclipse 将 Web 应用程序部署到在我的开发计算机上本地运行的 GlassFish 3.1 服务器,以进行开发和调试。
到目前为止,一切都很好。但现在,我正在考虑将应用程序部署到远程 GF 服务器以进行进一步测试。
在 Eclipse 中,我打开“服务器”选项卡并选择“新建 -> 服务器”上下文菜单。我输入运行 GlassFish 的远程服务器的 IP 地址,但“新服务器”对话框不允许我继续。相反,它给了我错误消息:
远程服务器不安全:它 无法远程使用...
一些初步研究表明 Eclipse 目前不支持远程部署/调试。这就是 Eclipse 试图通过这个奇怪的错误消息告诉我的吗?当然“不支持远程部署/调试”会更贴切。我在这里忽略了一些基本的东西吗?
I am currently using Eclipse to develop a fairly straight-forward Java EE dynamic web application. I have just been using Eclipse to deploy the web app to a GlassFish 3.1 server locally running on my dev machine for development and debugging purposes.
So far, so good. But now, I am looking into deploying the app to a remote GF server for further testing.
In Eclipse, I open the "Servers" tab and select the "New->Server" context menu. I enter the IP address of the remote server running GlassFish, but the "New Server" dialog won't let me proceed. Instead, it gives me the error message:
Remote Server is not secured: It
cannot be used remotely...
Some initial research suggests that remote deployment/debugging is currently not supported by Eclipse. Is that what Eclipse is trying to tell me with this weird error message? Surely "Remote deployment/debugging not supported" would be more apt. Am I overlooking something fundamental here?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
阅读 http://blogs.oracle.com/quinn/entry/securing_adminstration_in_glassfish_server1
访问远程只有在服务器受到保护的情况下才能完成服务器...
Read http://blogs.oracle.com/quinn/entry/securing_adminstration_in_glassfish_server1
Access to remote servers can only be done if the server has been secured...
您需要确保已启用安全管理。一般来说,您应该执行以下操作:
./asadmin change-admin-password
命令为“admin”用户设置密码。默认情况下没有(因此,当它要求您当前的管理员密码时,只需按 Enter 键,假设您从未设置过)./asadmin start-domain
使用>./asadmin --host localhost --port 4848 enable-secure-admin
将启用远程管理访问(您想要的)并告诉 Glassfish 在默认管理端口 4848 上在本地主机上启动,./asadmin restart-domain
重新启动并应用这些更改。您现在应该能够访问远程服务器并通过 Eclipse 安装对其进行管理。这适用于 Eclipse Luna 和 Glassfish4 开源版本。另请注意,您需要在本地开发计算机上安装 glassfish,并在 Eclipse 向导中设置服务器时询问 Glassfish 安装路径时指出这一点...尽管您正在连接到远程计算机玻璃鱼实例。 (有关更多详细信息/屏幕截图,请参阅我的 SO 帖子 )。
我添加此内容是因为当前接受的答案仅指向一个通常在这里不受欢迎的链接,因为链接有意外失效的倾向。
You want to make sure you have enabled secure administration. Generally you should do the following:
./asadmin change-admin-password
command to set a password on the 'admin' user. By default there is none (so when it asks for your current admin password just hit Enter assuming you've never set one)./asadmin start-domain
to startup the default 'domain1'./asadmin --host localhost --port 4848 enable-secure-admin
will enable remote administration access (which you want) and tell Glassfish to start on the localhost at the default admin port 4848./asadmin restart-domain
to restart and apply those changes.You should be able to now access the remote server and manage it via your Eclipse install. This works for Eclipse Luna and Glassfish4 open-source edition. Also note that you need to have a glassfish install on your Local development machine and point to that when it asks for the path to the Glassfish installation when setting up the server in Eclipse Wizard...despite the fact that you are connecting to a remote Glassfish instance. (See my SO post for more details/screenshots).
I am adding this because the current accepted answer only points to a link which is typically frowned upon here on SO since links have a tendency to go dead unexpectedly.