Eclipse 中的 GlassFish v3 启动后显示“错误的用户名或密码”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5102331/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 19:58:17  来源:igfitidea点击:

GlassFish v3 in Eclipse shows "Wrong username or password" after starting

eclipseglassfish

提问by Natasha KP

During the GlassFish installation I have chosen user name and password. These parameters are properly set on the Eclipse Server Adapter setting page. But when I start GlassFish in debug mode from Eclipse, I get "Wrong username and password".

在 GlassFish 安装期间,我选择了用户名和密码。这些参数在 Eclipse Server Adapter 设置页面上正确设置。但是当我从 Eclipse 以调试模式启动 GlassFish 时,我收到“错误的用户名和密码”。

There is nothing in the server log - in fact the server is started and works properly. The message only appears something like 95% of the time, and it is making debugging of the application problematic with the constant restarts and redeploys.

服务器日志中没有任何内容 - 实际上服务器已启动并正常工作。该消息仅在 95% 的时间内出现,并且由于不断重新启动和重新部署而使应用程序的调试出现问题。

Anybody found how to overcome this problem?

有没有人找到如何克服这个问题?

I am using Oracle GlassFish Server 3.0.1 and Eclipse Helios Eclipse Java EE IDE for Web Developers (Helios Service Release 1 Build id: 20100917-0705).

我正在为 Web 开发人员使用 Oracle GlassFish Server 3.0.1 和 Eclipse Helios Eclipse Java EE IDE(Helios Service Release 1 Build id:20100917-0705)。

回答by mgttlinger

For me the fix was to leave the "Password" field empty. I am however using different versions (but I stumbled upon this thread and maybe someone else will see this as well) of Eclipse and GlassFish(Eclipse Kepler & GlassFish 4.0).

对我来说,解决方法是将“密码”字段留空。然而,我使用的是 Eclipse 和 GlassFish(Eclipse Kepler & GlassFish 4.0)的不同版本(但我偶然发现了这个线程,也许其他人也会看到这个)。

I hope this helps anybody.

我希望这对任何人都有帮助。

EDIT putting together compatibility of this fix from the comments:

编辑从评论中汇总此修复程序的兼容性:

Kepler & 4.0Luna & 4.1Mars & 4.1

Kepler & 4.0Luna & 4.1Mars & 4.1

回答by Bart Kummel

I had this problem too. For me the solution was to disable the "Use Anonymous Connection for Admin Commands" option. To do so, follow these steps:

我也有这个问题。对我来说,解决方案是禁用“对管理命令使用匿名连接”选项。为此,请按照下列步骤操作:

  • Right click on the Glassfish entry in the Server tab and click "Open" from the context menu. (Or press F3 while the Glassfish entry is selected.)
  • Make sure the box "Use Anonymous Connection for Admin Commands" is unselected, see the screenshot.

    The red arrow points to the box that has to be checked.

  • Don't forget to save before you retry...
  • 右键单击服务器选项卡中的 Glassfish 条目,然后从上下文菜单中单击“打开”。(或在选择 Glassfish 条目时按 F3。)
  • 确保未选中“对管理命令使用匿名连接”框,请参阅屏幕截图。

    红色箭头指向必须选中的框。

  • 在重试之前不要忘记保存...

回答by Arjan

If the log refers to full host names, like:

如果日志引用完整的主机名,例如:

JMXService URL = service:jmx:rmi://my-work-pc.lan:8686/jndi/rmi://my-work-pc.lan:8686/jmxrmi

JMXService URL = service:jmx:rmi://my-work-pc.lan:8686/jndi/rmi://my-work-pc.lan:8686/jmxrmi

rather than, for example:

而不是,例如:

JMXService URL = service:jmx:rmi://localhost:8686/jndi/rmi://localhost:8686/jmxrmi

JMXService URL = service:jmx:rmi://localhost:8686/jndi/rmi://localhost:8686/jmxrmi

