HTTP Status 500 – Internal Server Error Type Exception Report Message Handler processing failed; nested exception is java.lang.NoClassDefFoundError: Could not initialize class sun.font.FontScaler Description The server encountered an unexpected condition that prevented it from fulfilling the request. Exception org.springframework.web.util.NestedServletException: Handler processing failed; nested exception is java.lang.NoClassDefFoundError: Could not initialize class sun.font.FontScaler org.springframework.web.servlet.DispatcherServlet.triggerAfterCompletionWithError(DispatcherServlet.java:1280) org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:958) org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:870) org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:961) org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:852) javax.servlet.http.HttpServlet.service(HttpServlet.java:635) org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837) javax.servlet.http.HttpServlet.service(HttpServlet.java:742) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) com.lion.frame.filter.CrossOriginFilter.doFilter(CrossOriginFilter.java:32) Root Cause java.lang.NoClassDefFoundError: Could not initialize class sun.font.FontScaler sun.font.Type1Font.getScaler(Type1Font.java:638) sun.font.Type1Font.getMissingGlyphCode(Type1Font.java:662) sun.font.CompositeGlyphMapper.initMapper(CompositeGlyphMapper.java:81) sun.font.CompositeGlyphMapper.<init>(CompositeGlyphMapper.java:62) sun.font.CompositeFont.getMapper(CompositeFont.java:433) sun.font.GlyphList.mapChars(GlyphList.java:269) sun.font.GlyphList.setFromChars(GlyphList.java:262) sun.java2d.pipe.GlyphListPipe.drawChars(GlyphListPipe.java:103) sun.java2d.pipe.ValidatePipe.drawChars(ValidatePipe.java:178) sun.java2d.SunGraphics2D.drawChars(SunGraphics2D.java:3036) com.lion.common.utils.VerifyCodeUtils.outputImage(VerifyCodeUtils.java:199) com.lion.common.utils.VerifyCodeUtils.generateBase64Image(VerifyCodeUtils.java:67) com.lion.sp.service.UserService.getLoginCode(UserService.java:1381) com.lion.sp.service.UserService$$FastClassBySpringCGLIB$$f9701ca5.invoke(<generated>) org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:708) org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:98) org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:262) org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:95) org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:644) com.lion.sp.service.UserService$$EnhancerBySpringCGLIB$$ba8e046a.getLoginCode(<generated>) com.lion.sp.controller.UserController.getLoginCode(UserController.java:911) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) java.lang.reflect.Method.invoke(Method.java:498) org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221) org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:137) org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104) org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:747) org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:676) org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85) org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:938) org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:870) org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:961) org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:852) javax.servlet.http.HttpServlet.service(HttpServlet.java:635) org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837) javax.servlet.http.HttpServlet.service(HttpServlet.java:742) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) com.lion.frame.filter.CrossOriginFilter.doFilter(CrossOriginFilter.java:32)
以上报错问题是因为JDK原因造成以上报错,需要重新导入JDK下的font可解决,也可以重新安装。