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 262252 - Deploy on wildfly ends with HTTP Connector port 8080 is already in use
Summary: Deploy on wildfly ends with HTTP Connector port 8080 is already in use
Status: RESOLVED FIXED
Alias: None
Product: serverplugins
Classification: Unclassified
Component: WildFly (show other bugs)
Version: 8.1
Hardware: PC Other
: P1 normal (vote)
Assignee: ehsavoie
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-05-27 12:13 UTC by andreasxjohansson
Modified: 2016-06-01 09:52 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Threaddump (14.32 KB, text/plain)
2016-05-30 14:24 UTC, andreasxjohansson
Details
Server started but not detected (35.07 KB, image/jpeg)
2016-05-31 08:03 UTC, andreasxjohansson
Details

Note You need to log in before you can comment on or make changes to this bug.
Description andreasxjohansson 2016-05-27 12:13:00 UTC
Product Version = NetBeans IDE 8.1 (Build 201510222201)
Operating System = Windows Server 2008 R2 version 6.1 running on amd64
Java; VM; Vendor = 1.8.0_60
Runtime = Java HotSpot(TM) 64-Bit Server VM 25.60-b23

Reproducibility: Happens every time

Running on:
Windows Server 2008 R2 Datacenter SP1
64-bit

Whenever i try to run a service on wildfly i get the error message "HTTP Connector port 8080 is already in use".
The server (in services -> Servers) also seams to never start. 

The only way to run now is to kill the server and start it with war's already in Deployments-folde
Comment 1 ehsavoie 2016-05-27 12:20:35 UTC
Which WildFly version ?
Do you reproduce on current nightly build on Netbeans ?
Comment 2 andreasxjohansson 2016-05-27 13:30:55 UTC
Same issue on Nightly build: 201605270002

Deploying on WildFly Application Server
    profile mode: false
    debug mode: false
    force redeploy: true
Starting WildFly Application Server
WildFly Application Server Start Failed. HTTP Connector port 8080 is already in use.
Comment 3 broot02_86 2016-05-27 14:35:46 UTC
I am seeing this same issue when attempting to debug, as it starts the server, builds the war, attempts to start once more(for deploy of war).

Final Result

NetBeans: Deploying on WildFly Application Server 10
    profile mode: false
    debug mode: true
    force redeploy: true
