zoukankan      html  css  js  c++  java
  • tomcat 启动服务器日志小结

    1、tomcat 启动服务配置:

        目前主要有  ①把编译好war或者项目直接扔到webapps 目录下, 启动bin目录下的startup.bat 即可   ②  在conf目录下

      修改  server.xml的<Host></Host>中添加一行<Context />,启动bin目录下的startup.bat 即可,其实eclipse->add添加项目工程后,也是自动添加了这行数据:

      <Context docBase="Chart" path="/Chart" reloadable="true" source="org.eclipse.jst.jee.server:Chart"/>  

       ③  可以删除server.xml的那个<Context ...>的内容,在conf->cataline->lacalhost  目录下添加一个   .xml的文件,启动bin目录下的startup.bat 即可,里面的内容就是一行

        <Context path="/启动项目名" docBase="E:/项目地址" reloadable="true"/> ,与server.xml一致,这里说明一下,tomcat会先找server.xml的context,其次才找lacalhost目录下面的<Context />内容,这就是我要求先删除server.xml里面的context的原因

          

    可能会用的或者修改问题:

    1、启动需要修改tamcat 端口: 只需要在server.xml 修改 port参数就好了

        <Connector connectionTimeout="20000" port="81" protocol="HTTP/1.1" redirectPort="8443"/>

    ---------------------------------------------------------------------------------------------------------

    2、启动tomcat报错:Error parsing HTTP request header  

    Note: further occurrences of HTTP header parsing errors will be logged at DEBUG level.  
    
    java.lang.IllegalArgumentException: Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC 3986……

       原因分析:Tomcat在 7.0.73, 8.0.39, 8.5.7 版本后,添加了对于http头的验证,具体来说,就是添加了些规则去限制HTTP头的规范性 

       解决方法:在tomcat目录下:conf/catalina.properties 中添加   tomcat.util.http.parser.HttpParser.requestTargetAllow=|{}  即可解决问题

    ----------------------------------------------------------------------------------------------------

     3、启动tomcat报错: 

    • OutOfMemoryError: Java heap space
    • OutOfMemoryError: PermGen space
    • OutOfMemoryError: unable to create new native thread.

        原因分析: 内存溢出

        解决方法:

    Linux服务器:

    在/usr/local/apache-tomcat-5.5.23/bin 目录下的catalina.sh

    添加:JAVA_OPTS='-Xms512m -Xmx1024m'

            或者 JAVA_OPTS="-server -Xms800m -Xmx800m -XX:MaxNewSize=256m"

            或者 CATALINA_OPTS="-server -Xms256m -Xmx300m"

    Windows服务器:

    在catalina.bat最前面加入

    set JAVA_OPTS=-Xms128m -Xmx350m

    或者set CATALINA_OPTS=-Xmx300M -Xms256M

    ------------------------------------------------------------------------------------------------------------

    4.Post请求体过大 ,设置tomcat   server.xml中属性   maxPostSize="5120000" 

    <Connector executor="tomcatThreadPool"
    port="8080" protocol="HTTP/1.1"
    connectionTimeout="20000"
    redirectPort="8443" maxPostSize="5120000" />

    -----------------------------------------------------------------------------------------------------------

    5.导入git 项目报错:An internal error occurred during: "Computing Git status for repository ...”
    linux:

         rm -r .metadata/.plugins/org.eclipse.core.resources/.projects/*/org.eclipse.egit.core

      rm -r .metadata/.plugins/org.eclipse.core.resources/.projects/*/.indexes/properties.index

    windows:

    可以直接到eclipse的workspace目录下,找到上面的目录,剪切
    org.eclipse.egit.core和properties.index到其他目录

    然后重启eclipse, process视图中,不再显示“Computing Git Status for reposritory Application”

    上述操作会导致项目与Git断开,在项目上右键->team,不显示commit等git操作选项。

    解决方法: Eclipse->Project Explorer->项目->team->Share Project,自动识别出git中关联的项目

    ----------------------------------------------------------------------------------------------------------

    属作者原创,如有转载,请表明出处:https://www.cnblogs.com/mobeisanghai/p/10755625.html

      

  • 相关阅读:
    SAP MM 采购发票上的金额小差异
    SAP MM 物料号到物料的库存转移过账里的差异
    SAP MM 采购附加费在收货以及发票过账时候的会计分录
    SAP MM 移动平均价的商品发票价格和采购订单价格差异的处理
    WPF 使用 VisualBrush 在 4k 加 200 DPI 设备上某些文本不渲染看不见问题
    dotnet 写一个支持层层继承属性的对象
    dotnet OpenXML 读取 PPT 内嵌 xlsx 格式 Excel 表格的信息
    WPF 在 .NET Core 3.1.19 版本 触摸笔迹偏移问题
    linux下将编译错误输出到一个文本文件
    浮点型(FLOAT)与CHAR型转换
  • 原文地址:https://www.cnblogs.com/mobeisanghai/p/10755625.html
Copyright © 2011-2022 走看看