Try using Base64Utils, but the GWT compiler does not work

I am trying to use com.google.gwt.user.server.Base64Utils to encode my image on the server side, but the compiler gives me this information (later causing an error):

*"[INFO] [ERROR] Errors in 'jar:file:/C:/.../....rpc-1.12-SNAPSHOT.jar!/...////PictureFileDTO.java' [ERROR] Line 46: No source code is available for type com.google.gwt.user.server.Base64Utils; did you forget to inherit a required module?"* 

Using GWT 2.1.0 and Maven in Eclipse.

What am I missing here? Any ideas?

+1
source share
1 answer

gwt-user.jar is the library you work with, regardless of whether you are developing client or server code. It contains everything, user interface widgets, utility classes for the client side, and utility classes for the server side.

gwt-servlet.jar is used at runtime. I'm not talking about development mode, but about running your web application on some kind of web server (Apache, IIS ...). Gwt-servlet.jar contains the classes that a web server needs to run GWT materials on the server side.

So, the Base64Utils class is in both JAR files. However, it is not available for development on the client side.

If you need something that works on both sides, check this out:

http://www.source-code.biz/base64coder/java/

+1
source

Source: https://habr.com/ru/post/890913/


All Articles