Re: INHERITANCE FROM JAR FILE , DOESN'T WORK

88 views
Skip to first unread message

Abraham Lin

unread,
Oct 11, 2012, 6:50:42 PM10/11/12
to google-we...@googlegroups.com
Does your JAR file contain the source code for your library? The GWT compiler needs to have access to the source files, not just the compiled class files.

-Abraham

Magnus

unread,
Oct 17, 2012, 9:52:12 AM10/17/12
to google-we...@googlegroups.com
Hi,

I want to do the same. Could you please post how you create the jar file with ant? Are the source files in the same folders as the class files or is the hierarchy included twice?

Thanks
Magnus

Fabio

unread,
Oct 17, 2012, 12:49:52 PM10/17/12
to google-we...@googlegroups.com
HI

if you are using eclipse it's enough you run "Export as Jar file" from
the other project, and check the box "source included".
Then Unlink the other project from the classpath and add the jar in the
web-inf/lib folder and it to the classpath
> --
> You received this message because you are subscribed to the Google
> Groups "Google Web Toolkit" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/google-web-toolkit/-/RwRh3gTFW6wJ.
> To post to this group, send email to google-we...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-web-tool...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/google-web-toolkit?hl=en.

João Cavaleiro

unread,
Oct 18, 2012, 9:50:05 AM10/18/12
to google-we...@googlegroups.com
Hello,

@Magnus

In my projects where i do use ant to make the automatic build and export of JAR's i put the source code and compiled files together, without any distinction whatsoever (only file extension). To build and export the jar files with Ant i recommend you to use an Eclipse plugin for the effect like eclipse2ant.

@Fabio

You should have a <project>.gwt.xml for each project you are linking to the main project (known as a module). In the <main_project>.gwt.xml you should inherit each of them. In addition you need to specify in the <project>.gwt.xml all the translatable code (code to be used in the client side or shared with it). Also you need add the inheritance of other modules inside each modules which requires them.

If you are using eclipse just export the source code folder (it should be enough) to the lib path in the main GWT project. You should export the source code too.

Best Regards.

Quinta-feira, 11 de Outubro de 2012 16:13:53 UTC+1, Fabio escreveu:
Hello

I have an Eclipse GWT CHART project working fine as long as I let my library project linked in this GWT project.
But when I compile my library into a jar file, unlink my library project from the classpath of GWT project, and add the jar into war/web-inf/lib and classpath it

I get the following exception:

[ERROR] [gwt_mwp_sample] - Line 82: No source code is available for type sim.fab.gwt.client.util.GTable; did you forget to inherit a required module?

if I rollback everything. WORKS again!!!!

why does it happen ?

Yet I put the <inherits name='sim.fab.gwt.client.util'/> into the GWT project xml

is it a BUG ?

Thanks in advance

Fabio
Reply all
Reply to author
Forward
0 new messages