Compiler error: Class can not be found in source packages

GWT Designer allows you to quickly create the modules, composites, panels, remote services and other elements that comprise Google Web Tookit applications.

Moderators: Konstantin.Scheglov, gnebling, Alexander.Mitin, jwren, Eric Clayberg

Compiler error: Class can not be found in source packages

Postby stsch77 » Mon Mar 23, 2009 12:14 pm

I have an RPC servlet that only returns a String back to the client. This works fine. As soon as I change the return type from String to one of my custom classes contained in another project (let's say the return tpye is an instance of a custom Employee class) this is also fine in the Java class implementing the service but not in the interface defining the service and the AsyncCallback. There I get this compiler error:

de.stsch.sample.Employee can not be found in source packages. Check the inheritance chain from your module; it may not be inheriting a required module or a module may not be adding its source path entries properly.

What is this message trying to tell me? Is this GWT Designer's way to prevent me from doing this nonsense and to force me to use a compatible return type?

Update: If I put my custom class into my GWT project (into the client package) everything seems to work fine. Does that mean that i cannot reference another project from my GWT project and use the classes of the referenced project as parameters and return types of my RPC service? Why is that?
stsch77
 
Posts: 19
Joined: Fri Feb 27, 2009 10:31 am

Re: Compiler error: Class can not be found in source packages

Postby Eric Clayberg » Wed Mar 25, 2009 6:44 am

That is just basic GWT behavior and not a GWT Designer issue. Classes in the "client" part of a GWT app can only reference JDK classes emulated by GWT itself or classes present in the client part of other imported/inherited GWT modules. Just adding a required project to your project classpath is not enugh. All of this is explained in greater detail in the GWT docs.
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA


Return to GWT Designer

Who is online

Users browsing this forum: No registered users and 2 guests