Please use the Apache issue tracking system for new NetBeans issues ( !!
Bug 234594 - Cannot use previously installed GlassFish due to missing password
Cannot use previously installed GlassFish due to missing password
Product: serverplugins
Classification: Unclassified
Component: GlassFish
PC Linux
: P3 (vote)
: 8.0
Assigned To: TomasKraus
Depends on:
  Show dependency treegraph
Reported: 2013-08-19 14:12 UTC by Vladimir Riha
Modified: 2015-09-17 13:09 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT

IDE log (57.04 KB, text/x-log)
2013-08-19 14:12 UTC, Vladimir Riha
server log (48.23 KB, text/x-log)
2013-08-19 14:13 UTC, Vladimir Riha

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Riha 2013-08-19 14:12:59 UTC
Created attachment 138864 [details]
IDE log

Please try following steps:
 - install (from installator) trunk NetBeans, full distribution with bundled GlassFish4
 - run NetBeans, create e.g. Java Web project and run it
 - quit NetBeans and uninstall them (remove user dir and NetBeans installation dir, but KEEP Glassfish installed)
 - install the same NetBeans again, this time GF is recognized as already installed
 - start NetBeans, create a new Java Web project
 - previously installed GF is automatically added to list of available servers (it is the only one there)
 - run the application
 - you are asked to provide some password for username "admin", press Cancel (I've tried OK as well though)

=> action fails (but GS is actually running). 

<html>GlassFish Server 4.0 start failed<br/>Please check server admin user name and password properties.<br/>Also please check the server log file for other possible causes.</html>
/home/vriha/NetBeansProjects/WebApplication7/nbproject/build-impl.xml:1045: Deployment error: <html>GlassFish Server 4.0 start failed<br/>Please check server admin user name and password properties.<br/>Also please check the server log file for other possible causes.</html>
See the server log for details.

I was told that during the first installation, some admin password is created (and indeed the first IDE instance shows some random string in server's properties dialog), but this information is somehow lost with removing userdir and if I open server's properties dialog in the 2nd installation, password field is empty.

This is imho quite confusing. Workaround seems to be again register the server with creating a new domain, but this is hard to discover. I'd vote for P2 but I'm really not sure.

Product Version: NetBeans IDE Dev (Build 201308182300)
Java: 1.7.0_40; Java HotSpot(TM) Client VM 24.0-b55
Runtime: Java(TM) SE Runtime Environment 1.7.0_40-b39
System: Linux version 3.2.0-48-generic-pae running on i386; UTF-8; en_US (nb)
Comment 1 Vladimir Riha 2013-08-19 14:13:27 UTC
Created attachment 138865 [details]
server log
Comment 2 Vladimir Riha 2013-08-19 14:16:23 UTC
(In reply to Vladimir Riha from comment #0)
> => action fails (but GS is actually running). 

I'm sorry, I've ment GF, GlassFish is running
Comment 3 TomasKraus 2013-08-19 15:30:31 UTC
Well, this was requested by security team in GF4. So I did it.
Password is stored in Keyring so it's lost when Keyring is removed.

Server properties UI allows user to see this password (what I think is a security hole) but I got an order to do it this way.

So yes, GF is started because no password is required to start GF task. Unfortunately plugin is unable to run a single asadmin command without proper password so it's impossible to verify that running server is the one being started.

Possible solution is to allow password reset. Workaround is to read password ater it's generated and update properties after netbeans are reinstalled.

But I don't consider this as a bug.
Comment 4 Vladimir Riha 2013-08-19 15:49:53 UTC
I'm fine with some/any workaround but I think there could be some help to tell user what to do.
Comment 5 TomasKraus 2013-08-20 09:48:47 UTC
Yes, but I'm unable to find out why password is missing. I just see auth failure response from asadmin interface on GF -> this will open credentials popup and block startup scans.
But there is no way to proceed when this is cancelled. That's why current popup window is talking about credentials and log file.

Adding Peter Hejl into cc because he was implementing this too. Maybe he was already solving similar problem with his plugin and can come with some idea.

The only thing on my mind is to allow killing the server process and resetting password  for domain. There is already code to support this in the plugin. I need to add server node menu items for those actions.
Comment 6 TomasKraus 2013-08-22 12:23:02 UTC
Checked into web-main:
changeset:   261640:57df4ea18920
summary:     #234594 - GlassFish server process kill support

This is not activated yet, because there is some inconsistency when server is killed while StartTask is still running.

I need to modify StartTask to handle cancel event and there shall not be any active StartTask when KillTask is being started.

Unfortunately this is opening quite commin problem with all server lifecycle tasks. Currently there is no 100% reliable way to controll how many such tasks are running. But there shall be only one, otherwise terrible race condition with server life cycle may happen (one taks is starting it, second one restarting and another one killin git).
Also all sasks shall be able to exit silently without sending any events when cancelled.

I'm targeting this for next release. It's too late to trwrite lifecycle tasks week before code freeze.
Comment 7 Martin Balin 2015-09-17 13:09:57 UTC
Report from old NetBeans version. Due to code changes since it was reported likely not reproducible now. Feel free to reopen if happens in 8.0.2 or 8.1.

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo