Reputation: 819
How do we add an external .jar package in Google Web Toolkit (GWT)? I have followed the steps
1) added the .jar in classpath
2) added <inherits name='org.scribe.model' /> in my test.gwt.xml
I get this error:
Loading inherited module 'org.scribe.model'
[ERROR] Unable to find 'org/scribe/model.gwt.xml' on your classpath; could be a typo, or maybe you forgot to include a classpath entry for source?
[ERROR] Line 8: Unexpected exception while processing element 'inherits'
However, I have found from many sources that you need the source files to compile the client side gwt. My question is what if one cannot get a source file of the .jar package? What is the workaround?
Thanks in advance.
Upvotes: 2
Views: 2061
Reputation: 562
My suggestion would be to handle intense logic on server side (within server package)
On the server side , you can use classes that are not supported by GWT front-end (classes in client package).
E.g When I tried to use BufferedReader in client, I got exceptions, I then moved it to server package and retuned the result. The same was for RE which didn't work in client code too.
Keep your client code as simple as possible. Hope this helps.
Cheers PB
Upvotes: 0
Reputation: 648
If it is a GWT module it is packaged with sources. Check the jar Java files should be in it.
There are two ways to use a 3rd party dependency in your GWT
application.
GWT
module already which contains a module xml file along with the source files. In this case you just refer to it using inherits
.GWT
requires source code to be under client
package. Even you do so since the artifact is not developed GWT
in mind, it might most likely contain code that is not allowed by GWT
, e.g. you cannot use Thread
s in GWT.Upvotes: 3
Reputation: 21300
There is no workaround. You need source files.. At least you can decompile class files..
Upvotes: 2