Caused by: com.octo.captcha.CaptchaException: word is too tall:

com.octo.captcha.CaptchaException: word is too tall: try to use less letters, smaller font or bigger background:  text bounds = {text=294

    java.awt.geom.Rectangle2D$Float[x=0.0,y=-25.134277,w=12.5,h=36.157227] ascent=25.134277 descent=7.507324 leading=3.515625 

    java.awt.geom.Rectangle2D$Float[x=32.5,y=-22.680664,w=16.381836,h=28.125] ascent=22.680664 descent=5.444336 leading=-0.0 

    java.awt.geom.Rectangle2D$Float[x=68.881836,y=-22.680664,w=16.381836,h=28.125] ascent=22.680664 descent=5.444336 leading=-0.0 

    } with fonts {java.awt.Font[family=Trebuchet MS,name=Trebuchet MS Italic,style=bold,size=25]

    java.awt.Font[family=Monospaced,name=Monospaced.bolditalic,style=italic,size=25]

    java.awt.Font[family=Andale Mono,name=Andale Mono,style=bolditalic,size=25]

    } versus image width = 100, height = 40

    at com.octo.captcha.image.gimpy.GimpyFactory.getImageCaptcha(GimpyFactory.java:79)

    at com.octo.captcha.engine.image.ListImageCaptchaEngine.getNextImageCaptcha(ListImageCaptchaEngine.java:128)

    at com.octo.captcha.engine.image.ImageCaptchaEngine.getNextCaptcha(ImageCaptchaEngine.java:52)

    at com.octo.captcha.service.AbstractCaptchaService.generateAndStoreCaptcha(AbstractCaptchaService.java:148)

    at com.octo.captcha.service.AbstractManageableCaptchaService.generateCountTimeStampAndStoreCaptcha(AbstractManageableCaptchaService.java:340)

    at com.octo.captcha.service.AbstractManageableCaptchaService.generateAndStoreCaptcha(AbstractManageableCaptchaService.java:329)

    at com.octo.captcha.service.AbstractCaptchaService.getChallengeForID(AbstractCaptchaService.java:64)

    at com.octo.captcha.service.image.AbstractManageableImageCaptchaService.getImageChallengeForID(AbstractManageableImageCaptchaService.java:62)

    at com.fcms.common.checkcode.ImageCaptchaServlet.doGet(ImageCaptchaServlet.java:44)

    at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)

    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)

    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)

    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)

    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)

    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)

    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)

    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)

    at java.lang.Thread.run(Thread.java:619)

Caused by: com.octo.captcha.CaptchaException: word is too tall: try to use less letters, smaller font or bigger background:  text bounds = {text=294

    java.awt.geom.Rectangle2D$Float[x=0.0,y=-25.134277,w=12.5,h=36.157227] ascent=25.134277 descent=7.507324 leading=3.515625 

    java.awt.geom.Rectangle2D$Float[x=32.5,y=-22.680664,w=16.381836,h=28.125] ascent=22.680664 descent=5.444336 leading=-0.0 

    java.awt.geom.Rectangle2D$Float[x=68.881836,y=-22.680664,w=16.381836,h=28.125] ascent=22.680664 descent=5.444336 leading=-0.0 

    } with fonts {java.awt.Font[family=Trebuchet MS,name=Trebuchet MS Italic,style=bold,size=25]

    java.awt.Font[family=Monospaced,name=Monospaced.bolditalic,style=italic,size=25]

    java.awt.Font[family=Andale Mono,name=Andale Mono,style=bolditalic,size=25]

    } versus image width = 100, height = 40

    at com.octo.captcha.component.image.textpaster.ChangeableAttributedString.moveToRandomSpot(ChangeableAttributedString.java:184)

    at com.octo.captcha.component.image.textpaster.ChangeableAttributedString.moveToRandomSpot(ChangeableAttributedString.java:111)

    at com.octo.captcha.component.image.textpaster.DecoratedRandomTextPaster.pasteText(DecoratedRandomTextPaster.java:82)

    at com.octo.captcha.component.image.wordtoimage.ComposedWordToImage.pasteText(ComposedWordToImage.java:130)

    at com.octo.captcha.component.image.wordtoimage.AbstractWordToImage.getImage(AbstractWordToImage.java:52)

    at com.octo.captcha.image.gimpy.GimpyFactory.getImageCaptcha(GimpyFactory.java:77)

    ... 22 more

2013-4-22 17:13:00 org.apache.catalina.core.StandardWrapperValve invoke

严重: Servlet.service() for servlet jcaptcha threw exception

