13

I'm using NetBeans 8.0.2 (also, tried it in the latest nightly build) and trying to start TomEE Plume server on port 8084 (tried it on different port too). Server starts and works fine, but NetBeans thinks it is not started and after approximately 2 minutes of waiting ("Waiting for Tomcat") throws an error window "Tomcat failed to start" or something like that.

There are questions similar to mine with the difference that I have totally no errors, only "Tomcat failed to start" window, so I can't even put the log here as it says nothing useful. Also, available solutions are not working for me.

I believe that there's some communication problems between NetBeans and TomEE, also I'm almost sure the problem is in NetBeans because TomEE works well and starts as it should, localhost:8084 gives me Tomcat page though NetBeans think it failed to start. There's some small chance that for some reason TomEE is not sending confirmation to NetBeans after starting, but I really have no ideas how to check that.

I've looked into the same issues, two most common problems are "'127.0.0.1*' is not recognized as an internal or external command" and the very same I have. Solution suggested was to choose "No proxy" in the Tools-Options, still it didn't help me.

Also, just to be sure, I've edited catalina.bat file and checked my user permissions that are roles="admin-gui,manager-gui,admin,manager-script".

I hope someone faced the same issue. Also, I'd like to know is this problem even solvable. Thanks.

Mugi4ok
  • 275
  • 2
  • 5
  • 15
  • The answer provided solves correctly. This issue is similar as described here: https://stackoverflow.com/a/38277506/744133 - that answer will describe exactly which versions of netbeans would be affected. – YoYo Jul 20 '17 at 12:56

6 Answers6

27

In server.xml, remove the xpoweredBy and server attributes from the connector:

<Connector port="8080" protocol="HTTP/1.1"
           connectionTimeout="20000"
           redirectPort="8443" xpoweredBy="false"
           server="Apache TomEE" />
Sébastien Sevrin
  • 4,777
  • 1
  • 20
  • 37
Steve F.
  • 286
  • 3
  • 2
  • Never seen this solution before, but that did it, thank you, @Steve! Also, have no idea why those two attributes influence NetBeans in that kind of way. – Mugi4ok Jun 06 '15 at 17:47
  • This was the only solution for me to eliminate the long running situation at the and of deployment. Unfortunately I did not get the exact explanation of this situation. But your workaround is good. Thx :-) – Miklos Krivan Jun 20 '15 at 20:14
  • 2
    lol, it works! would like the author to elaborate a bit more on the solution, too. – andbi Jul 19 '15 at 18:30
  • 4
    It seems that removing only **server** attribute is enough. It was sufficient for me to fix the issue. xpoweredBy seems to be unrelated to the problem.. – OndroMih Sep 10 '15 at 21:23
  • Finally! Removing the *server* attribute worked for me! I also removed the quotes `"` as mentioned in the other answer, but without removing the server it did not work – LyK Sep 11 '15 at 06:57
  • Great. Thanks. This did it after spending 2 hours to find the solution. – Eymen Nov 06 '15 at 20:42
  • Thanks :) This helped me too; I have TomEE plume 1.7.4/NetBeans 8.0.1/Linux; But can you give more details why the server.xml needs this modification in case of NetBeans cause I have it working fine with my Eclipse? – user390525 Nov 05 '19 at 21:04
15

NetBeans 8.0.2 was working well with TomEE+ 1.7.1, but then I upgraded from TomEE+ 1.7.1 to 1.7.2, added TomEE+ 1.7.2 in Services > Servers in NetBeans 8.0.2, and that's when I experienced the 'Failed to start' error while running latest-and-patched NetBeans 8.0.2 and TomEE+ 1.7.2.

In server.xml, I had the following:

<Connector port="8080" protocol="org.apache.coyote.http11.Http11NioProtocol"
           maxThreads="150" connectionTimeout="20000" acceptorThreadCount="2"
           redirectPort="8443" socket.directBuffer="false"/>

I attempted to modify the Connector, but that did not fix the issue.

The fix for me was to uncheck the Use IDE Proxy Settings checkbox on the Platform tab of the Server properties of Apache TomEE+ 1.7.2. See below.

enter image description here