...then disabling the proxy settings in Eclipse (Preferences, General, Network Connections, Active Provider: Direct) might solve it.

...然后禁用 Eclipse 中的代理设置(首选项、常规、网络连接、活动提供程序:直接)可能会解决它。

For what I've read the default "Native" proxy setting yields problems as GlassFish by default binds to 0.0.0.0, which causes host name resolution rather than simply "localhost" in the RMI calls above. Given the host name it then finds, Eclipse might then feel it needs to use your proxy (if set) even for what is actually localhost.

对于我读过的内容,默认的“本机”代理设置会产生问题,因为 GlassFish 默认绑定到0.0.0.0,这会导致主机名解析,而不是上面 RMI 调用中的简单“localhost”。给定它找到的主机名,Eclipse 可能会觉得它需要使用您的代理(如果设置),即使是实际的 localhost。

回答by user1746371

My solution was just disable Anonymous Connection for Admin Commands. Auto deploy is another silly enabled default option because on every save freezes eclipse for a while, of course this does not count on small projects so you are good if you are writing only Hello world projects :)

我的解决方案只是禁用管理命令的匿名连接。自动部署是另一个愚蠢的默认选项,因为每次保存都会冻结 Eclipse 一段时间,当然这不依赖于小项目,所以如果你只编写 Hello world 项目,你就很好:)

回答by Pinaki Mukherjee

I had the same issue while setting up glassfish4 with eclipse. Below setting resolved the issue:

我在用 eclipse 设置 glassfish4 时遇到了同样的问题。下面的设置解决了这个问题:

  1. Keep username as "admin" with a blank password (Unless you changed anything while installation).

  2. Select - 'Use Anonymous Connection for Admin Commands' checkbox.

    enter image description here

  1. 将用户名保留为“admin”,密码为空(除非您在安装时更改了任何内容)。

  2. 选择 - '对管理命令使用匿名连接'复选框。

    在此处输入图片说明

Hope this helps.

希望这可以帮助。

回答by rgarg

Had the same problem , did restore default to remove the password set at the time of server installation in eclipse. The server started after that.

有同样的问题,在eclipse中确实恢复了默认删除了服务器安装时设置的密码。之后服务器就启动了。

回答by Sasikumar Murugesan

For the first time from your eclipse do not set any username and password as @mgttlinger said. i hope now you can start the server without any issue.

第一次从你的日食中不要像@mgttlinger 所说的那样设置任何用户名和密码。我希望现在您可以毫无问题地启动服务器。

  1. Open admin console by localhost:4848(not it wont ask any credential)
  2. To set admin password, go to Domain -> Administrator Password
  3. Enter New Password and Confirm New Password.
  4. Click on Save button
  5. Restart the server
  6. Try access localhost:4848(now you have to enter username and password to login admin console)
  1. 通过 localhost:4848 打开管理控制台(它不会询问任何凭据)
  2. 要设置管理员密码,请转到域 -> 管理员密码
  3. 输入新密码并确认新密码。
  4. 点击保存按钮
  5. 重启服务器
  6. 尝试访问 localhost:4848(现在您必须输入用户名和密码才能登录管理控制台)

In Eclipse also set username as admin and given password to access glassfish server from your eclipse

在 Eclipse 中,还将用户名设置为 admin 并提供密码以从 Eclipse 访问 glassfish 服务器

回答by user3346182

If your OS is Windows, and your Glassfish installation location is in root directory (e.g. C:\dev\tool\Glassfish ), then try run Eclipse "as administrator", believe it or not, I know its a bit weird, that does solve the problem.

如果您的操作系统是 Windows,并且您的 Glassfish 安装位置在根目录中(例如 C:\dev\tool\Glassfish ),那么尝试以“管理员身份”运行 Eclipse,信不信由你,我知道这有点奇怪,确实如此解决这个问题。

回答by Natasha KP

it seems that the problem is removed when auto-deploy after changes option is removed.

删除更改选项后自动部署时,问题似乎已消除。