peoplemerge / recaptcha4j

Automatically exported from code.google.com/p/recaptcha4j
1 stars 1 forks source link

ReCaptchaImpl throws a NotSerializableException #13

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Use ReCaptchaImpl with Wicket 1.5.1

What is the expected output? What do you see instead?
ReCaptcha essentially works ok, but there are lots of logged ERRORS of 
java.io.NotSerializableException: net.tanesha.recaptcha.ReCaptchaImpl

What version of the product are you using? On what operating system?
0.0.7 (using maven repository..and 0.0.8 not up there as yet...)

Please provide any additional information below.
Adding "implements Serializable" to ReCaptchaImpl class should do it

Original issue reported on code.google.com by chrisand...@gmail.com on 5 Oct 2011 at 6:14

GoogleCodeExporter commented 9 years ago
Your application design is invalid if the ReCaptchaImpl is getting serialized 
by wicket.  You have attached a reference to a ReCaptchaImpl instance that you 
should not have.

The ReCaptchaImpl should be accessed via a singleton pattern.  After 
construction and setters have been called it is thread-safe via the main 
interface so your whole Wicket application could share 1 instance if it wanted.

Another reason the ReCaptchaImpl should never be serialized (without due care) 
is that it contains the privateKey and you need to provide a very good reason 
why that information is to be thrown around and copied into other formats via 
serialization.

I vote this bug be marked invalid.

Original comment by darryl.m...@darrylmiles.org on 18 Jun 2012 at 11:52

GoogleCodeExporter commented 9 years ago
Thanks for the explanation!

Original comment by alejandr...@gmail.com on 18 Jun 2012 at 11:54