Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

GWT - No source code is available error.

 
Adi Vicks
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am facing one error while running my GWT application.

Line 62: No source code is available for type com.abc.PQR; did you forget to inherit a required module?

Note: PQR is a class present in another project/directory. I have added that project's jar to my build path so didn't get any compilation error in eclipse. But seems like jetty deployment not working. I am using google plugin for eclipse to develope this application. Both the projects are under same folder.

I added the project as reference project to my project but no luck.

Any help ?
 
Tina Smith
Ranch Hand
Posts: 208
9
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To make the Java files available to the GWT compiler you need to

Create a gwt.xml file in the Java project / jar file which you want to use - This will instruct the GWT compiler to use the listed classes.

Use the included library via the inherit definition

If you are using a jar file you also need to include the source files in the jar

From: http://www.vogella.de/articles/GWTModules/article.html

If you don't have access to the Java project/jar file, or don't want to explicitly link it to GWT, you can include the gwt.xml file in the same package within your GWT project rather than within the other project.

 
Adi Vicks
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the link. Its working now. Also I forgot to add the dependency jars in the war/web-inf/lib folder.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic