Xshell6发布脚本sun.awt.X11GraphicsEnvironment问题

{"code":"10014","msg":"发生未捕获的异常: org.springframework.web.util.NestedServletException: Handler dispatch failed; 

nested exception is java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11GraphicsEnvironment\n\tat 
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:978)\n\tat 
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:897)\n\tat 
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)\n\tat 
org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872)\n\tat 
javax.servlet.http.HttpServlet.service(HttpServlet.java:648)\n\tat 
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)\n\tat 
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)\n\tat 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291)\n\tat 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)\n\tat 
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)\n\tat 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)\n\tat 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)\n\tat 
org.springframework.web.filter.AbstractRequestLoggingFilter.doFilterInternal(AbstractRequestLoggingFilter.java:244)\n\tat 
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)\n\tat 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)\n\tat 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)\n\tat 
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)\n\tat 
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)\n\tat 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)\n\tat 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)\n\tat 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)\n\tat 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)\n\tat 
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)\n\tat 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)\n\tat 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)\n\tat 
org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616)\n\tat 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)\n\tat 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:521)\n\tat 
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1096)\n\tat 
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:674)\n\tat 
org.apache.tomcat.util.net.Nio2Endpoint$SocketProcessor.doRun(Nio2Endpoint.java:1074)\n\tat 
org.apache.tomcat.util.net.Nio2Endpoint$SocketProcessor.run(Nio2Endpoint.java:1033)\n\tat 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)\n\tat 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)\n\tat 
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)\n\tat java.lang.Thread.run(Thread.java:745)\nCaused by: java.lang.NoClassDefFoundError: Could not initialize class 
sun.awt.X11GraphicsEnvironment\n\tat java.lang.Class.forName0(Native Method)\n\tat java.lang.Class.forName(Class.java:264)\n\tat 
java.awt.GraphicsEnvironment.createGE(GraphicsEnvironment.java:103)\n\tat 
java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:82)\n\tat 
java.awt.image.BufferedImage.createGraphics(BufferedImage.java:1181)\n\tat 
java.awt.image.BufferedImage.getGraphics(BufferedImage.java:1170)\n\tat com.aspose.cells.b.a.b.zi.a(Unknown Source)\n\tat 
com.aspose.cells.a.d.zfw.A(Unknown Source)\n\tat 
com.aspose.cells.a.d.zfw.a(Unknown Source)\n\tat 
com.aspose.cells.a.d.zfw.(Unknown Source)\n\tat 
com.aspose.cells.a.d.zfy.k(Unknown Source)\n\tat 
com.aspose.cells.a.d.zfy.q(Unknown Source)\n\tat 
com.aspose.cells.a.d.zfy.r(Unknown Source)\n\tat 
com.aspose.cells.a.d.zfy.b(Unknown Source)\n\tat 
com.aspose.cells.a.c.zn.a(Unknown Source)\n\tat 
com.aspose.cells.zbqh.a(Unknown Source)\n\tat 
com.aspose.cells.WorksheetCollection.K(Unknown Source)\n\tat 
com.aspose.cells.WorksheetCollection.(Unknown Source)\n\tat 
com.aspose.cells.Workbook.a(Unknown Source)\n\tat 
com.aspose.cells.Workbook.(Unknown Source)\n\tat 
com.meallink.web.transfer.ExcelHelper.getWorkbook(ExcelHelper.java:187)\n\tat 
com.meallink.web.transfer.ExcelHelper.getDataTable(ExcelHelper.java:150)\n\tat 

com.meallink.web.action2.priceManage.PriceInfoAction.importPrice(PriceInfoAction.java:362)\n\tat 
com.meallink.web.action2.priceManage.PriceInfoAction$$FastClassBySpringCGLIB$$eed062fd.invoke()\n\tat 
org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)\n\tat 
org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:721)\n\tat 
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)\n\tat 
org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:85)\n\tat 
com.meallink.core.comm.TimeOutLogAspectJ.myAroundAdvice(TimeOutLogAspectJ.java:160)\n\tat 
sun.reflect.GeneratedMethodAccessor199.invoke(Unknown Source)\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n\tat 
java.lang.reflect.Method.invoke(Method.java:497)\n\tat 
org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:629)\n\tat 
org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:618)\n\tat 
org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:70)\n\tat 
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)\n\tat 
org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)\n\tat 
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)\n\tat 
org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:656)\n\tat 
com.meallink.web.action2.priceManage.PriceInfoAction$$EnhancerBySpringCGLIB$$19080e8.importPrice()\n\tat 
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n\tat 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\n\tat 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n\tat 
java.lang.reflect.Method.invoke(Method.java:497)\n\tat org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205)\n\tat 
org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:133)\n\tat 
org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:116)\n\tat 
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827)\n\tat 
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738)\n\tat 
org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85
)\n\tat 
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:963)\n\t... 35 more\n"}

最近在做PDF的打印和Excel的导出的时候,使用Xshell6发布,意外的发现脚本跑完,所有的PDF打印和导入导出都失效了,包括之前可以用没修改过的地方也失效了,,这个问题很奇妙,每次启动报错的方式都不一样,要么Nginx找不到地址,要么是找不到字体,研究了一上午,发现一个比较规律的问题,就是 sun.awt.X11GraphicsEnvironment 这个字眼 出现的比较多.在Xshell6发布后 有时候会弹出来一个对应的提示,也是X11...相关的.想着会不会是Xshell6的问题,让同事执行了一下脚本,他用的是Xshell5,发布第一次,成功,发布第二次,也遇到同样的问题,项目无法启动.

后来改用别的linux链接工具 这里使用的是putty_V0.63.0.0 一个比较经典的工具,每次都可以发布成功,故确认是Xshell的问题.这个问题个人感觉比较隐蔽,记录一下

你可能感兴趣的:(Xshell6发布脚本sun.awt.X11GraphicsEnvironment问题)