programing

Netbeans에서 Tomcat 시작 실패

nasanasas 2020. 12. 26. 15:31
반응형

Netbeans에서 Tomcat 시작 실패


Netbeans IDE 7.4에서 Apache Tomcat 6을 시작하는 데 문제가 있습니다 (7.3 버전에서는 동일한 문제가 발생했습니다. 다른 사람들은이 문제가 8.0 등과 같은 다른 버전에서도 존재한다고 언급했습니다).

내가 뭘 한거지:

  • 설치된 Tomcat 7 제거 (제거하지 않고 동일한 어려움이 있음)
  • Apache Tomcat 웹 사이트에서 다운로드 한 새 서버 추가 (버전 apache-tomcat-6.0.39, 다른 버전과 동일한 문제가 있음)
  • 내 서버 위치 : D : \ apache-tomcat-netbeans
  • 시스템 변수 CATALINA_HOME : D : \ apache-tomcat-netbeans
  • 시스템 변수 JAVA HOME : C : \ Program Files \ Java \ jdk1.7.0_51 \
  • tomcat 사용자 : 나는 netbeans가 tomcat이라는 암호를 가진 tomcat이라는 새로운 사용자를 만들도록했습니다. 서버를 추가 한 후 {tomcat} \ conf \ tomcat-users.xml 파일을 열면 내 사용자에 대한 정보가 있습니다.

    <user password = "tomcat"roles = "manager, admin"username = "tomcat"/>

이제 "시작"을 클릭하면 " Tomcat 시작 실패 "가 표시됩니다.

내 의심 :

  • 저는 Windows 7에서 관리자로 작업 중이므로 파일 권한 문제가 아니라고 생각합니다.
  • 프록시를 비활성화해도 도움이되지 않았습니다.
  • 로그 : 생성 된 로그 파일은 localhost.2014-03-06.log이며 완전히 비어 있습니다.
  • Netbeans를 "관리자 권한"으로 시작하는 것은 도움이되지 않았습니다.
  • 명령 줄에서 모든 것이 정상이며 일반 또는 디버그 모드 ( catalina.bat jpda start 또는 startup.bat ) 에서 시작하는 데 문제가 없습니다.

최소 NetBeans 버전 7.4 ~ 8.0.2에 영향을줍니다. 버전 8.0에서 처음보고되었으며 NetBeans 8.1에서 수정되었습니다. 모든 tomcat 버전에 문제가 있었을 것입니다 (버전 7.0.56에서 8.0.28까지 확인 됨).

세부 사항은 Netbeans 버그 # 248182 로 설명됩니다 .

이 문제는 다음 오류 출력을 언급하는 게시물과도 관련이 있습니다.

'127.0.0.1 *'은 내부 또는 외부 명령, 작동 가능한 프로그램 또는 배치 파일로 인식되지 않습니다.

zip 파일에서 설치된 바람둥이의 경우 catalina.bat바람둥이 bin디렉토리 파일 을 변경하여 수정했습니다 .

catalina.bat파일 에서 다음 구성을 찾으십시오 .

:noJuliConfig
set "JAVA_OPTS=%JAVA_OPTS% %LOGGING_CONFIG%"

:noJuliManager
set "JAVA_OPTS=%JAVA_OPTS% %LOGGING_MANAGER%"

그리고 큰 따옴표제거하여 아래와 같이 변경하십시오 .

:noJuliConfig
set JAVA_OPTS=%JAVA_OPTS% %LOGGING_CONFIG%

:noJuliManager
set JAVA_OPTS=%JAVA_OPTS% %LOGGING_MANAGER%

이제 변경 사항을 저장하고 NetBeans 내에서 바람둥이를 시작하십시오.


이것은 다음에 영향을 미칩니다.

  • 8.5.3부터 시작하는 모든 Tomcat 버전.
  • 8.1까지 모든 버전의 Netbeans (Netbeans 8.2에서 수정 됨).

이는 Netbeans가 Tomcat이 시작되었음을 '보지'못하기 때문입니다.

NetBeans에 버그 # 262749를 제출했습니다 .

해결 방법

에서 server.xml파일의에서 ConnectorHTTP / 1.1에 대 한 요소, 다음과 같은 속성을 추가합니다 server="Apache-Coyote/1.1".

예:

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

원인

그 이유는 8.5.3 이전에는 기본값이 서버 헤더를로 설정하는 Apache-Coyote/1.1것이었지만 8.5.3 이후이 기본값은 이제 공백으로 변경 되었기 때문입니다. 분명히 Netbeans는이 헤더를 확인합니다.

아마도 미래에 우리는이 문제를 해결하는 netbeans의 수정을 기대할 수 있습니다.

문서 변경을 추적 할 수있었습니다.

Tomcat 8.5 :

"Overrides the Server header for the http response. If set, the value for this attribute overrides any Server header set by a web application. If not set, any value specified by the application is used. If the application does not specify a value then no Server header is set."

Tomcat 8.0:

"Overrides the Server header for the http response. If set, the value for this attribute overrides the Tomcat default and any Server header set by a web application. If not set, any value specified by the application is used. If the application does not specify a value then Apache-Coyote/1.1 is used. Unless you are paranoid, you won't need this feature."

That explains the need for explicitly adding the server attribute since version 8.5.3.


Also, it is very likely, that problem with proxy settings.

Any who didn't overcome Tomact starting problrem, - try in NetBeans choose No Proxy in the Tools -> Options -> General tab.

It helped me.


For NetBeans to be able to interact with tomcat, it needs the user as setup in netbeans to be properly configured in the tomcat-users.xml file. NetBeans can do so automatically.

That is, within the tomcat-users.xml, which you can find in ${CATALINA_HOME}/conf, or ${CATALINA_BASE}/conf,

  1. make sure that the user (as chosen in netbeans) is added the script-manager role

Example, change

<user password="tomcat" roles="manager,admin" username="tomcat"/>

To

<user password="tomcat" roles="manager-script,manager,admin" username="tomcat"/>
  1. make sure that the manager-script role is declared

Add

<role rolename="manager-script"/>

Actually the netbeans online-help incorrectly states:

Username - Specifies the user name that the IDE uses to log into the server's manager application. The user must be associated with the manager role. The first time the IDE started the Tomcat Web Server, such as through the Start/Stop menu action or by executing a web component from the IDE, the IDE adds an admin user with a randomly-generated password to the tomcat-base-path/conf/tomcat-users.xml file. (Right-click the Tomcat Web server instance node in the Services window and select Properties. In the Properties dialog box, the Base Directory property points to the base-dir directory.) The admin user entry in the tomcat-users.xml file looks similar to the following: <user username="idea" password="woiehh" roles="manager"/>

The role should be manager-script, and not manager.

For a more complete tomcat-users.xml file:

<?xml version='1.0' encoding='utf-8'?>
<tomcat-users>
  <role rolename="manager-script"/>
  <role rolename="manager-gui"/>
  <user password="tomcat" roles="manager-script" username="tomcat"/>
  <user password="pass" roles="manager-gui" username="me"/>
</tomcat-users>

There is another nice posting on why am I getting the deployment error?


I had the same problem but none of the answers above worked. The solution for me was to restore the Manager web application that is bundled with Tomcat.

ReferenceURL : https://stackoverflow.com/questions/22225764/starting-of-tomcat-failed-from-netbeans

반응형