Starting WildFly Application Server 10
WildFly Application Server 10 Start Failed. HTTP Connector port 8080 is already in use.
Comment 4 Petr Hejl 2016-05-27 14:57:39 UTC
Can you start the server manually? Is the port really free?
Comment 5 andreasxjohansson 2016-05-27 15:05:02 UTC
the port is not free because netbeans is already running the server.
Comment 6 Petr Hejl 2016-05-27 15:12:37 UTC
(In reply to andreasxjohansson from comment #5)
> the port is not free because netbeans is already running the server.

Ok, so the NB is not properly detecting the server is alreadu started? Is there any firewall in place? Canb you try to disable it?
Comment 7 andreasxjohansson 2016-05-30 11:19:56 UTC
Hi, windows the firewall is not turned on.
Comment 8 Petr Hejl 2016-05-30 13:06:34 UTC
Is the (first) server startup properly detected by the IDE? We need as many details as possible? Please also attach the log file and possibly a thread dump. Thanks.

http://wiki.netbeans.org/FaqLogMessagesFile
http://wiki.netbeans.org/GenerateThreadDump
Comment 9 ehsavoie 2016-05-30 14:01:03 UTC
Did you redefine the administration port ? Netbeans is looking at port 9990 (per default) to check that wildfly is up.
Comment 10 andreasxjohansson 2016-05-30 14:14:38 UTC
Hi, i will try my best to describe the problem.

1. When i just started NB the server can be started without problem, with was's in the deployment folder. Looking in NB the server does no understand that. The context menu on the server icon has start, start debug and so on. Only way to stop server from here is to kill the process.

2. I have no firewall, admin port is still on 9990

3. When i try to run a project in NB, it tries to start the server. if it is already started, i get the error message. When the project has been build, NB tries to start the server again, still with same error message.

4. this is the logg for when the server is running and i'm trying to run a project:

NetBeans: Deploying on WildFly Application Server
    profile mode: false
    debug mode: false
    force redeploy: true
Starting WildFly Application Server
WildFly Application Server Start Failed. HTTP Connector port 8080 is already in use.
cd C:\Development\ElektroniskTull\Extern_Interaktion\components\ekl\trunk\Implementation\service; JAVA_HOME=C:\\DevelopmentTools\\java\\jdk1.8.0_60 M2_HOME=C:\\DevelopmentTools\\maven\\apache-maven-3.2.1 cmd /c "\"\"C:\\DevelopmentTools\\maven\\apache-maven-3.2.1\\bin\\mvn.bat\" -Dnetbeans.deploy=true -Dmaven.ext.class.path=\"C:\\DevelopmentTools\\NetBeans 8.1\\java\\maven-nblib\\netbeans-eventspy.jar\" package\""
Scanning for projects...

Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1
                                                                        
------------------------------------------------------------------------
Building ekl-service 1.0.0-SNAPSHOT
------------------------------------------------------------------------

cut out text....

--- maven-site-plugin:3.3:attach-descriptor (attach-descriptor) @ ekl-service ---
------------------------------------------------------------------------
BUILD SUCCESS
------------------------------------------------------------------------
Total time: 35.341 s
Finished at: 2016-05-30T16:12:25+01:00
Final Memory: 23M/491M
------------------------------------------------------------------------
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option PermSize=256m; support was removed in 8.0
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=512m; support was removed in 8.0
NetBeans: Deploying on WildFly Application Server
    profile mode: false
    debug mode: false
    force redeploy: true
WildFly Application Server Start Failed. HTTP Connector port 8080 is already in use.
Comment 11 andreasxjohansson 2016-05-30 14:24:30 UTC
Created attachment 159917 [details]
Threaddump

Here is a threaddumb from just when the "run"-command ends with the error message
Comment 12 ehsavoie 2016-05-30 14:32:54 UTC
Where is your server installed ? Could you also past the WildFly log ?
Comment 13 andreasxjohansson 2016-05-31 06:18:19 UTC
What do you mean "where" ? 
the local path?
Comment 14 andreasxjohansson 2016-05-31 06:29:42 UTC
The server log is quiet when i try to run a project. This is the last log entered and i started the run-job after this log.

2016-05-31 08:19:57,929 INFO  [org.jboss.as.server.handleResult() Line:137] (ServerService Thread Pool -- 36) JBAS015859: Deployed "ekl-service.war" (runtime-name : "ekl-service.war")
2016-05-31 08:19:58,418 INFO  [org.jboss.as.logAdminConsole() Line:114] (Controller Boot Thread) JBAS015961: Http management interface listening on http://127.0.0.1:9990/management
2016-05-31 08:19:58,418 INFO  [org.jboss.as.logAdminConsole() Line:116] (Controller Boot Thread) JBAS015951: Admin console listening on http://127.0.0.1:9990
2016-05-31 08:19:58,419 INFO  [org.jboss.as.done() Line:93] (Controller Boot Thread) JBAS015874: JBoss EAP 6.4.2.GA (AS 7.5.2.Final-redhat-2) started in 77640ms - Started 1012 of 1099 services (165 services are lazy, passive or on-demand)
Comment 15 andreasxjohansson 2016-05-31 06:30:50 UTC
the jboss is installed at: C:\DevelopmentTools\jboss\jboss-eap-6.4.2\jboss-eap-6.4\
Comment 16 ehsavoie 2016-05-31 07:47:04 UTC
Ok so this is not WildFly but JBoss EAP 6.4.2 as the log and the path show. It's getting hard to follow your issue. If you start the server manually does the plugin detect it ?
Comment 17 andreasxjohansson 2016-05-31 08:03:40 UTC
Created attachment 159924 [details]
Server started but not detected

Hm, sorry i thought wildfly was the name of the jboss plugin for versions above 6.3. I tried to use the jboss server first but it could not find my server, wildfly could.

No, the plugin does not detect that the server has started. Look at the attached jpeg
Comment 18 Petr Hejl 2016-05-31 09:04:21 UTC
So the problem is NB does not detect the server is started (and inevitably tries to start it again on deployment).

Please attach the IDE log as requested in comment #8 and thread dump invoked just after the server is started for the first time (and IDE is not detecting it as started).

Any other detail about OS or server configuration would help a lot.
Comment 19 ehsavoie 2016-05-31 09:12:31 UTC
Ok there seems to be an issue with EAP as I'm setting the native remoting to listen on 9990 but this conflicts with the http remoting which is activated.
Editing the standalone(-full).xml can fix this. I'm going to try to have a fix by tonight so hopefully in tomorrow nightly build
Comment 20 ehsavoie 2016-05-31 09:13:16 UTC
But do you have a similar issue with WildFly using the original WildFly config file ?
Comment 21 andreasxjohansson 2016-05-31 10:56:08 UTC
Hm, i have not tried that.
I just reasonly changed from eclipse to NB so i just imported my server as is.

i don't have any projects that i can run without alot of standalone config so to test that i will have to put some time into it,
and since i'm on the clock, i'd rather not :)