com.octo.captcha.CaptchaException: word is too tall: try to use less letters, smaller font or bigger background:  text bounds = {text=1833

    java.awt.geom.Rectangle2D$Float[x=0.0,y=-25.134277,w=15.002441,h=36.157227] ascent=25.134277 descent=7.507324 leading=3.515625 

    java.awt.geom.Rectangle2D$Float[x=35.00244,y=-26.97754,w=14.404297,h=33.251953] ascent=26.97754 descent=6.274414 leading=-0.0 

    java.awt.geom.Rectangle2D$Float[x=69.40674,y=-23.205566,w=15.05127,h=29.101562] ascent=23.205566 descent=5.895996 leading=-0.0 

    java.awt.geom.Rectangle2D$Float[x=104.45801,y=-23.205566,w=15.05127,h=29.101562] ascent=23.205566 descent=5.895996 leading=-0.0 

    } with fonts {java.awt.Font[family=Lucida Bright,name=Lucida Bright Demibold Italic,style=italic,size=25]

    java.awt.Font[family=DialogInput,name=DialogInput.italic,style=bold,size=25]

    java.awt.Font[family=Segoe UI,name=Segoe UI,style=bolditalic,size=25]

    java.awt.Font[family=Bitstream Vera Sans Mono,name=Bitstream Vera Sans Mono,style=bolditalic,size=25]

    } versus image width = 100, height = 40

    at com.octo.captcha.image.gimpy.GimpyFactory.getImageCaptcha(GimpyFactory.java:79)

    at com.octo.captcha.engine.image.ListImageCaptchaEngine.getNextImageCaptcha(ListImageCaptchaEngine.java:128)

    at com.octo.captcha.engine.image.ImageCaptchaEngine.getNextCaptcha(ImageCaptchaEngine.java:52)

    at com.octo.captcha.service.AbstractCaptchaService.generateAndStoreCaptcha(AbstractCaptchaService.java:148)

    at com.octo.captcha.service.AbstractManageableCaptchaService.generateCountTimeStampAndStoreCaptcha(AbstractManageableCaptchaService.java:340)

    at com.octo.captcha.service.AbstractManageableCaptchaService.generateAndStoreCaptcha(AbstractManageableCaptchaService.java:329)

    at com.octo.captcha.service.AbstractCaptchaService.getChallengeForID(AbstractCaptchaService.java:64)

    at com.octo.captcha.service.image.AbstractManageableImageCaptchaService.getImageChallengeForID(AbstractManageableImageCaptchaService.java:62)

    at com.fcms.common.checkcode.ImageCaptchaServlet.doGet(ImageCaptchaServlet.java:44)

    at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)

    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)

    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)

    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)

    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)

    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)

    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)

    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)

    at java.lang.Thread.run(Thread.java:619)

Caused by: com.octo.captcha.CaptchaException: word is too tall: try to use less letters, smaller font or bigger background:  text bounds = {text=1833

    java.awt.geom.Rectangle2D$Float[x=0.0,y=-25.134277,w=15.002441,h=36.157227] ascent=25.134277 descent=7.507324 leading=3.515625 

    java.awt.geom.Rectangle2D$Float[x=35.00244,y=-26.97754,w=14.404297,h=33.251953] ascent=26.97754 descent=6.274414 leading=-0.0 

    java.awt.geom.Rectangle2D$Float[x=69.40674,y=-23.205566,w=15.05127,h=29.101562] ascent=23.205566 descent=5.895996 leading=-0.0 

    java.awt.geom.Rectangle2D$Float[x=104.45801,y=-23.205566,w=15.05127,h=29.101562] ascent=23.205566 descent=5.895996 leading=-0.0 

    } with fonts {java.awt.Font[family=Lucida Bright,name=Lucida Bright Demibold Italic,style=italic,size=25]

    java.awt.Font[family=DialogInput,name=DialogInput.italic,style=bold,size=25]

    java.awt.Font[family=Segoe UI,name=Segoe UI,style=bolditalic,size=25]

    java.awt.Font[family=Bitstream Vera Sans Mono,name=Bitstream Vera Sans Mono,style=bolditalic,size=25]

    } versus image width = 100, height = 40

    at com.octo.captcha.component.image.textpaster.ChangeableAttributedString.moveToRandomSpot(ChangeableAttributedString.java:184)

    at com.octo.captcha.component.image.textpaster.ChangeableAttributedString.moveToRandomSpot(ChangeableAttributedString.java:111)

    at com.octo.captcha.component.image.textpaster.DecoratedRandomTextPaster.pasteText(DecoratedRandomTextPaster.java:82)

    at com.octo.captcha.component.image.wordtoimage.ComposedWordToImage.pasteText(ComposedWordToImage.java:130)

    at com.octo.captcha.component.image.wordtoimage.AbstractWordToImage.getImage(AbstractWordToImage.java:52)

    at com.octo.captcha.image.gimpy.GimpyFactory.getImageCaptcha(GimpyFactory.java:77)

代码太长。这错误很少出现,但是在html中使用freemarker标签就容易出现,特别是在后台需要修改的字段也多也全。

遇到类似的问题,IDE有时会报错有时不会,但是把现有的代码发布到线上服务器就能全部解析并显示。

那么根据代码处理的逻辑,就能进行二次开发,增删功能。   至少暂时我还没找到更好解决的办法!

你可能感兴趣的:(exception)