javax.imageio.ImageIO

时间:2016-07-21 07:59:16

标签: java javax.imageio

尝试执行java.lang.ExceptionInInitializerError时,我有一个BufferedImage originalImage = ImageIO.read(in);。这只发生在生产VM上,而不是我的开发机器上。

我在生产VM上创建了一个带有上述行的小类,并成功编译并执行了它。然后我尝试按建议here添加java选项"-Djava.awt.headless=true -Dawt.toolkit=sun.awt.HToolkit"。没有帮助。然后我尝试按照建议here添加static {ImageIO.scanForPlugins();}。也没有帮助。我跑jHades试图查看罐子里是否有重叠的类。没有了。

现在我没有想法。 dev机器在Ubuntu 14.04上运行java 1.8.0_76-release-b198,生产VM在CentOS上运行java 1.8.0_60-b27。有什么指针吗?

更新:完整堆栈跟踪:

java.lang.ExceptionInInitializerError
    at com.comp.core.model.artifactThumbnails.ArtifactThumbnailRepository.generateThumbnail(ArtifactThumbnailRepository.java:63)
    at com.comp.core.model.artifactThumbnails.BigTableArtifactThumbnailRepository.createThumbnail(BigTableArtifactThumbnailRepository.java:71)
    at com.comp.web.routes.vertex.VertexThumbnail.handle(VertexThumbnail.java:90)
    at com.comp.miniweb.HandlerChain.next(HandlerChain.java:18)
    at com.comp.web.privilegeFilters.PrivilegeFilter.handle(PrivilegeFilter.java:35)
    at com.comp.miniweb.HandlerChain.next(HandlerChain.java:18)
    at com.comp.miniweb.handlers.CSRFHandler.handle(CSRFHandler.java:66)
    at com.comp.miniweb.HandlerChain.next(HandlerChain.java:18)
    at com.comp.web.AuthenticationHandler.handle(AuthenticationHandler.java:17)
    at com.comp.miniweb.HandlerChain.next(HandlerChain.java:18)
    at com.comp.miniweb.Router.dispatch(Router.java:93)
    at com.comp.miniweb.Router.routeWithExceptionHandling(Router.java:87)
    at com.comp.miniweb.Router.route(Router.java:44)
    at com.comp.miniweb.App.handle(App.java:128)
    at com.comp.web.WebApp.handle(WebApp.java:71)
    at com.comp.web.Router.service(Router.java:186)
    at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:800)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669)
    at com.comp.web.RequestDebugFilter.doFilter(RequestDebugFilter.java:33)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
    at org.eclipse.jetty.websocket.server.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:224)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
    at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577)
    at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)
    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
    at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
    at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:215)
    at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:110)
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
    at org.eclipse.jetty.server.Server.handle(Server.java:497)
    at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:310)
    at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:245)
    at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)
    at java.lang.Thread.run(Thread.java:745)
Caused by: 
java.lang.SecurityException: sealing violation: package com.sun.media.imageioimpl.plugins.jpeg is sealed
    at java.net.URLClassLoader.getAndVerifyPackage(URLClassLoader.java:399)
    at java.net.URLClassLoader.definePackageInternal(URLClassLoader.java:419)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:451)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
    at org.eclipse.jetty.webapp.WebAppClassLoader.findClass(WebAppClassLoader.java:510)
    at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:441)
    at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:403)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:348)
    at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:370)
    at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404)
    at java.util.ServiceLoader$1.next(ServiceLoader.java:480)
    at javax.imageio.spi.IIORegistry.registerApplicationClasspathSpis(IIORegistry.java:210)
    at javax.imageio.spi.IIORegistry.<init>(IIORegistry.java:138)
    at javax.imageio.spi.IIORegistry.getDefaultInstance(IIORegistry.java:159)
    at javax.imageio.ImageIO.<clinit>(ImageIO.java:66)
    at com.comp.core.model.artifactThumbnails.ArtifactThumbnailRepository.generateThumbnail(ArtifactThumbnailRepository.java:63)
    at com.comp.core.model.artifactThumbnails.BigTableArtifactThumbnailRepository.createThumbnail(BigTableArtifactThumbnailRepository.java:71)
    at com.comp.web.routes.vertex.VertexThumbnail.handle(VertexThumbnail.java:90)
    at com.comp.miniweb.HandlerChain.next(HandlerChain.java:18)
    at com.comp.web.privilegeFilters.PrivilegeFilter.handle(PrivilegeFilter.java:35)
    at com.comp.miniweb.HandlerChain.next(HandlerChain.java:18)
    at com.comp.miniweb.handlers.CSRFHandler.handle(CSRFHandler.java:66)
    at com.comp.miniweb.HandlerChain.next(HandlerChain.java:18)
    at com.comp.web.AuthenticationHandler.handle(AuthenticationHandler.java:17)
    at com.comp.miniweb.HandlerChain.next(HandlerChain.java:18)
    at com.comp.miniweb.Router.dispatch(Router.java:93)
    at com.comp.miniweb.Router.routeWithExceptionHandling(Router.java:87)
    at com.comp.miniweb.Router.route(Router.java:44)
    at com.comp.miniweb.App.handle(App.java:128)
    at com.comp.web.WebApp.handle(WebApp.java:71)
    at com.comp.web.Router.service(Router.java:186)
    at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:800)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669)
    at com.comp.web.RequestDebugFilter.doFilter(RequestDebugFilter.java:33)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
    at org.eclipse.jetty.websocket.server.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:224)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
    at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577)
    at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)
    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
    at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
    at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:215)
    at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:110)
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
    at org.eclipse.jetty.server.Server.handle(Server.java:497)
    at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:310)
    at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:245)
    at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)
    at java.lang.Thread.run(Thread.java:745)

0 个答案:

没有答案