but if you really need me to i will se if i can squeeze it in.
Comment 22 andreasxjohansson 2016-05-31 10:57:27 UTC
(In reply to Petr Hejl from comment #18)
> So the problem is NB does not detect the server is started (and inevitably
> tries to start it again on deployment).
> 
> Please attach the IDE log as requested in comment #8 and thread dump invoked
> just after the server is started for the first time (and IDE is not
> detecting it as started).
> 
> Any other detail about OS or server configuration would help a lot.

What more logs do you need?
I have attached the threaddump, the build IDE-log and the serverlog.
Comment 23 ehsavoie 2016-05-31 14:03:27 UTC
The issue is that EAP 6 has 2 mreoting management end points : one for native remoting and on e for http remoting while wildfly has only one (http) per default.
When you select an admin port in the plugin and if you are on EAP it will set the native port value. 
It looks like you selected 9990 which conflicts with the http port :( so removing the native-management interface or http-management interface from your configuration file should fix your issue.
Comment 24 andreasxjohansson 2016-05-31 14:32:05 UTC
Hi,
good that you found the issue.
but i don't understand how to fix it. 

i have located the management-interface tag in standalone.xml. But the http-port is not the same as the native port. and now i have set them to 9999 for native and 9995 for http. but still the same issue.
Comment 25 ehsavoie 2016-05-31 15:56:31 UTC
First per default we are using standalone-full.xml for a full Java EE support.
Secondly the port definitions are expressions : 
        <socket-binding name="management-native" interface="management" port="${jboss.management.native.port:9999}"/>
        <socket-binding name="management-http" interface="management" port="${jboss.management.http.port:9990}"/>
        <socket-binding name="management-https" interface="management" port="${jboss.management.https.port:9443}"/>
so 9999 will be used if no jboss.management.native.port system property is defined.
When netbeans starts the server and if it is of a version prior to wildfly 9 (which is the case for EAP currently) it will add -Djboss.management.native.port=9990 (which is the port you have defined when configuring the plugin).
So your option is to remove the server from the plugin, add a new server and use 9999 as the admin port instead of 9990. This should make it works.
Comment 26 ehsavoie 2016-05-31 16:55:15 UTC
Should be fixed in changeset 297888:87b1aac5f491
Comment 27 andreasxjohansson 2016-06-01 05:55:33 UTC
my admin console starts at: http://localhost:9990/

and my standalone is:
<socket-binding name="management-native" interface="management" port="${jboss.management.native.port:9999}"/>
        <socket-binding name="management-http" interface="management" port="${jboss.management.http.port:9990}"/>
        <socket-binding name="management-https" interface="management" port="${jboss.management.https.port:9443}"/>

so it should work?

if i use the last nightly build, it should work without any changes from my side?
Comment 28 andreasxjohansson 2016-06-01 05:57:36 UTC
this is what the server sais when starting:


Calling "C:\DevelopmentTools\jboss\jboss-eap-6.4.2\jboss-eap-6.4\bin\standalone.conf.bat"
"JAVA_OPTS already set in environment; overriding default settings with values: -Xms128m -Xmx512m -server -Dhttp.nonProxyHosts=localhost,127.0.0.1,UTVWS1246 -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true -Djboss.management.native.port=9999 -Djboss.http.port=8080"
Setting JAVA property to "C:\DevelopmentTools\java\jdk1.8.0_60\bin\java"
===============================================================================

  JBoss Bootstrap Environment

  JBOSS_HOME: "C:\DevelopmentTools\jboss\jboss-eap-6.4.2\jboss-eap-6.4"

  JAVA: "C:\DevelopmentTools\java\jdk1.8.0_60\bin\java"

  JAVA_OPTS: "-verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=3M -XX:-TraceClassUnloading -XX:+UseCompressedOops -Dprogram.name=standalone.bat -Xms128m -Xmx512m -server -Dhttp.nonProxyHosts=localhost,127.0.0.1,UTVWS1246 -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true -Djboss.management.native.port=9999 -Djboss.http.port=8080"

===============================================================================
Comment 29 ehsavoie 2016-06-01 09:52:37 UTC
1/ I don't know if the fix was merged in last night build, sorry
2/ After the fix yes, you seemed to have fixed it since I see -Djboss.management.native.port=9999 in your startup log.