Friday, March 25, 2011

Interface problem between GWT and C using JNI

Hi,

I am planning to change the look and feel of the existing project.
My current project has backend code in C, and JNI layer to interact
with GUI(JAVA). Upon user actions in GUI, I transfer the information
to backend using JNI calls. Recently I came across the GWT and
impressed with it, thought of using it for current GUI, but am stuck
in interfacing GWT JAVA code(server) making JNI call to C code.

Just to test the GWT and JNI,
i) I added a sample GWT web application(example provided by Google in
GWT documentation) code to eclipse, where server and client code is in
Java. It is working fine after compiling in eclipse.

Later I added 'HelloWorld.c' file which just prints the 'Hello world'
to standard output stream, and a Hello.java file at server side, which
loads the native object file to Test.java file using inbuilt load
library function call.
Then I made a 'Test' class call in original GWT server JAVA file.

NOTE: I've linked the jna.jar file to eclipse for this project as
external jar file(as per GWT documentation), and placed the native
library file of C along with the Original GWT server class file.

Now when I try to compile the above code in eclipse, eclipse shows up
the message stating :
-----------------------------------------------------------------------------------------------------------------------------------------------------------
Starting Jetty on port 8888
[WARN] Exception while dispatching incoming RPC call
com.google.gwt.user.server.rpc.UnexpectedException: Service method
'public abstract java.lang.String
com.mycompany.mywebapp.client.GreetingService.greetServer(java.lang.String)
throws java.lang.IllegalArgumentException' threw an unexpected
exception: java.lang.UnsatisfiedLinkError:
com.mycompany.mywebapp.server.GreetingServiceImpl.sayHi(Ljava/lang/
String;)V
-----------------------------------------------------------------------------------------------------------------------------------------------------------
Appreciate your help.

Thank you,
Ganny

--
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-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment