zoukankan      html  css  js  c++  java
  • 启动tomcat时报错:http-nio-8080-exec-10

    启动Tomcat后访问  http://192.168.199.10:8080/jpress-web-newest  网页,查看日志有报错

    问题原因:Java的内存溢出

    故障现象为:

     cat /apps/links/tomcat/logs/catalina.out
    2018-11-05 16:08:55 [ERROR]-[Thread: http-nio-8080-exec-10]-[io.jpress.admin.controller._AttachmentController.processImage()]: processThumbnail error
    java.lang.IllegalArgumentException: sourceRegion.x < 0!
            at javax.imageio.IIOParam.setSourceRegion(IIOParam.java:188)
            at io.jpress.utils.ImageUtils.readBuffereImage(ImageUtils.java:112)
            at io.jpress.utils.ImageUtils.scale(ImageUtils.java:83)
            at io.jpress.utils.ImageUtils.scale(ImageUtils.java:61)
            at io.jpress.admin.controller._AttachmentController.processThumbnail(_AttachmentController.java:166)
            at io.jpress.admin.controller._AttachmentController.processImage(_AttachmentController.java:149)
            at io.jpress.admin.controller._AttachmentController.doUpload(_AttachmentController.java:127)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            at java.lang.reflect.Method.invoke(Method.java:498)
            at com.jfinal.aop.Invocation.invoke(Invocation.java:73)
            at io.jpress.core.interceptor.ActionCacheClearInterceptor.intercept(ActionCacheClearInterceptor.java:27)
            at com.jfinal.aop.Invocation.invoke(Invocation.java:67)
            at io.jpress.core.interceptor.HookInterceptor.intercept(HookInterceptor.java:31)
            at com.jfinal.aop.Invocation.invoke(Invocation.java:67)
            at io.jpress.interceptor.AdminInterceptor.intercept(AdminInterceptor.java:52)
            at com.jfinal.aop.Invocation.invoke(Invocation.java:67)
            at io.jpress.interceptor.GlobelInterceptor.intercept(GlobelInterceptor.java:33)
            at com.jfinal.aop.Invocation.invoke(Invocation.java:67)
            at io.jpress.core.interceptor.JI18nInterceptor.intercept(JI18nInterceptor.java:48)
            at com.jfinal.aop.Invocation.invoke(Invocation.java:67)
            at com.jfinal.core.ActionHandler.handle(ActionHandler.java:82)
            at io.jpress.core.MyDruidStatViewHandler.handle(MyDruidStatViewHandler.java:43)
            at io.jpress.core.cache.ActionCacheHandler.handle(ActionCacheHandler.java:40)
            at io.jpress.core.JHandler.handle(JHandler.java:81)
            at io.jpress.core.cache.ActionCacheHandler.handle(ActionCacheHandler.java:40)
            at com.jfinal.core.JFinalFilter.doFilter(JFinalFilter.java:72)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
            at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:493)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
            at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
            at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
            at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:800)
            at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
            at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:806)
    ▽       at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498)
            at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
            at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
            at java.lang.Thread.run(Thread.java:748)
    

    解决方案一:

    设置MyEclipse中Tomcat使用的Jdk的VM arguments:

    -Xms512m -Xmx1024m -XX:MaxNewSize=512m -XX:MaxPermSize=512m

    如图:

    解决方法二:  

    手动设置MaxPermSize大小
    修改TOMCAT_HOME/bin/catalina.bat(Linux下为catalina.sh),在“echo "Using CATALINA_BASE:   $CATALINA_BASE"”上面加入以下行:
    set JAVA_OPTS=%JAVA_OPTS% -server -XX:PermSize=128M -XX:MaxPermSize=512m
    catalina.sh下为:
    JAVA_OPTS="$JAVA_OPTS -server -XX:PermSize=128M -XX:MaxPermSize=512m"

  • 相关阅读:
    一行CSS解决DateChooser 的折行问题
    不再为DataGrid生成的表格的单无格中的内容过长、自动折行、表格撑开等问题而烦恼一个很久以前的做品
    SQL Server中也用格式字符串定制日期转换为字符串
    Cache总义
    Cookie 支持二级域名和FormsAuthentication 加强版
    CommunityServer 2.0 RTM时间是:20060217 Scott Watermasysk今天中午
    不知谁给我留的言,要招DNN 程序员,会这个的朋友可以看看
    "#RRGGBB"与Color类型的转换 补充
    DateChooser源码DateTimeStringEditor.cs
    I had no sooner finished eating than went to toilet.
  • 原文地址:https://www.cnblogs.com/jeson-lbb/p/9909968.html
Copyright © 2011-2022 走看看