I am building my project using GWT plugin for Eclipse Galileo. When I was done with RPC between the server and client, I tried to make a reference in the GWT project to a normal Java class in non-GWT project, but everytime when I create an object of this class I get a ClassNotFoundException
. I did the buildpath for the GWT project, but it still gives me the same exception. Is there a way to get it to work?
views:
130answers:
4i did the buildpath for the gwt project, but still gives me the same exception
Likely you did it wrong. Those libraries should after all end up in /WEB-INF/lib
. In Eclipse, you need to ensure that the GWT project is a Dynamic Web Project and that the non-GWT project is a Java Project. Then in the Buildpath properties of the GWT project, you need to add the non-GWT project in Projects tab. In the Java EE Module Dependencies you need to select the non-GWT project as well.
If that doesn't solve the problem, then please update your question to include the entire stacktrace.
GWT compiles the code to Javascript, it is then run on the browser. You can write some Java classes that run inside a Servlet engine, the only way to get them to communicate is to use some form of RPC.
I found the solution, to make any object from any non-gwt-project in gwt-project you should make sure to disable the Google App Engine, its somehow make that class invisible. thanks for all the suggestions
Better to show some code to understand that what u actually want.
Basically in GWT java class u can create object of non gwt java class if dat is with serialization , which help Help u to interact with data as encapsulated manner from client server or server to client.
And In other hand In non-GWT project u can not create object instance of GWT java class, practically there is no such meaning comes out.
GWT java class gives an enhancement capability to create web based GUI components as a java like syntax which will be compiled only in GWT compiler and become Javascript code after compilation.