我正在尝试使用simplecaptcha-1.2.1.jar。它抛出异常。 rt.jar
有sun.awt.X11GraphicsEnvironment
个班级。
simplecaptcha-1.2.1.jar在Windows平台(Server Weblogic)上工作正常。
java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11GraphicsEnvironment
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:68)
at java.awt.image.BufferedImage.createGraphics(BufferedImage.java:1135)
at nl.captcha.text.renderer.DefaultWordRenderer.render(DefaultWordRenderer.java:53)
at nl.captcha.Captcha$Builder.addText(Captcha.java:136)
at nl.captcha.Captcha$Builder.addText(Captcha.java:121)
at nl.captcha.Captcha$Builder.addText(Captcha.java:111)
at nl.captcha.servlet.SimpleCaptchaServlet.doGet(Unknown Source)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:398)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:277)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:255)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:188)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:586)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:556)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:187)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:586)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:556)
at com.sun.webserver.connector.nsapi.NSAPIProcessor.service(NSAPIProcessor.java:160)
其他细节:
答案 0 :(得分:0)
尝试添加java参数-DJava.awt.headless=true