Error when I try deploy application to tomcat7 server

后端 未结 11 1531
轻奢々
轻奢々 2020-12-15 05:59

I am trying deploy a web application to tomcat7 via eclipse luna, but I am getting this error:

Uploading: http://localhost:8080/manager/text/deploy?path=%2Fl         


        
相关标签:
11条回答
  • 2020-12-15 06:19

    I've had the same issue and in my case the problem was a cunfigured context path not starting with /. Fixing the context path "myapp" to "/myapp" solved the problem.

    0 讨论(0)
  • 2020-12-15 06:27

    What's the size of your war? maybe it is because the size too large. By default, tomcat manager only allow less then 50MB size war. also try mvn tomcat7:redeploy instead of deploy.

    See here how to increase the war size limit

    0 讨论(0)
  • 2020-12-15 06:27

    I dont know if this helps , But in My case . tomcat7 plugin was picking server details from the maven conf settings.xml instead room .m2\settings.xml . Adding server information in that file Resolved my Issue .

    0 讨论(0)
  • 2020-12-15 06:28

    By default Tomcat has a max upload size of 50MB. (I.e max size of WAR file)

    If you require larger file, try increasing max-file-size and max-request-size within the tomcat web.xml. Note: those values are both stored in bytes.

    Edit .../webapps/manager/WEB-INF/web.xml. (Ensure the file sizes are larger than the war file your trying to upload). I.e if you require 80MB WAR,

      <max-file-size>82914560</max-file-size>
      <max-request-size>82914560</max-request-size>
    

    Then restart apache tomcat.

    https://octopus.com/blog/tomcat-manager-deployment

    0 讨论(0)
  • 2020-12-15 06:29

    Occasionally problems

    If sometimes the redeployment fails, sometimes succeed, a increase of the logging might show a DOS protection.

    Edit the /conf/logging.properties and add the line

    org.apache.catalina.level = FINEST
    

    At the end of the file. Might show this output:

    FINE [http-nio-8080-exec-7] org.apache.catalina.authenticator.AuthenticatorBase.invoke Security checking request PUT /manager/text/deploy
    FINE [http-nio-8080-exec-7] org.apache.catalina.loader.WebappClassLoaderBase.loadClass loadClass(org.apache.catalina.manager.ManagerServlet, false)
    FINE [http-nio-8080-exec-7] org.apache.catalina.loader.WebappClassLoaderBase.loadClass   Delegating to parent classloader1 java.net.URLClassLoader@568db2f2
    FINE [http-nio-8080-exec-7] org.apache.catalina.loader.WebappClassLoaderBase.loadClass   Loading class from parent
    FINE [http-nio-8080-exec-7] org.apache.catalina.realm.RealmBase.findSecurityConstraints   Checking constraint 'SecurityConstraint[Status interface]' against PUT /text/deploy --> false
    FINE [http-nio-8080-exec-7] org.apache.catalina.realm.RealmBase.findSecurityConstraints   Checking constraint 'SecurityConstraint[Text Manager interface (for scripts)]' against PUT /text/deploy --> true
    FINE [http-nio-8080-exec-7] org.apache.catalina.realm.RealmBase.findSecurityConstraints   Checking constraint 'SecurityConstraint[HTML Manager interface (for humans)]' against PUT /text/deploy --> false
    FINE [http-nio-8080-exec-7] org.apache.catalina.realm.RealmBase.findSecurityConstraints   Checking constraint 'SecurityConstraint[JMX Proxy interface]' against PUT /text/deploy --> false
    FINE [http-nio-8080-exec-7] org.apache.catalina.realm.RealmBase.findSecurityConstraints   Checking constraint 'SecurityConstraint[Status interface]' against PUT /text/deploy --> false
    FINE [http-nio-8080-exec-7] org.apache.catalina.realm.RealmBase.findSecurityConstraints   Checking constraint 'SecurityConstraint[Text Manager interface (for scripts)]' against PUT /text/deploy --> true
    FINE [http-nio-8080-exec-7] org.apache.catalina.realm.RealmBase.findSecurityConstraints   Checking constraint 'SecurityConstraint[HTML Manager interface (for humans)]' against PUT /text/deploy --> false
    FINE [http-nio-8080-exec-7] org.apache.catalina.realm.RealmBase.findSecurityConstraints   Checking constraint 'SecurityConstraint[JMX Proxy interface]' against PUT /text/deploy --> false
    FINE [http-nio-8080-exec-7] org.apache.catalina.authenticator.AuthenticatorBase.invoke  Calling hasUserDataPermission()
    FINE [http-nio-8080-exec-7] org.apache.catalina.realm.RealmBase.hasUserDataPermission   User data constraint has no restrictions
    FINE [http-nio-8080-exec-7] org.apache.catalina.authenticator.AuthenticatorBase.invoke  Calling authenticate()
    FINE [http-nio-8080-exec-7] org.apache.catalina.realm.CombinedRealm.authenticate Attempting to authenticate user [admin] with realm [org.apache.catalina.realm.UserDatabaseRealm]
    FINER [http-nio-8080-exec-7] org.apache.catalina.realm.RealmBase.authenticate Username [admin] NOT successfully authenticated
    FINE [http-nio-8080-exec-7] org.apache.catalina.realm.CombinedRealm.authenticate Failed to authenticate user [admin] with realm [org.apache.catalina.realm.UserDatabaseRealm]
    WARNING [http-nio-8080-exec-7] org.apache.catalina.realm.LockOutRealm.filterLockedAccounts 
         An attempt was made to authenticate the locked user [admin]
    FINE [http-nio-8080-exec-7] org.apache.catalina.authenticator.AuthenticatorBase.invoke  Failed authenticate() test
    FINE [http-nio-8080-exec-7] org.apache.catalina.core.StandardHostValve.custom Processing ErrorPage[errorCode=401, location=/WEB-INF/jsp/401.jsp]
    FINER [http-nio-8080-exec-7] org.apache.catalina.core.StandardWrapper.allocate   Returning non-STM instance
    FINE [http-nio-8080-exec-7] org.apache.catalina.core.ApplicationDispatcher.doForward  Disabling the response for further output
    

    (in this logging the user who made the attempt to upload has the username admin)

    As you see in this output the user admin is locked:

    WARNING [http-nio-8080-exec-7] org.apache.catalina.realm.LockOutRealm.filterLockedAccounts 
      An attempt was made to authenticate the locked user [admin]
    

    Look into the documentation and inside the server.xml and you will find a

       <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
               resourceName="UserDatabase"/>
    

    Use unforseeable username

    To remove the line is a bad idea, change the username for redeployment to a different, more unforeseeable name like deploy355547511 to not get locked.

    0 讨论(0)
提交回复
热议问题