NutzCN Logo
问答 linux下生成缩略图报错
发布于 2090天前 作者 wsljsj 1477 次浏览 复制 上一个帖子 下一个帖子
标签:

上传图片和生成缩略图,在本地没有问题,部署到linux下报错,能上传无法生成缩略图:
系统异常,错误信息:javax.imageio.ImageIO (initialization failure)
java.lang.NoClassDefFoundError: javax.imageio.ImageIO (initialization failure)
at java.lang.J9VMInternals.initializationAlreadyFailed(J9VMInternals.java:87)
at org.cox.img.Images.read(Images.java:517)
at org.cox.img.Images.clipScale(Images.java:346)
at com.skynet.hjgl.hkdj.v1.web.HkdjController.uploadAvatar(HkdjController.java:761)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:95)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
at java.lang.reflect.Method.invoke(Method.java:507)
at org.cox.mvc.impl.processor.MethodInvokeProcessor.process(MethodInvokeProcessor.java:27)
at org.cox.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:55)
at org.cox.mvc.impl.processor.AdaptorProcessor.process(AdaptorProcessor.java:34)
at org.cox.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:55)
at org.cox.mvc.impl.processor.ActionFiltersProcessor.process(ActionFiltersProcessor.java:49)
at org.cox.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:55)
at org.cox.integration.shiro.NutShiroProcessor.process(NutShiroProcessor.java:52)
at org.cox.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:55)
at org.cox.mvc.impl.processor.ModuleProcessor.process(ModuleProcessor.java:117)
at org.cox.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:55)
at org.cox.mvc.impl.processor.EncodingProcessor.process(EncodingProcessor.java:31)
at org.cox.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:55)
at org.cox.mvc.impl.processor.UpdateRequestAttributesProcessor.process(UpdateRequestAttributesProcessor.java:18)
at org.cox.mvc.impl.NutActionChain.doChain(NutActionChain.java:49)
at org.cox.mvc.impl.ActionInvoker.invoke(ActionInvoker.java:74)
at org.cox.mvc.ActionHandler.handle(ActionHandler.java:36)
at org.cox.mvc.NutFilter.doFilter(NutFilter.java:216)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at com.alibaba.druid.support.http.WebStatFilter.doFilter(WebStatFilter.java:123)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)
at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365)
at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)
at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)
at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383)
at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362)
at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:522)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1095)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:672)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1502)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1458)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1143)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:618)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:785)
Caused by: java.lang.UnsatisfiedLinkError: /opt/ibm-java-ppc64le-80/jre/lib/ppc64le/libawt_xawt.so (libXrender.so.1: cannot open shared object file: No such file or directory)
at java.lang.ClassLoader.loadLibraryWithPath(ClassLoader.java:1279)
at java.lang.System.load(System.java:527)
at java.lang.ClassLoader.loadLibraryWithPath(Native Method)
at java.lang.ClassLoader.loadLibraryWithPath(ClassLoader.java:1271)
at java.lang.ClassLoader.loadLibraryWithClassLoader(ClassLoader.java:1245)
at java.lang.System.loadLibrary(System.java:540)
at java.awt.Toolkit$3.run(Toolkit.java:1647)
at java.awt.Toolkit$3.run(Toolkit.java:1645)
at java.security.AccessController.doPrivileged(AccessController.java:503)
at java.awt.Toolkit.loadLibraries(Toolkit.java:1644)
at java.awt.Toolkit.(Toolkit.java:1679)
at sun.awt.AppContext$2.run(AppContext.java:289)
at sun.awt.AppContext$2.run(AppContext.java:278)
at java.security.AccessController.doPrivileged(AccessController.java:503)
at sun.awt.AppContext.initMainAppContext(AppContext.java:278)
at sun.awt.AppContext.access$400(AppContext.java:147)
at sun.awt.AppContext$3.run(AppContext.java:333)
at sun.awt.AppContext$3.run(AppContext.java:316)
at java.security.AccessController.doPrivileged(AccessController.java:503)
at sun.awt.AppContext.getAppContext(AppContext.java:315)
at javax.imageio.spi.IIORegistry.getDefaultInstance(IIORegistry.java:165)
at javax.imageio.ImageIO.(ImageIO.java:77)
at org.cox.img.Images.read(Images.java:517)
at org.cox.img.Images.clipScale(Images.java:346)
at com.skynet.hjgl.hkdj.v1.web.HkdjController.uploadAvatar(HkdjController.java:752)
... 51 more

File targetFile = new File(physicalPath);	
Files.copyFile(upfile, targetFile);
File targetThumbFile = new File(physiclThumbPath); 
Images.clipScale(upfile, targetThumbFile, 198, 280);
1 回复

加启动参数

-Djava.awt.headless=true

来自炫酷的 NutzCN

添加回复
请先登陆
回到顶部