Thank you Antonie.
I'm sorry I didn't get complete picture.
his is how we are calling captcha services to get the image, so can you advise me how to resolve using GlyphPaster?

 protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        String captchaId = request.getSession().getId();
        logger.debug("ImageCaptchaServlet - Session Id: " + captchaId);
        Locale locale = new Locale("en", "US");
        GenericManageableCaptchaService captchaService = CaptchaServiceSingleton.getInstance();
        CaptchaServiceSingleton.setCharacterEngine();
        org.apache.commons.logging.Log log = new org.apache.commons.logging.impl.LogFactoryImpl().getLog(this
                .getClass());
        ImageToJpegHelper.flushNewCaptchaToResponse(request, response, log, captchaService, captchaId, locale);
    }


On Tue, May 6, 2014 at 1:10 AM, Antoine Véret <antoine.veret@gmail.com> wrote:
Hello, 

You could switch the RandomTextPaster with a GlyphPaster.

The most simple way to do it is to duplicate some lines of code.

For a more advanced usage, look a the GlyphsVisitors provided, they are helpful for text deformation. Sorry we don't have a complete documentation on this topic.

Regards
 


On Mon, May 5, 2014 at 10:11 PM, Prasad Reddy <prasadreddy.oln@gmail.com> wrote:
Hi Antonie,

Hope you are doing great and  had a nice weekend.

I downloaded jcaptcha-2.0-alpha-1.jar and about to replace it in our project, before doing that I have a question on your statement 'Could you try to upgrade to the 2.0-alpha-1, and use the GlyphsPaster instead of the RandomTextPaster ?
Can you tell me how to use GlyphsPaster instead of RandonTextPaster?

Thank you,
Prasad Reddy


On Thu, May 1, 2014 at 3:19 PM, Antoine Véret <antoine.veret@gmail.com> wrote:
Hello Prasad, 

the Hashmap issue is not located in the JCaptcha code, so there isn't any workaround.

Could you try to upgrade to the 2.0-alpha-1, and use the GlyphsPaster instead of the RandomTextPaster ?


Regards







On Wed, Apr 30, 2014 at 12:36 AM, Prasad Reddy <prasadreddy.oln@gmail.com> wrote:
Thank you very much for the clarification Antoine.
Probability of occurrence of this issue is almost once in every month.So definitely I would say its not very 'Rarely Reproducible' .

So as the problem is with read access to the HasMap is not synchronized, do we need to use JDK 8?, I afraid for the upgrade from current JDK 6 to latest JDK 8, as our code may fail in compilation due backward compatibility.
So will you please suggest if there are any other alternatives, like for example, what if we use ConcurrenthashMap in jcapcha code base rather than simple HashMap?

Thanks,
Prasad Reddy



On Tue, Apr 29, 2014 at 4:08 PM, Antoine Véret <antoine.veret@gmail.com> wrote:
Hello Prasad, 

It is about this JDK 6 bug.

I am afraid you will have to wait until you could upgrade to the JDK 8 to fix the issue. Does it appends more than the "rarely reproducibility" ? What is the frequency of the 12 times ?

About versions of the JAR file, you could find the 1.0 on the maven central repo, and the 2.0-alpha-1 in the sonatype oss repo.

Regards


On Tue, Apr 29, 2014 at 5:34 PM, Reddy, Prasad <PReddy@semprautilities.com> wrote:

Dear Friends,

 

Any update please.Also can you please share me the latest jcaptcha jar file

 

Thanks,

Prasad Reddy

213-244-2319

 

From: Reddy, Prasad
Sent: Thursday, April 24, 2014 3:07 PM
To: 'jcaptcha-users@lists.sourceforge.net'
Subject: Server crash due to ImageCaptcha!

 

Dear Team,

 

We have been using JCPATCH version jcaptcha-1.0-mod.jar in our project to block automated spammers.

We have been using this in our registration, forgot password,forgot user id and forgot both use cases.

 

We identified that our web logic servers crashing at least once in a month with some STUCK THREAD issues caused due to ImageCapcha Servlet.

 

I pasted the server error below. Can you guys please have a look and suggest what might have been went wrong. Also please suggest how to prevent this in future?

In the last one year we encounter this issue more than 12 times. So we were forced to restart our servers.

 

Thanks,

Prasad Reddy

001-213-244-2319

 

 

 


10:48:38.000 PM

####<Apr 12, 2014 10:48:38 PM PDT> <Error> <WebLogicServer> <ejap6.sempra.com> <umscgap6> <[ACTIVE] ExecuteThread: '73' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1397368118954> <BEA-000337> <[STUCK] ExecuteThread: '58' for queue: 'weblogic.kernel.Default (self-tuning)' has been busy for "602" seconds working on the request "weblogic.servlet.internal.ServletRequestImpl@1b634124[

GET /forgotuserid/imageCaptcha HTTP/1.1

Accept: image/webp,*/*;q=0.8

User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.116 Safari/537.36

DNT: 1

Referer: https://myaccountum.socalgas.com/forgotuserid/forgotUserIdStepOneEmail.jsf?fromLogin=yes

Accept-Encoding: gzip,deflate,sdch

Accept-Language: en,ru;q=0.8,en-US;q=0.6

Cookie: scgumdomeaen=qZyJTKhLZRrLVshVYP2F3BPVc3ng02KnDB0pm66kkYFrnbmGM4Sy!-598822392; SMTRYNO=4; scgumdomfus=L1lYTKhNL89NJt8JThjCL8LwR90nf14DVNThQskvLKTR3HRvGTWp!-598822392; umscgdomfbo=rFPgTKhNQ40LnMyy8QhT7mLyqg7xnC5ZPbmp2VVL3LjGcjhpH0RK!1031570784

Connection: Keep-Alive

Proxy-Client-IP: 68.109.88.211

X-Forwarded-For: 68.109.88.211

X-WebLogic-KeepAliveSecs: 30

X-WebLogic-Request-ClusterInfo: true

x-weblogic-cluster-hash: oMBQxNJeBu4qh3dvmvm36DUCLxQ

]", which is more than the configured time (StuckThreadMaxTime) of "600" seconds. Stack trace:

Thread-353267 "[STUCK] ExecuteThread: '58' for queue: 'weblogic.kernel.Default (self-tuning)'" <alive, suspended, priority=1, DAEMON> {

    java.util.HashMap.get(HashMap.java:368)

    sun.font.SunLayoutEngine.getEngine(SunLayoutEngine.java:109)

    sun.font.GlyphLayout$EngineRecord.init(GlyphLayout.java:617)

    sun.font.GlyphLayout.nextEngineRecord(GlyphLayout.java:487)

    sun.font.GlyphLayout.layout(GlyphLayout.java:349)

    sun.font.ExtendedTextSourceLabel.createGV(ExtendedTextSourceLabel.java:301)

    sun.font.ExtendedTextSourceLabel.getGV(ExtendedTextSourceLabel.java:293)

    sun.font.ExtendedTextSourceLabel.createLogicalBounds(ExtendedTextSourceLabel.java:208)

    sun.font.ExtendedTextSourceLabel.getAdvance(ExtendedTextSourceLabel.java:116)

    java.awt.font.TextLine.init(TextLine.java:132)

    java.awt.font.TextLine.<init>(TextLine.java:93)

    java.awt.font.TextLine.fastCreateTextLine(TextLine.java:879)

    java.awt.font.TextLayout.fastInit(TextLayout.java:569)

    java.awt.font.TextLayout.<init>(TextLayout.java:485)

    sun.java2d.SunGraphics2D.drawString(SunGraphics2D.java:2801)

    com.octo.captcha.component.image.textpaster.ChangeableAttributedString.drawString(ChangeableAttributedString.java:93)

    com.octo.captcha.component.image.textpaster.RandomTextPaster.pasteText(RandomTextPaster.java:65)

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

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

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

    com.octo.captcha.image.ImageCaptchaFactory.getCaptcha(ImageCaptchaFactory.java:37)

    com.octo.captcha.engine.GenericCaptchaEngine.getNextCaptcha(GenericCaptchaEngine.java:81)

    com.octo.captcha.service.AbstractCaptchaService.generateAndStoreCaptcha(AbstractCaptchaService.java:156)

    com.octo.captcha.service.AbstractManageableCaptchaService.generateCountTimeStampAndStoreCaptcha(AbstractManageableCaptchaService.java:336)

    com.octo.captcha.service.AbstractManageableCaptchaService.generateAndStoreCaptcha(AbstractManageableCaptchaService.java:312)

    com.octo.captcha.service.AbstractCaptchaService.getChallengeForID(AbstractCaptchaService.java:71)

    com.octo.captcha.service.multitype.GenericManageableCaptchaService.getImageChallengeForID(GenericManageableCaptchaService.java:81)

    com.octo.captcha.module.web.image.ImageToJpegHelper.flushNewCaptchaToResponse(ImageToJpegHelper.java:55)

    com.sempra.eservices.captcha.ImageCaptchaServlet.doGet(ImageCaptchaServlet.java:20)

    javax.servlet.http.HttpServlet.service(HttpServlet.java:700)

    javax.servlet.http.HttpServlet.service(HttpServlet.java:815)

    weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:224)

    weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:108)

    weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:206)

    weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)

    weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:55)

    weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:25)

    weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:55)

    weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.doIt(WebAppServletContext.java:3656)

    weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3650)

    weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:308)

    weblogic.security.service.SecurityManager.runAs(SecurityManager.java:117)

    weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2204)

    weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2126)

    weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1412)

    weblogic.work.ExecuteThread.execute(ExecuteThread.java:198)

    weblogic.work.ExecuteThread.run(ExecuteThread.java:165)

}

 


------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.  Get
unparalleled scalability from the best Selenium testing platform available.
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
jcaptcha-users mailing list
jcaptcha-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jcaptcha-users




--
Antoine Véret


------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.  Get
unparalleled scalability from the best Selenium testing platform available.
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
jcaptcha-users mailing list
jcaptcha-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jcaptcha-users



------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.  Get
unparalleled scalability from the best Selenium testing platform available.
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
jcaptcha-users mailing list
jcaptcha-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jcaptcha-users




--
Antoine Véret
Mobile France : (00 33) 6.20.31.14.05
Mobile Maroc : (00 212) 6.61.46.20.38

------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.  Get
unparalleled scalability from the best Selenium testing platform available.
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
jcaptcha-users mailing list
jcaptcha-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jcaptcha-users



------------------------------------------------------------------------------
Is your legacy SCM system holding you back? Join Perforce May 7 to find out:
&#149; 3 signs your SCM is hindering your productivity
&#149; Requirements for releasing software faster
&#149; Expert tips and advice for migrating your SCM now
http://p.sf.net/sfu/perforce

_______________________________________________
jcaptcha-users mailing list
jcaptcha-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jcaptcha-users




--
Antoine Véret
Mobile France : (00 33) 6.20.31.14.05
Mobile Maroc : (00 212) 6.61.46.20.38

------------------------------------------------------------------------------
Is your legacy SCM system holding you back? Join Perforce May 7 to find out:
&#149; 3 signs your SCM is hindering your productivity
&#149; Requirements for releasing software faster
&#149; Expert tips and advice for migrating your SCM now
http://p.sf.net/sfu/perforce
_______________________________________________
jcaptcha-users mailing list
jcaptcha-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jcaptcha-users