"No source code is available for type" Error on Web Mode Compile

95 views
Skip to first unread message

John

unread,
May 14, 2009, 12:47:32 PM5/14/09
to Google Web Toolkit
I am using GWT 1.6 with Eclipse 3.4 and the the Eclipse GWT plug-in.
My problem is that my application is running correctly in hosted mode,
but I get an error like the following when I try to compile the
project into hosted mode with the GWT plug-in(I have not tried the
command line), "[ERROR] Line 26: No source code is available for type
com.company.ibatis.model.Radio; did you forget to inherit a required
module?"

I elected to split my application into two Eclipse projects:
1. A data base project that contains database access code in the
package com.company.ibatis.*. There is a module without an entry
point defined at com.company.ibatis.DbPojo.gwt.xml it includes source
from the com.company.ibatis.model package. The model package contains
all of the POJOs that my GWT RPC passes between the server side and
the client side.
2. A web server project that includes my GWT UI and GWT RPC. It
has a module with an entry point defined at
com.company.server.Server.gwt.xml, and all of my client and server
side code are in com.company.server.client and
com.company.server.server respectively.

In summary it appears that the hosted mode server can find my source
code in the database project when the hosted mode server is launched
from the server project, but when I try to compile my server project
into web mode the GWT compiler cannot find the source in the database
project.

I have tried modifying my java build path in Eclipse in every way I
can think of, but I suspect I haven't gotten it right yet.

Any thoughts?

Thanks,
John

Alex Rudnick

unread,
May 14, 2009, 5:08:39 PM5/14/09
to Google-We...@googlegroups.com
Hey John,

The plugin doesn't (yet) have good support for the case of GWT
projects depending on other GWT projects, but that's definitely on our
list.

For the current workaround, please see Jason's comments on this thread:
http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/951499c5773693c9

Hope this helps! (and let us know if I didn't understand the problem properly)

--
Alex Rudnick
swe, gwt, atl

Alyxandor

unread,
May 14, 2009, 9:34:29 PM5/14/09
to Google Web Toolkit
Does DbPojo.gwt.xml have <source path="model"/> element in it? Cos by
default, gwt looks for source from /path/to/Module.gwt.xml /path/to/
client. You use source to change this {just be wary, I haven't done
this since 1.4, and it was a little buggy about setting the source
path back to client...

Cheers!

John

unread,
May 15, 2009, 2:16:20 PM5/15/09
to Google Web Toolkit
Yes, I have a <source path="model"/> element. I think the link in
Alex's response explains my issue pretty well.

On May 14, 9:34 pm, Alyxandor <a.revolution.ultra.b...@gmail.com>
wrote:

Rajeev Dayal

unread,
May 15, 2009, 3:00:14 PM5/15/09
to Google-We...@googlegroups.com
Hi John,

What version of the plugin are you currently using? We just released a new version of the plugin (1.0.1) a couple of days ago that may fix this problem. Here are the release notes:

http://code.google.com/eclipse/docs/release_notes.html

Although the problem that you're having is not explicitly mentioned in this list, I know that we had some issues with classpath computation for GWT Compiles.

See http://code.google.com/eclipse/docs/updating_the_plugin.html for instructions on updating the plugin.

However, the problem that Alex mentioned above still exists. That is, if you have a GWT, App Engine, or GWT + App Engine project (call it project A), and that project depends on another project (call it project B), the classes for project B are not automatically copied into project A's war directory.

Now, suppose that project B only has GWT client source in it (no RPC) - then the new version of the plugin will handle this case - it will automatically pull the dependent project's source folders onto the classpath when compiling or running hosted mode.

If it is the case that project B is using GWT but defines RPC interfaces and RPC data objects (which seems to be your case), then you'll have a problem, because you'll need the class files from the RPC data objects in project A's war directory. So, to make your situation work, I think you'll have to go with the workaround of exporting a jar from project B, and adding a reference to it on project A's classpath.

Sorry about the inconvenience; we're planning on fixing this issue in the future.


Rajeev

John

unread,
May 15, 2009, 4:42:24 PM5/15/09
to Google Web Toolkit
Rajeev,

The update seems to have fixed my issue because I was only using
project B's code on the UI and as parameters of the RPC.

Thanks,
John

Tim McCormack

unread,
May 15, 2009, 4:45:46 PM5/15/09
to Google Web Toolkit
On May 15, 3:00 pm, Rajeev Dayal <rda...@google.com> wrote:
> Now, suppose that project B only has GWT client source in it (no RPC) - then
> the new version of the plugin will handle this case - it will automatically
> pull the dependent project's source folders onto the classpath when
> compiling or running hosted mode.

What if B is not a GWT project, but instead a regular Java project? I
can't have it compile into A's output folder, because it won't output
GWT classes.

That's the situation I have right now, and I can't seem to get GWT to
compile with outside libraries. How is it done?

- Tim McCormack

Rajeev Dayal

unread,
May 15, 2009, 5:13:48 PM5/15/09
to Google-We...@googlegroups.com
Hey Tim,

Can you give me a bit more detail on what you're trying to accomplish? For example, what code is in the dependent project, and what code is in your main project? It sounds like there is no GWT-related code in your dependent project. Does your main project have GWT code?


Thanks,
Rajeev

John

unread,
May 15, 2009, 5:19:38 PM5/15/09
to Google Web Toolkit
Tim,

In order to get something to work in GWT you have to have the Java
source, and as far as I know you have to put a module file in the same
package hierarchy with a <source path='relative.package.path' />
element. So you may as well make your project B a gwt project without
any entry points anyway. I think you will find that the path='X'
attribute isn't as flexible as you would like it to be. For example,
I don't "think" it supports things like ".." for previous package, and
I just tried and failed to get a compile to work with a module that
had path="source in another project" or a single module that is
defined in package com.domain.packageA with an element like <source
path='com.domain.packageB />

-John

Rajeev Dayal

unread,
May 18, 2009, 11:01:03 AM5/18/09
to Google-We...@googlegroups.com
Hi John,

With respect to the path attribute, it must be module relative, but it does not have the flexibility of a typical relative path. You cannot reference something that is a parent of the current path (hence '..' is not allowed).


Rajeev
Reply all
Reply to author
Forward
0 new messages