2014-01-23 1 views
1

나는 톰캣 자습서 here을 통해 작업과 개미시 the section of installing the hello world war file to the server containerTomcat 튜토리얼 :이 설치가 실패한 이유는 무엇입니까?

특히 나는이 오류 설치하고있다 : 이것은 모두 example web.xml와 톰캣 사이트에서 제공 example build.xml을 사용

BUILD FAILED 
java.io.IOException: Server returned HTTP response code: 401 for URL: http://localhost:8080/manager/text/deploy?path=%2Ftomcat-tutorial&war=file%3A%2F%2F%2Fhome%2Fdavid%2FIdeaProjects%2Ftomcat-tutorial%2Fbuild 
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1626) 
at org.apache.catalina.ant.AbstractCatalinaTask.execute(AbstractCatalinaTask.java:230) 
at org.apache.catalina.ant.DeployTask.execute(DeployTask.java:196) 
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288) 
at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source) 
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
at java.lang.reflect.Method.invoke(Method.java:606) 
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106) 
at org.apache.tools.ant.Task.perform(Task.java:348) 
at org.apache.tools.ant.Target.execute(Target.java:357) 
at org.apache.tools.ant.Target.performTasks(Target.java:385) 
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337) 
at org.apache.tools.ant.Project.executeTarget(Project.java:1306) 
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41) 
at org.apache.tools.ant.Project.executeTargets(Project.java:1189) 
at org.apache.tools.ant.Main.runBuild(Main.java:758) 
at org.apache.tools.ant.Main.startAnt(Main.java:217) 
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257) 
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104) 

. 왜 이것이 실패하고 어떻게 해결할 수 있습니까?

답변

1

HTTP 401은 인증되지 않았습니다. 올바른 자격 증명을 구성/사용하지 않았습니다.

그래서 실패하지는 않습니다. 응용 프로그램을 배포하려는 사후 구축 단계입니다.

어쩌면 당신은 this instruction for ant file 따르지 않았고 :

  • Create a "build.properties" file in your application's top-level source directory (or your user login home directory) that defines appropriate values for the "manager.password", "manager.url", and "manager.username" properties described above.

편집 :

You can find the role names in the web.xml file of the Manager web application. The available roles are:

manager-gui — Access to the HTML interface. 
manager-status — Access to the "Server Status" page only. 
manager-script — Access to the tools-friendly plain text interface that is described in this document, and to the "Server Status" page. 
manager-jmx — Access to JMX proxy interface and to the "Server Status" page. 
+0

가 여기 build.properties의 내용입니다 :'manager.username = 나는 그러나 상태 영역의 어떤 종류를 설정하지 않은 manager.password = manager' 관리자. ( – user3220334

+0

'하나 이상의 Tomcat 사용자 정의 Manager 웹 애플리케이션은 사용자가 로그인해야하는 보안 제한 조건 하에서 실행되고 보안 역할 관리자 스크립트가 할당됩니다. 이러한 사용자는 Tomcat의 conf/server.xml 파일에서 구성한 영역에 따라 정의됩니다. 자세한 내용은 영역 구성 HOW-TO를 참조하십시오. 원하는 사용자 이름과 암호로 원하는 수의 사용자를 정의 할 수 있습니다. 관리자 스크립트 역할 .' – user3220334

+0

tomcat-users.xml에 관리자 사용자 이름과 암호를 추가하고 서버를 다시 시작했지만 효과가 없었습니다. ' – user3220334

0

좋아,이 솔루션은 바람둥이의 역할 "관리 스크립트"를 만드는 것입니다 : This은 도움이 될 수 있습니다 -users.xml. 어느 것이 대단히 불분명 한가? 따라서 실행해야하는 스크립트처럼 들릴 수 있습니다.

실제로 한
<user username="manager" password="manager" roles="manager-script"/> 
관련 문제