This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 230496 - NetBeans can't start a Local GlassFish domain after you deploy any app and stop the server
Summary: NetBeans can't start a Local GlassFish domain after you deploy any app and st...
Status: RESOLVED DUPLICATE of bug 221075
Alias: None
Product: serverplugins
Classification: Unclassified
Component: GlassFish (show other bugs)
Version: 7.3
Hardware: PC Windows XP
: P3 normal (vote)
Assignee: TomasKraus
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-05-30 05:38 UTC by ptrts
Modified: 2013-08-03 23:09 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
What happens when I start NetBeans and try to start GlassFish (61.33 KB, text/plain)
2013-05-30 10:17 UTC, ptrts
Details
What happens when I start NetBeans and try to start the server (119.32 KB, text/plain)
2013-05-30 13:51 UTC, ptrts
Details
netstat -a -b when NetBeans is waiting for GlassFish to start (but it won't) (7.01 KB, text/plain)
2013-05-30 14:16 UTC, ptrts
Details
Take two (558.48 KB, text/plain)
2013-06-03 14:02 UTC, ptrts
Details
IDE log file, take #3 (559.70 KB, text/plain)
2013-06-03 14:14 UTC, ptrts
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ptrts 2013-05-30 05:38:20 UTC
Me: Tools - Servers - Add server... - GlassFish Server 3+ - Next - Next - Finish - Close...

NetBeans: Domain creation successful. View the results?

Me: Yes

NetBeans:

Running the create-domain subcommand
Using default port 4848 for Admin.
Using default port 8080 for HTTP Instance.
Using default port 7676 for JMS.
Using default port 3700 for IIOP.
Using default port 8181 for HTTP_SSL.
Using default port 3820 for IIOP_SSL.
Using default port 3920 for IIOP_MUTUALAUTH.
Using default port 8686 for JMX_ADMIN.
Using default port 6666 for OSGI_SHELL.
Using default port 9009 for JAVA_DEBUGGER.
The file in given locale [ru_RU] at: [C:\Program Files\GlassFish Server 3\glassfish\lib\templates\locales\ru_RU\index.html] could not be found. Using default (en_US) index.html instead.
Distinguished Name of the self-signed X.509 Server Certificate is:
[CN=electrica8.promeco.local,OU=GlassFish,O=Oracle Corporation,L=Santa Clara,ST=California,C=US]
Distinguished Name of the self-signed X.509 Server Certificate is:
[CN=electrica8.promeco.local-instance,OU=GlassFish,O=Oracle Corporation,L=Santa Clara,ST=California,C=US]
No domain initializers found, bypassing customization step
Domain personal_domain_13 created.
Domain personal_domain_13 admin port is 4848.
Domain personal_domain_13 allows admin login as user "anonymous" with no password.
Command create-domain executed successfully.

Me: New Project... - Java Web/Web Application - Next - Next - Next - Finish - Deploy

NetBeans:

ant -f E:\\Таруц\\Java\\WebApplication3 -DforceRedeploy=true -Ddirectory.deployment.supported=true -Dnb.wait.for.caches=true run-deploy
init:
deps-module-jar:
deps-ear-jar:
deps-jar:
library-inclusion-in-archive:
library-inclusion-in-manifest:
compile:
compile-jsps:
Starting GlassFish Server 3+
GlassFish Server 3+ is running.
In-place deployment at E:\Таруц\Java\WebApplication3\build\web
Initializing...
run-deploy:
BUILD SUCCESSFUL (total time: 15 seconds)

GlassFish:

Launching GlassFish on Felix platform
INFO: Running GlassFish Version: GlassFish Server Open Source Edition 3.1.2.2 (build 5)
INFO: Registered org.glassfish.ha.store.adapter.cache.ShoalBackingStoreProxy for persistence-type = replicated in BackingStoreFactoryRegistry
INFO: Grizzly Framework 1.9.50 started in: 94ms - bound to [0.0.0.0:8080]
INFO: Grizzly Framework 1.9.50 started in: 78ms - bound to [0.0.0.0:8181]
INFO: Grizzly Framework 1.9.50 started in: 63ms - bound to [0.0.0.0:3700]
INFO: Grizzly Framework 1.9.50 started in: 78ms - bound to [0.0.0.0:4848]
INFO: Grizzly Framework 1.9.50 started in: 47ms - bound to [0.0.0.0:7676]
INFO: GlassFish Server Open Source Edition 3.1.2.2 (5) startup time : Felix (8 325ms), startup services(703ms), total(9 028ms)
SEVERE: invalidproxy
INFO: JMX005: JMXStartupService had Started JMXConnector on JMXService URL service:jmx:rmi://electrica8.promeco.local:8686/jndi/rmi://electrica8.promeco.local:8686/jmxrmi
INFO: HV000001: Hibernate Validator 4.3.0.Final
INFO: Grizzly Framework 1.9.50 started in: 15ms - bound to [0.0.0.0:8080]
INFO: unable to read instance state file C:\Documents and Settings\tarutc\personal_domain_14\config\.instancestate, recreating
INFO: Grizzly Framework 1.9.50 started in: 16ms - bound to [0.0.0.0:8181]
INFO: SEC1002: Security Manager is OFF.
INFO: SEC1010: Entering Security Startup Service
INFO: SEC1143: Loading policy provider com.sun.enterprise.security.provider.PolicyWrapper.
INFO: SEC1115: Realm [admin-realm] of classtype [com.sun.enterprise.security.auth.realm.file.FileRealm] successfully created.
INFO: SEC1115: Realm [file] of classtype [com.sun.enterprise.security.auth.realm.file.FileRealm] successfully created.
INFO: SEC1115: Realm [certificate] of classtype [com.sun.enterprise.security.auth.realm.certificate.CertificateRealm] successfully created.
INFO: SEC1011: Security Service(s) Started Successfully
INFO: WEB0169: Created HTTP listener [http-listener-1] on host/port [0.0.0.0:8080]
INFO: WEB0169: Created HTTP listener [http-listener-2] on host/port [0.0.0.0:8181]
INFO: WEB0169: Created HTTP listener [admin-listener] on host/port [0.0.0.0:4848]
INFO: WEB0171: Created virtual server [server]
INFO: WEB0171: Created virtual server [__asadmin]
INFO: WEB0172: Virtual server [server] loaded default web module []
INFO: WEB0671: Loading application [WebApplication3] at [/WebApplication3]
INFO: WebApplication3 was successfully deployed in 1 609 milliseconds.

Me: Services/Servers/GlassFish 3+/Stop

GlassFish:

INFO: Server shutdown initiated
INFO: JMX002: JMXStartupService: Stopped JMXConnectorServer: null
INFO: JMX001: JMXStartupService and JMXConnectors have been shut down.
INFO: Shutdown procedure finished
Completed shutdown of Log manager service

Me: Services/Servers/GlassFish 3+/Start

GlassFish: nothing

NetBeans: nothing
Comment 1 ptrts 2013-05-30 05:50:55 UTC
And after all that, if I delete the domain, I can't re-register it, because:

Unsupported domain at C:\...; Admin-listener is disabled or no enabled http-listener
Comment 2 Jiri Skrivanek 2013-05-30 05:57:26 UTC
Please, attach your messages log (View|IDE Log) from time when it is not possible to start GlassFish domain. Or try to create a new domain in some area without windows access restrictions.
Comment 3 ptrts 2013-05-30 08:34:16 UTC
I have all access rights on the folder I put domains into

Here is what is written to the IDE log after I try to start the server:

INFO [org.glassfish.tools.ide]: [GlassFish Server 3+] Port check could not connect to localhost:4848: Connection refused: connect
INFO [org.glassfish.tools.ide]: [GlassFish Server 3+] Port check could not connect to localhost:4848: Connection refused: connect
Comment 4 TomasKraus 2013-05-30 09:12:20 UTC
What version of GlassFish did you use?

Looks like NetBeans can't connect to 127.0.0.1:4848 after server is started.
Check your windows if there is something blocking access to this IP:port. Also try if you can access it from web browser (guess you don't have telnet to try just plain network connection).

As another step to get more information, put -J-Dglassfish.level=0 -J-Dorg.glassfish.tools.ide.level=0 options into netbeans_default_options in your netbeans config file (etc/netbeans.conf) and reproduce this issue again. It will produce more detailed log about server startup.

Attach it to this bug.
Comment 5 ptrts 2013-05-30 09:51:35 UTC
I doubt something is blocking the port. Domain starts just fine. And stopes. And starts again. And starts after I reboot the computer, and so on. Domain administrator console works good. 

Then I deploy "Hello, world!" web app. It's done just fine as well. Then I start the app and it works. But if I stop the domain, It won't be started again if I try to start it as one embedded into NetBeans. 

But still can start it with asadmin, deploy applications, use administrator console and so on
Comment 6 ptrts 2013-05-30 10:17:17 UTC
Created attachment 135119 [details]
What happens when I start NetBeans and try to start GlassFish

"-J-Dglassfish.level=0 -J-Dorg.glassfish.tools.ide.level=0" was added to netbeans_default_options as Tomas suggested
Comment 7 ptrts 2013-05-30 10:19:13 UTC
GlassFish is 3.1.2.2 (build 5)
Comment 8 TomasKraus 2013-05-30 11:40:41 UTC
Problem seems to be in failing port check. Unfortunately I can't do much with this. It's just simple
            InetSocketAddress sa = new InetSocketAddress(host, port);
            Socket socket = new Socket();
check to see if something is listening on IP:port of admin interface.

In 7.3.1 this check provides more details about exception thrown in those 2 lines of code.

Try to download http://bertram2.netbeans.org:8080/job/javaee7/lastSuccessfulBuild/artifact/nbbuild/NetBeans-dev-javaee7-332-on-20130529-full.zip and see if it works for you. If not, just add the same debug options into it's config file and attach logs again.
Comment 9 ptrts 2013-05-30 13:51:30 UTC
Created attachment 135142 [details]
What happens when I start NetBeans and try to start the server

GlassFish is 4.0 (build 89)

This time I performed the experiments in Windows 7 (64)
Comment 10 ptrts 2013-05-30 13:55:12 UTC
Still NetBeans can't do what asadmin can
Comment 11 ptrts 2013-05-30 14:16:13 UTC
Created attachment 135146 [details]
netstat -a -b when NetBeans is waiting for GlassFish to start (but it won't)

No 4848
Comment 12 ptrts 2013-05-31 01:45:21 UTC
Could it be NetBeans itself that prevents it from listening to the port? Because realy (sorry for repeating) probability that it's some other process realy seems pretty low to me

Why that other process does not interfere before I deploy something?

How such an internal to NetBeans and GlassFish thing as deployment of an app can force some other process to start making problems (and continue after reboot of the OS)?

Why it doesn't make a problem for GlassFish network server, so the domain can be started with asadmin?

Why after all "netstat -a -b" can't see that process?

And why deployment make the domain go "Unsupported domain at C:\...; Admin-listener is disabled or no enabled
http-listener"?
Comment 13 TomasKraus 2013-06-03 08:46:29 UTC
Well, I simply don't know. I need to get full logs of server startup with -J-Dglassfish.level=0 -J-Dorg.glassfish.tools.ide.level=0, not just small pieces.
I don't see server startup command and following status checks there.
Comment 14 ptrts 2013-06-03 14:02:10 UTC
Created attachment 135273 [details]
Take two

Actions are:
1. IDE startup
2. Expanding "Services/Servers" node
3. Starting the GF (sucessfuly, because no app has been deployed yet)
4. Deployment of the "Hello World!" application
5. Stopping the GF
6. Attempt to start the GF again (fails)

I've commented the places in the log file where each action starts
Comment 15 ptrts 2013-06-03 14:03:55 UTC
^^ that is an IDE log file
Comment 16 ptrts 2013-06-03 14:14:22 UTC
Created attachment 135277 [details]
IDE log file, take #3

Actions are:
1. IDE startup
2. Expanding "Services/Servers" node
3. Starting the GF (sucessfuly, because no app has been deployed yet)
4. Deployment of the "Hello World!" application
5. Stopping the GF
6. Attempt to start the GF again (fails)

I've commented the places in the log file where each action starts
Comment 17 TomasKraus 2013-07-24 13:46:10 UTC
This looks really bad.
Well, in the logs you can find command line arguments that are executed:

FINEST [org.glassfish.tools.ide]: Java VM D:\glassfish3\jdk7\bin\java.exe executable version 1.7.0_11

FINEST [org.glassfish.tools.ide]: Starting GlassFish Server 4.0 (domain 6) using Java VM D:\glassfish3\jdk7\bin\java.exe and arguments -cp "D:\Program Files\glassfish-4.0\glassfish\modules\glassfish.jar"  -XX:MaxPermSize=192m -client -Djava.awt.headless=true -Djavax.management.builder.initial=com.sun.enterprise.v3.admin.AppServerMBeanServerBuilder -XX:+UnlockDiagnosticVMOptions -Djava.endorsed.dirs="D:\Program Files\glassfish-4.0\glassfish/modules/endorsed;D:\Program Files\glassfish-4.0\glassfish/lib/endorsed" -Djava.security.policy="D:\Program Files\glassfish-4.0\glassfish\domains\domain6/config/server.policy" -Djava.security.auth.login.config="D:\Program Files\glassfish-4.0\glassfish\domains\domain6/config/login.conf" -Dcom.sun.enterprise.security.httpsOutboundKeyAlias=s1as -Xmx512m -Djavax.net.ssl.keyStore="D:\Program Files\glassfish-4.0\glassfish\domains\domain6/config/keystore.jks" -Djavax.net.ssl.trustStore="D:\Program Files\glassfish-4.0\glassfish\domains\domain6/config/cacerts.jks" -Djava.ext.dirs="D:\glassfish3\jdk7/lib/ext;D:\glassfish3\jdk7/jre/lib/ext;D:\Program Files\glassfish-4.0\glassfish\domains\domain6/lib/ext" -Djdbc.drivers=org.apache.derby.jdbc.ClientDriver -DANTLR_USE_DIRECT_CLASS_LOADING=true -Dcom.sun.enterprise.config.config_environment_factory_class=com.sun.enterprise.config.serverbeans.AppserverConfigEnvironmentFactory -Dorg.glassfish.additionalOSGiBundlesToStart=org.apache.felix.shell,org.apache.felix.gogo.runtime,org.apache.felix.gogo.shell,org.apache.felix.gogo.command,org.apache.felix.shell.remote,org.apache.felix.fileinstall -Dosgi.shell.telnet.port=6666 -Dosgi.shell.telnet.maxconn=1 -Dosgi.shell.telnet.ip=127.0.0.1 -Dgosh.args=--nointeractive -Dfelix.fileinstall.dir="D:\Program Files\glassfish-4.0\glassfish/modules/autostart/" -Dfelix.fileinstall.poll=5000 -Dfelix.fileinstall.log.level=2 -Dfelix.fileinstall.bundles.new.start=true -Dfelix.fileinstall.bundles.startTransient=true -Dfelix.fileinstall.disableConfigSave=false -XX:NewRatio=2 -javaagent:"D:\Program Files\glassfish-4.0\glassfish\lib\monitor\flashlight-agent.jar" -D"com.sun.aas.javaRoot=D:\glassfish3\jdk7" -D"com.sun.aas.derbyRoot=D:\Program Files\glassfish-4.0\javadb" -D"com.sun.aas.instanceRoot=D:\Program Files\glassfish-4.0\glassfish\domains\domain6" -D"com.sun.aas.installRoot=D:\Program Files\glassfish-4.0\glassfish" com.sun.enterprise.glassfish.bootstrap.ASMain --domain domain6 --domaindir "D:\Program Files\glassfish-4.0\glassfish\domains\domain6"

FINEST [org.glassfish.tools.ide]: Setting GlassFish Server 4.0 (domain 6) process current directory to D:\Program Files\glassfish-4.0\glassfish\domains\domain6

Try to run this manually to see what will happen. Just copy paste
D:\glassfish3\jdk7\bin\java.exe and everything following -cp  and check what will happen. There may be something wrong - e.g. missing "" around path containing space or wrong order of arguments.
Comment 18 TomasKraus 2013-08-03 16:20:18 UTC
Please can you try to reproduce this with NetBeans 7.3.1 and also latest development build of NetBeans 7.4?

I would like to know if 7.3.1/7.4 are able to detect server status. There were some significant changes in server state monitoring, especially in 7.4.

Do it with -J-Dglassfish.level=0 -J-Dorg.glassfish.tools.ide.level=0 to see extended debug info for the plugin.
Comment 19 TomasKraus 2013-08-03 23:09:43 UTC
Also I remember that we fixed server status checks in 7.3 before release where there was typo which was causing exactly the same problem. And after that this kind of bug was never reported again.

So this is a duplicate of Bug# 221075. I should have asked you to reproduce this with some newer version immediately.

If you see the same problem with 7.3.1 or 7.4 dev build feel free to reopen this bug again.

*** This bug has been marked as a duplicate of bug 221075 ***