TomEE starts but Netbeans gives “Failed to start”

2020-01-28 08:40发布

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.

6条回答
smile是对你的礼貌
2楼-- · 2020-01-28 09:00

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

查看更多
做个烂人
3楼-- · 2020-01-28 09:05

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" />
查看更多
Viruses.
4楼-- · 2020-01-28 09:08

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.

查看更多
Root(大扎)
5楼-- · 2020-01-28 09:08

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"

查看更多
爷的心禁止访问
6楼-- · 2020-01-28 09:21

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

查看更多
等我变得足够好
7楼-- · 2020-01-28 09:22

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.

查看更多
登录 后发表回答