Adding an External Jar to GWT

I have a jar file with packaged source code.

i inserted the jar into the war / WEB -INF / lib / xxx.jar. Add to build a path

but when I run the project, I got an error

Changed Added gwt.xml

<module rename-to='bookmanagementsystem'> <inherits name='com.google.gwt.user.User'/> <inherits name='com.google.gwt.user.theme.standard.Standard'/> <inherits name='com.example.Book'></inherits> <entry-point class='com.example.Book.client.Index'/> </module> 

Edited

I decided the plugin could not connect to the development mode server at 127.0.0.1:9997

Now i have a problem

 Loading inherited module 'com.example.book' [ERROR] Unable to find 'com/example/book.gwt.xml' on your classpath; could be a typo, or maybe you forgot to include a classpath entry for source? [ERROR] Line 6: Unexpected exception while processing element 'inherits' 
+8
gwt
source share
1 answer

If you want to include an external bank in GWT, make sure that you do the following

  • check that the jar has a .gwt.xml file and it should indicate the source.
  • add it to the lib folder
  • configure the build path and add the jar to the libraries
  • select a jar from Order and Export
  • inherits this module in the .gwt.xml file

Eg. if you have a package in the jar named "sample.source" and your .gwt.xml file in the jar is "Source.gwt.xml" and this .gwt.xml file is in the "sample" folder, and the classes or entities in "source" folder

Then your current project should inherit it. those. it should have the following tag

  <inherits name='sample.Source'/> 

For example: Sorce.gwt.xml in the jar file

 <module> <source path=""> <include name="**/MyEntity.java"/> </source> </module> 

For reference: http://jonathan.lalou.free.fr/? p = 1077

GWT does not support client-side serialization, so try using RPC and using these classes from jar on the server, or just copy the jar packages and add gwt to the src of the project.

OR

I solved the problem that jar files must have java source code along with class files or java package source code in jar and use.

+4
source share

All Articles