TomEE starts but Netbeans gives "Failed to start" error
Asked Answered
O

6

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.

Ouachita answered 4/6, 2015 at 14:50 Comment(1)
The answer provided solves correctly. This issue is similar as described here: https://mcmap.net/q/160158/-starting-of-tomcat-failed-from-netbeans - that answer will describe exactly which versions of netbeans would be affected.Virgiliovirgin
E
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" />
Estevan answered 5/6, 2015 at 15:51 Comment(7)
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.Ouachita
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 :-)Scheming
lol, it works! would like the author to elaborate a bit more on the solution, too.Silverman
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..Ammons
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 workInnumerable
Great. Thanks. This did it after spending 2 hours to find the solution.Exarch
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?Wendywendye
S
17

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

Shroyer answered 11/6, 2015 at 18:9 Comment(3)
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.Ouachita
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.Scheming
This worked in my case too. Netbeans 8.0.2, Tomcat 7Bethea
E
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

Elnoraelnore answered 29/10, 2016 at 13:29 Comment(1)
Superb guy. Worked. This shoule be the accepted answer.Humming
B
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.

Boxcar answered 5/3, 2017 at 11:16 Comment(1)
It is strange how this is the exact opposite of the marked answer yet it solved my problem. In any case, thank you.Subsumption
S
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.

Scheming answered 20/6, 2015 at 20:9 Comment(1)
Have the same issue, but none of the mentioned solutions worked :/ If it makes any diff, I am in OS XInnumerable
R
3

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"

Rosetterosewall answered 26/1, 2016 at 14:44 Comment(1)
For me, This solution was effective for tomcat 7,8Enterpriser

© 2022 - 2024 — McMap. All rights reserved.