Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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".

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.

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).

like image 316
Natasha KP Avatar asked Feb 24 '11 08:02

Natasha KP


4 Answers

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).

I hope this helps anybody.

EDIT putting together compatibility of this fix from the comments:

Kepler & 4.0 Luna & 4.1 Mars & 4.1

like image 150
mgttlinger Avatar answered Nov 14 '22 22:11

mgttlinger


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...

like image 34
Bart Kummel Avatar answered Nov 14 '22 22:11

Bart Kummel


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

rather than, for example:

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.

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.

like image 9
Arjan Avatar answered Nov 15 '22 00:11

Arjan


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 :)

like image 2
user1746371 Avatar answered Nov 15 '22 00:11

user1746371