Using the ReCaptcha Java API with GWT 2.0

130 views
Skip to first unread message

jfagh

unread,
Jan 18, 2010, 2:51:07 PM1/18/10
to Google Web Toolkit
I am trying to integrate the opensource ReCaptcha on my GWT 2.0 app. I
followed the instructions given at:
http://wiki.recaptcha.net/index.php/Overview#Java.2FJSP
And just like any added module, I added its JAR file to the lib
directory and to the classpath.
When I try to run the app with a new ReCaptcha object I get a run-time
error:
[ERROR] No source code is available for type
net.tanesha.recaptcha.ReCaptcha; did you forget to inherit a required
module?
I am not sure if I am supposed to modify the app.gwt.xml or is it just
that the ReCaptcha java library uses some methods that cannot be
"translated" into js by the GWT compiler.
Please help if you have any ideas.
Thank you.
James

Sudeep S

unread,
Jan 18, 2010, 2:59:33 PM1/18/10
to google-we...@googlegroups.com
is ReCaptcha a gwt library or a simple java library.
gwt module dicatates that source code be present in the lib that is refererred.

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.




jfagh

unread,
Jan 18, 2010, 3:14:39 PM1/18/10
to Google Web Toolkit
Hi Sudeep,
ReCaptcha is just a Java library. I added its JAR file to the lib/
folder and to the classpath.
When reference methods from the library, the IDE doesn't complain but
when I run the app it gives the error I listed above.
I am not sure what you mean by: "gwt module dicatates that source code

be present in the lib that is refererred."
Thanks.
James

> > google-web-tool...@googlegroups.com<google-web-toolkit%2Bunsu...@googlegroups.com>

Sudeep S

unread,
Jan 18, 2010, 10:27:48 PM1/18/10
to google-we...@googlegroups.com
gwt compiles your java to javascript so the source code should be present in that captcha.jar
its not sufficient if it has only .class files.
also it should have a gwt module.xml.
 
hope this helps
 
thanks
Sudeep
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.

Sudeep S

unread,
Jan 18, 2010, 10:29:14 PM1/18/10
to google-we...@googlegroups.com
forgot to ask,
 
are u using this library in the client side or the server side.
all that i told is applicable only if u are using it in the client side.
on the server side u can use it like a normal jar

jfagh

unread,
Jan 19, 2010, 3:48:34 PM1/19/10
to Google Web Toolkit
This is just for closure.
Yes, I was using the JAR file on the client-side. So to use your own
JAR file it must include both .java and .class files. I rebuilt the
jar file to meet these conditions and added (inside the jar) a
module.gwt.xml file which contained the path to the classes I was
using in the JAR.
The app still couldn't use the JAR because the .java files used JAVA
libraries it could not translate into javascript.
For your reference, here is another on-going discussion on using
external JARs with GWT:
http://groups.google.com/group/google-web-toolkit/browse_thread/thread/e91cf6274d4ef272#

I hope this helps.
James


On Jan 18, 9:29 pm, Sudeep S <sudee...@gmail.com> wrote:
> forgot to ask,
>
> are u using this library in the client side or the server side.
> all that i told is applicable only if u are using it in the client side.
> on the server side u can use it like a normal jar
>

> >> <google-web-toolkit%2Bunsu...@googlegroups.com<google-web-toolkit%252Buns...@googlegroups.com>

Reply all
Reply to author
Forward
0 new messages