Howard
  • 762
  • 8
  • 41
  • Thank you for the answer! I believe your method can work as well as editing server.xml, I will try that a bit later. Also, giving you imaginary upvote because can't give you the real one. – Mugi4ok Jun 12 '15 at 21:02
  • Working solution but I would suggest to repair the catalina.bat file instead. The new version contains quotes in two places around SET JAVA_OPTS which has interference with Netbeans nonProxyHost value. The previous version had no quotes. See my detailed answer below. – Miklos Krivan Jun 20 '15 at 20:13
  • This worked in my case too. Netbeans 8.0.2, Tomcat 7 – nonabhai Jul 01 '19 at 07:44
7

I'd check the proxy settings in netbeans under preferences to be "No Proxy" rather than "Use System Proxy Settings".

Worked for me.

Source: https://www.youtube.com/watch?v=uI1j-8F8eN4

Michael Stokes
  • 501
  • 7
  • 23
5

In tomcat 8.5.11 with Netbeans 8.1 I had to change this:

<Connector port="8080" protocol="HTTP/1.1"
           connectionTimeout="20000" 
           redirectPort="8443" />

for this:

<Connector port="8080" protocol="HTTP/1.1"
           connectionTimeout="20000" xpoweredBy="false" server="Apache-Coyote/1.1"
           redirectPort="8443" />

In server.xml file.

Guilherme
  • 474
  • 6
  • 11
4

Today I have met with the same situation when I wanted to upgrade from TomEE 1.7.0 to 1.7.2 and based on Mugi4ok's question and Howard's and Steve's answers (because all of you are right but the root of the problem remains in the system) I did some deeper analysis on the mentioned situation and finally I have found the root of it.

There are two different issues in the new TomEE release (1.7.2)

  • One raises when you start the debug or run session in NetBeans and you get immediately the message: The given name (127.0.0.1*) could not be recognized by the system as command ...
  • The other raises at the end of the deployment process which generates the long running situation

Let's see the first case. Because it is generated at the very beginning of the run/debug process I have checked first the catalina.bat script because it is called first. I have compared the both version coming from TomEE 1.7.0 and 1.7.2. And the problem was almost trivial.

TomEE changed two lines in the script:

in 1.7.0 it was this:

set JAVA_OPTS=%JAVA_OPTS% %LOGGING_CONFIG%

but in 1.7.2 they put quotes around it:

set "JAVA_OPTS=%JAVA_OPTS% %LOGGING_CONFIG%"

And that is a big change if the JAVA_OPTS environment variable contains quote as well. And if use NetBeans and we use nonProxyHosts setup and we have switched on the "Use IDE Proxy settings" checkbox at the platform setup of the TomEE server we will have something like this in JAVA_OPTS (I have just extracted the relevant value for our case of course we have many other parameters as well):

 -Dhttp.nonProxyHosts="localhost*|127.0.0.1*|10.*"

If you look carefully on the first quote and you look at the first pipe character you already know what happens :-)

Just write this command into the shell and try to execute:

set "JAVA_OPTS=-Dhttp.nonProxyHosts="localhost*|127.0.0.1*|10*"

The first pipe character will act as is so the command shell will try to interpret the following string as a command but 127.0.0.1* is not a command.

So my suggested solution is delete the extra quotes in the the new release as it was in the previous release. They are in the 179 and 184 rows and the problem simple will be disappeared and you need not to eliminate the proxy settings at all, you can use them as you need. In this case you need not to switch off the Proxy settings switch as well. If you want to rely on the NetBeans proxy settings you can do with this small modification.

The second situation which generates timeout in deployment it was extremely strange for me and only the Steve's answer helped me so thanks for it.

Summary if you see some bugs in a new release of any open source system first check the modification and try to find which back step by step. In this case this solved everything.

I hope that TomEE will also recognize this and repair them soon in the next release or they create a patch for it.

Brian Tompsett - 汤莱恩
  • 5,195
  • 62
  • 50
  • 120
Miklos Krivan
  • 1,564
  • 16
  • 14
2

if you have an only message "Failed to Start" when add a new server in Netbeans 8.X -> Go to

Servers> (select your server added) > plataform > "used ide proxy settings"

Unckeck "used ide proxy settings"

diego matos - keke
  • 1,758
  • 1
  • 16
  • 10