GWT tutorial does not compile

1,013 views
Skip to first unread message

likejudo

unread,
Apr 29, 2021, 1:57:18 PM4/29/21
to GWT Users
I am learning GWT and was trying to run this tutorial http://www.gwtproject.org/doc/latest/tutorial/index.html

Using the Eclipse GWT plugin 3.0 on Windows 10 and JDK 11

I get this error on the first line Error: There is '1' error in 'gwt-module.dtd'.

I installed the plugin from the marketplace.
I see this error in other tutorials too.

Any suggestions appreciated.

lofid...@gmail.com

unread,
Apr 29, 2021, 4:36:02 PM4/29/21
to GWT Users
Hi,

today I won't use the GWT plugin for Eclipse anymore... 

I would just use Eclipse / IntelliJ / Visual Studio Code and Maven.

Some introductions:
Hope this helps.

Vegegoku

unread,
Apr 29, 2021, 4:39:14 PM4/29/21
to GWT Users
Try following this tutorial https://dev.to/ibaca/modern-gwt-first-steps-509k

likejudo

unread,
Apr 29, 2021, 4:48:51 PM4/29/21
to GWT Users
Thanks for the links.
I found from other posts that DOCTYPE was incorrectly set. 'www' is required and that fixed it. 
However, I am stuck here now:
   [ERROR] Hint: Check that your module inherits 'com.google.gwt.core.Core' either directly or indirectly (most often by inheriting module 'com.google.gwt.user.User')

Have you seen this before?

lofid...@gmail.com

unread,
Apr 29, 2021, 5:14:19 PM4/29/21
to GWT Users
You need to take a look at the Module file in the project: Xxx.gwt.xml. Example for StockWatcher demo app: https://github.com/manolo/gwt-stockwatcher/blob/master/src/com/google/gwt/sample/stockwatcher/StockWatcher.gwt.xml


Hope this helps

likejudo

unread,
Apr 29, 2021, 8:24:09 PM4/29/21
to GWT Users
but I have not modified the tutorial file at all so it should have worked.

Thanks for the file. I took the gwt.xml from your link

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 1.6.2//EN" "http://google-web-toolkit.googlecode.com/svn/tags/1.6.2/distro-source/core/src/gwt-module.dtd">
<module rename-to='stockwatcher'>
  <!-- Inherit the core Web Toolkit stuff.                        -->
  <inherits name='com.google.gwt.user.User'/>

  <!-- Inherit the default GWT style sheet.  You can change       -->
  <!-- the theme of your GWT application by uncommenting          -->
  <!-- any one of the following lines.                            -->
  <inherits name='com.google.gwt.user.theme.standard.Standard'/>
  <!-- <inherits name='com.google.gwt.user.theme.chrome.Chrome'/> -->
  <!-- <inherits name='com.google.gwt.user.theme.dark.Dark'/>     -->
  <!-- Specify the app entry point class.                         -->
  <entry-point class='com.google.gwt.sample.stockwatcher.client.StockWatcher'/>
</module>

I did Run As and picked Dev Mode:

Turning off precompile in incremental mode.
Super Dev Mode starting up
   workDir: C:\Users\Anil\AppData\Local\Temp\gwt-codeserver-9512230354285428339.tmp
2021-04-29 19:15:08.287:INFO::main: Logging initialized @691ms
   Loading Java files in com.google.gwt.sample.stockwatcher.StockWatcher.
   [ERROR] Hint: Check that your module inherits 'com.google.gwt.core.Core' either directly or indirectly (most often by inheriting module 'com.google.gwt.user.User')


What am I missing?

lofid...@gmail.com

unread,
Apr 30, 2021, 2:48:30 AM4/30/21
to GWT Users
Hmmm that looks fine from here... because the module com.google.gwt.user.User (User.gwt.xml) inherits com.google.gwt.core.Core (Core.gwt.xml) so you don't need to directly inherits the Core module.

Here you can see that User module already inherits everything:

Maybe your project cannot find the the Core module file: Core.gwt.xml.

The problem is I don't know what the Eclipse GWT Plugin is doing today... how the dependencies are defined...

I your case I would just download this zip file from above: https://github.com/lofidewanto/gwt-boot-sample-basic/archive/refs/heads/main.zip (simple "Hello World" example: https://github.com/lofidewanto/gwt-boot-sample-basic) and then copy & paste
  • all the Java classes
  • the HTML host file: index.html
  • the GWT Module file: Xxxx.gwt.xml
into the project...

I think we need to rework all the examples from GWT project site not to use the GWT plugin for Eclipse anymore... instead just using Maven.

Craig Mitchell

unread,
Apr 30, 2021, 3:37:27 AM4/30/21
to GWT Users
Don't you have to define the source path in the gwt.xml?

Ie: If your gwt.xml file is in com.google.gwt.sample.stockwatcher

Then because your entry point is com.google.gwt.sample.stockwatcher.client.StockWatcher, you'd add:
<source path='client' />

To tell GWT it needs to look in  com.google.gwt.sample.stockwatcher.client and below.

Thomas Broyer

unread,
Apr 30, 2021, 4:32:46 AM4/30/21
to GWT Users
On Thursday, April 29, 2021 at 10:48:51 PM UTC+2 likejudo wrote:
Thanks for the links.
I found from other posts that DOCTYPE was incorrectly set. 'www' is required and that fixed it. 

That DOCTYPE is mostly useless (it can help in IDEs to provide autocompletion and validation, but that's it), so you can just delete it.
 
However, I am stuck here now:
   [ERROR] Hint: Check that your module inherits 'com.google.gwt.core.Core' either directly or indirectly (most often by inheriting module 'com.google.gwt.user.User')

Have you seen this before?

It generally means there's another issue. Can you share the whole log?
Also, which GWT version are you using? (surely not 1.6.2, that's way too old)
and which JDK version?

likejudo

unread,
Apr 30, 2021, 11:52:15 AM4/30/21
to GWT Users

likejudo

unread,
Apr 30, 2021, 11:54:19 AM4/30/21
to GWT Users
I tried it but when I run mvn package
I get error:
Unknown packaging: gwt-app

On Thursday, April 29, 2021 at 3:39:14 PM UTC-5 aka...@gmail.com wrote:

lofid...@gmail.com

unread,
Apr 30, 2021, 12:46:04 PM4/30/21
to GWT Users
Hmm wyrd...

Did you try to download the zip (https://github.com/lofidewanto/gwt-boot-sample-basic/archive/refs/heads/main.zip), unpack it and start in the unpack directory?

mvn gwt:generate-module gwt:devmode

or complete:

mvn net.ltgt.gwt.maven:gwt-maven-plugin:generate-module net.ltgt.gwt.maven:gwt-maven-plugin:devmode

likejudo

unread,
Apr 30, 2021, 12:51:52 PM4/30/21
to GWT Users
I was trying to follow the tutorial so I did not try your other sample yet.
I think the reason is, my employer uses Mojo GWT Maven from Codehaus.
Unless I am mistaken, it does not seem to have gwt-app packaging.

lofid...@gmail.com

unread,
Apr 30, 2021, 1:07:22 PM4/30/21
to GWT Users
Do not use that old GWT Maven plugin... it makes no sense, it is too old and all of the new stuffs in GWT are using TBroyer GWT Maven plugin 😉

It's very good Maven plugin...

lofid...@gmail.com

unread,
Apr 30, 2021, 1:09:28 PM4/30/21
to GWT Users
You can use my zip file and follow the tutorial using that zip file Maven project... 

The GWT Java code like in the tutorial doesn't change at all, only the project structure with TBroyer GWT Maven plugin...

likejudo

unread,
Apr 30, 2021, 1:17:13 PM4/30/21
to GWT Users
  I don't have a choice. I have to use what is in my employer's repository. Mojo GWT Maven plugin 2.90 is in the repo.  

likejudo

unread,
Apr 30, 2021, 2:27:00 PM4/30/21
to GWT Users
Mojo GWT Maven plugin packages as war.
if I package as war, can I still follow the tutorial?

lofid...@gmail.com

unread,
Apr 30, 2021, 3:49:17 PM4/30/21
to GWT Users
I checked the old Maven GWT Plugin... ok it still works for GWT 2.9 but I won't use it anymore. 

If you have to use it here is an example - just the same demo from my example above but use the old Maven plugin: https://github.com/lofidewanto/gwt-old-maven-sample-basic

The Java code is the same but it uses the structure of the old GWT Maven plugin... just take a look at the README of the project above.

Hope this helps.

lofid...@gmail.com

unread,
Apr 30, 2021, 3:52:56 PM4/30/21
to GWT Users
... and yes, you can follow the tutorial with the TBroyer Maven plugin or the Mojo Maven plugin.

The code is the same, only the structure is different... You can compare both:
Lofi

likejudo

unread,
Apr 30, 2021, 4:14:36 PM4/30/21
to GWT Users
thank you - this will be of great help. I will try and let you know.

lofid...@gmail.com

unread,
Apr 30, 2021, 4:15:58 PM4/30/21
to GWT Users
Forget something...

It's wise to separate the "client" and the "server" in two Maven projects. Don't use the example of the Mojo Maven plugin because it mixes the client and server on the same Maven project.

I've once used it mixed (see https://github.com/interseroh/demo-gwt-springboot) but at the end I had a lot of troubles with the classpath. 

Here is an example how you could separate the client and server. At the end your result on the client is JavaScript and you can copy the result to the server part using maven-dependency-pluginhttps://github.com/gwtboot/domino-rest-enum-date

Hope this helps.

likejudo

unread,
May 2, 2021, 2:43:01 PM5/2/21
to GWT Users
At home (on my personal computer not employer workspace, without the restrictions of using only company repository),
I downloaded and ran your example using Broyer plugin. It works. Thank you. 
Then I tried the Ignacio Baca tutorial with maven (using IntelliJ Community Edition).
At step 3 Package, Run and Debug
I get an error

userr@DESKTOP MINGW64 ~/Documents/Learn/gwt/hello-app
$ mvn package
[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[ERROR] Unknown packaging: gwt-app @ line 10, column 14
 @
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR]   The project me:hello-app:HEAD-SNAPSHOT (C:\Users\user\Documents\Learn\gwt\hello-app\pom.xml) has 1 error
[ERROR]     Unknown packaging: gwt-app @ line 10, column 14
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:


pom.xml
Unfortunately, google groups strips out the xml formatting.

<?xml version="1.0" encoding="UTF-8"?>

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>me</groupId>
<artifactId>hello-app</artifactId>
<version>HEAD-SNAPSHOT</version>
<packaging>gwt-app</packaging>

<name>hello-app</name>
<!-- FIXME change it to the project's website -->
<url>http://www.example.com</url>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
</properties>

<dependencies>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt</artifactId>
<version>2.9.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
<version>2.9.0</version>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-dev</artifactId>
<version>2.9.0</version>
</dependency>
</dependencies>

<build>
<pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
<plugins>
<!-- clean lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle -->
<plugin>
<groupId>net.ltgt.gwt.maven</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>1.0.0</version>
<extensions>true</extensions>
<configuration>
<moduleName>me.App</moduleName>
<skipModule>true</skipModule>
</configuration>
</plugin>

<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>3.1.0</version>
</plugin>
<!-- default lifecycle, jar packaging: see https://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging -->
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.2</version>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.1</version>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>3.0.2</version>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.2</version>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
</plugin>
<!-- site lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#site_Lifecycle -->
<plugin>
<artifactId>maven-site-plugin</artifactId>
<version>3.7.1</version>
</plugin>
<plugin>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>3.0.0</version>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>

I will appreciate suggestions to fix this.

lofid...@gmail.com

unread,
May 2, 2021, 3:23:10 PM5/2/21
to GWT Users
<quote>
At home (on my personal computer not employer workspace, without the restrictions of using only company repository),
I downloaded and ran your example using Broyer plugin. It works. Thank you. 
</quote>

OK, great 👍 

<quote>
At step 3 Package, Run and Debug
I get an error

xxx@xxxx xxxx ~/Documents/Learn/gwt/hello-app
$ mvn package
[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[ERROR] Unknown packaging: gwt-app @ line 10, column 14
</quote>

This is the project... you can download and unzip. I downloaded the project, unzip and did: mvn clean package. It works without errors.

My Java version: java -version
openjdk version "12" 2019-03-19
OpenJDK Runtime Environment AdoptOpenJDK (build 12+33)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 12+33, mixed mode, sharing)

My Maven version: mvn -version
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T17:41:47+01:00)
Maven home: /Users/lofidewanto/Applications/apache-maven-3.3.9
Java version: 12, vendor: AdoptOpenJDK
Java home: /Library/Java/JavaVirtualMachines/adoptopenjdk-12.jdk/Contents/Home
Default locale: de_DE, platform encoding: UTF-8
OS name: "mac os x", version: "10.16", arch: "x86_64", family: "mac"

What Java and Maven version are you using?

Thanks.

lofid...@gmail.com

unread,
May 2, 2021, 3:24:52 PM5/2/21
to GWT Users
Sorry here is the link of the project: https://github.com/ibaca/gsg-hello-app 

Just download and unzip and build it just like my project above... Does this project give the same error?

lofid...@gmail.com

unread,
May 2, 2021, 3:33:08 PM5/2/21
to GWT Users
I think this is the problem:

TBroyer Maven plugin with the extensions using the gwt-app packaging needs to be configured at the 
...
<build>
    <plugins>
        <plugin>
...

<build>
<plugins>

<plugin>
<groupId>net.ltgt.gwt.maven</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>1.0.0</version>
<extensions>true</extensions>
<configuration>
<moduleName>me.App</moduleName>
<skipModule>true</skipModule>
</configuration>
</plugin>

In your example above it was defined at 
...
<pluginManagement>
     <plugins>
           <plugin>
...

<pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
<plugins>
<!-- clean lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle -->
<plugin>
<groupId>net.ltgt.gwt.maven</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>1.0.0</version>
<extensions>true</extensions>
<configuration>

The TBroyer plugin needs to be defined at the "build plugins" and not "pluginManagement plugins"

Hope this helps.

lofid...@gmail.com

unread,
May 2, 2021, 3:42:01 PM5/2/21
to GWT Users
BTW, I never use the packaging type (as you can see in my example above)...

likejudo

unread,
May 2, 2021, 3:45:05 PM5/2/21
to GWT Users
Yes! thank you. I moved the plugin to build. It works now.

lofid...@gmail.com

unread,
May 2, 2021, 3:51:00 PM5/2/21
to GWT Users
Great 👍 Have fun... and again you can still follow the tutorial here: http://www.gwtproject.org/doc/latest/tutorial/gettingstarted.html

What different is just the "build tool" and therefore the "project structure". You have a much modern style using Maven GWT plugin from TBroyer... Still you also can use the older Maven GWT Mojo plugin... or also Ant like in the tutorial above... But this is really old 😅

Enjoy!

likejudo

unread,
May 2, 2021, 7:35:28 PM5/2/21
to GWT Users
Yes, I will need to follow the GWT tutorial because I have to write a UI with  tabs and combo boxes and buttons and panels using GWT and Mojo Maven plugin.
I am wondering why those in charge of GWT Project do not update the project docs with this better way you all have here.
Even the Eclipse plugin uses the older version of 2.8.1

likejudo

unread,
May 2, 2021, 8:22:31 PM5/2/21
to GWT Users
for debugging, the tutorial says: "... should see the Java file in the browser"
I do not see it at all - only JS files.

On Sunday, May 2, 2021 at 2:51:00 PM UTC-5 lofid...@gmail.com wrote:

lofid...@gmail.com

unread,
May 3, 2021, 9:40:46 AM5/3/21
to GWT Users
<quote>
I am wondering why those in charge of GWT Project do not update the project docs with this better way you all have here.
Even the Eclipse plugin uses the older version of 2.8.1
</quote>

Yes, you are right... Someone has to take care of that. I'll wait for my next holidays to update the docs... Actually I already made a clone but never managed to work on that part... ;-)

<quote>
for debugging, the tutorial says: "... should see the Java file in the browser"
I do not see it at all - only JS files.
</quote>

Did you try in Google Chrome like in this description? https://github.com/lofidewanto/gwt-boot-sample-basic --- Step 3 - Debug the App in your Browser

likejudo

unread,
May 3, 2021, 12:13:51 PM5/3/21
to GWT Users
Ok, I did not realize the Java file was under sourcemaps. It works now. Thanks,

lofid...@gmail.com

unread,
May 3, 2021, 12:38:05 PM5/3/21
to GWT Users
Great, have fun... and give us your feedback here to see whether GWT fits your requirements... ;-)

likejudo

unread,
May 6, 2021, 2:32:48 PM5/6/21
to GWT Users
I implemented Stockwatcher tutorial using Maven, following the hello app from Lofi and Ibaca's tuorials.
Now I want to implement the server side part of the tutorial. 
In my pom.xml I have
<packaging>gwt-app</packaging>

Do I need to change it to war?

<packaging>war</packaging>

Will that affect things?

lofid...@gmail.com

unread,
May 6, 2021, 3:17:11 PM5/6/21
to GWT Users
OK, now the server part 😉👍

For the server part you can just build a standard server project. You should build a new Maven server project. So if you are finished with the client project, just leave it like that... and build a new Maven server project.

For the server part you have some choices:
  • Spring Boot webapp
  • JakartaEE webapp with Tomcat / Jetty
  • Quarkus, Micronaut
  • PHP
  • NodeJS
  • ASP.NET
  • ...
If you want to use Java and Spring Boot you can just build a new Maven Spring Boot project with Spring Initialzr: https://start.spring.io
 
After that you need to take care of the communication between web browser client with GWT,  which you've done before and the Spring Boot server part... remember this is a "remote call" since your web browser is on a different machine than your Spring Boot server.

Your choices: 
Today everyone use REST but IMHO GWT RPC is very nice for Java developers.

REST example using Domino REST: https://github.com/gwtboot/domino-rest-enum-date
Here you can see 3 Maven projects: "client", "api" and "server". So far you've done the "client" and now you need the "server" and "api" (also called "shared", because this project is shared between "client "and "server").

Using GWT RPC is actually quite the same. You also need api / shared and server but you will use standard Servlet GWT / RPC instead of REST JSON.

If you need the structure for GWT RPC with Spring Boot just tell me... I have no demo available, but could do this easily.

Another way is just to use JakartaEE web app with Tomcat or Jetty. In this case you could use the TBroyer Maven Archetype to create the project structure: https://github.com/tbroyer/gwt-maven-archetypes

Or you also could use the Maven Archetype GWT Spring Boot from Frank: https://github.com/NaluKit/gwt-maven-springboot-archetype to create the project structure for Spring Boot and GWT. Actually similar to my GWT Spring Boot example above but still different in how it works together...

That's a lot alternatives, ahh... I have to admit, that makes the introduction in GWT a bit difficult because of the alternatives...

My way was and is: 
  • Separate the client, api / shared and server as Maven projects / modules 
  • Build the server part completely independent of GWT like I showed above
  • Build the communication between them with the alternatives above
  • ... and always remember: the result of GWT transpiler is JavaScript, so you could always take the JavaScript with its resources and "copy" it to your server part, so it will be served from your server part. 
  • ... but still remember: JavaScript runs on web browser so you always have remote call to your server part.
Hope this helps,
Lofi

likejudo

unread,
May 6, 2021, 5:17:44 PM5/6/21
to GWT Users
Thank you for your reply.
I need to build the client and server and package as a war using tomcat or jetty. I don't want a separate Spring Boot server.
The Stockbroker tutorial had both server and client in one war file.
Perhaps I should just manually create the war, WEB-INF folders and then change the pom.xml packaging to war - will that work?
As always, appreciate your help.

lofid...@gmail.com

unread,
May 6, 2021, 5:24:07 PM5/6/21
to GWT Users
Then just do this Maven archetype from TBroyer:

mvn archetype:generate -DarchetypeGroupId=net.ltgt.gwt.archetypes -DarchetypeVersion=LATEST -DarchetypeArtifactId=modular-webapp


and then take a look here how to start: https://github.com/tbroyer/gwt-maven-archetypes

......
Start the development mode

Change directory to your generated project and issue the following commands:

  1. In one terminal window: mvn gwt:codeserver -pl *-client -am
  2. In another terminal window: mvn jetty:run -pl *-server -am -Denv=dev

Or if you'd rather use Tomcat than Jetty, use mvn tomcat7:run instead of mvn jetty:run.

Note that the -pl and -am are not strictly necessary, they just tell Maven not to build the client module when you're dealing with the server one, and vice versa.

........

Hope this helps,
Lofi

likejudo

unread,
May 7, 2021, 8:52:05 AM5/7/21
to GWT Users
In the end I have to use the employer repository for my project which does not have the Broyer plugin.
It only has the Mojo Codehaus Maven plugin. I hope the Mojo plugin will be able to do similar.
I am guessing that perhaps companies are reluctant to use the Broyer plugin because it is private and not from an organization like Codehaus which will support their plugin.


lofid...@gmail.com

unread,
May 7, 2021, 11:01:48 AM5/7/21
to GWT Users
Yes, I won't recommend but it also has an archetype: https://gwt-maven-plugin.github.io/gwt-maven-plugin/user-guide/archetype.html

But again, better to separate the Maven projects "client" / "api" or "shared" / "server" instead of putting them together in one Maven project like the example from the archetype (see the screenshot in that page)...

Actually Maven plugin from TBroyer is also available at Maven Central, the same as the Mojo Codehaus Maven plugin... So your company just need to add "Maven Central" in their repository (Nexus or whatever).

I actually wonder, why doesn't your company integrate Maven Central in their repository... because Maven Central is very trustful. A lot of Java libraries like Tomcat, Jetty and etc. come from Maven Central...

Hope this helps.
Lofi

lofid...@gmail.com

unread,
May 7, 2021, 11:10:47 AM5/7/21
to GWT Users
... The problem I always encounter is when the libs don't exist in Maven Central Release Repos like my experience here:

likejudo

unread,
May 7, 2021, 12:16:32 PM5/7/21
to GWT Users
Thank you, I checked again and I see it is available now in Nexus!

likejudo

unread,
May 7, 2021, 12:24:45 PM5/7/21
to GWT Users
"But again, better to separate the Maven projects "client" / "api" or "shared" / "server" instead of putting them together in one Maven project like the example from the archetype (see the screenshot in that page)..."

My employer deploys it as a single war file.
On Friday, May 7, 2021 at 10:01:48 AM UTC-5 lofid...@gmail.com wrote:

lofid...@gmail.com

unread,
May 7, 2021, 1:15:59 PM5/7/21
to GWT Users
<quote>
My employer deploys it as a single war file.
</quote>

yes, this is not a problem.

Development time:
  • In the development you have 3 Maven projects
  • You starts 2 Java processes: one for GWT client and one for the server
Deployment time / production time:
  • You only have one file: war (Webapp) or jar (Spring Boot), because the result of GWT is JavaScript and you copy it into the server part (Webapp)
  • You only start one Java process
So your amount of Maven projects has nothing to do with your deployment file.

Hope this helps
Lofi

likejudo

unread,
May 13, 2021, 4:07:36 PM5/13/21
to GWT Users
I added the code to get data from the server using Asynchronous Callbacks (and log the error) and am surprised to find it gives a 404 error.
I had moved the code into a class ResponseFromServerPanel.
I don't know what I am missing.

Elf_g$ @ ConsoleLogger.java:33
:8888/stockwatcher.StockWatcher/stockPrices:1 Failed to load resource: the server responded with a status of 404 (Not Found)
ConsoleLogger.java:33 ERROR!!! com.google.gwt.user.client.rpc.StatusCodeException: 404 Not Found <html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>Error 404 Not Found</title>
</head>
<body><h2>HTTP ERROR 404</h2>
<p>Problem accessing /stockwatcher.StockWatcher/stockPrices. Reason:
<pre>    Not Found</pre></p><hr><i><small>Powered by Jetty://</small></i><hr/>

</body>
</html>

Chrome browser developer tools console

Elf_g$ @ ConsoleLogger.java:33
XMLHttpRequest.java:305 POST http://localhost:8888/stockwatcher.StockWatcher/stockPrices 404 (Not Found)
$Md_g$ @ XMLHttpRequest.java:305
ckc_g$ @ RequestBuilder.java:418
lkc_g$ @ RequestBuilder.java:242
o3c_g$ @ RemoteServiceProxy.java:372
L3c_g$ @ RemoteServiceProxy.java:74
Dof_g$ @ StockPriceService_Proxy.java:32
Pnf_g$ @ ResponseFromServerPanel.java:157
Vnf_g$ @ ResponseFromServerPanel.java:68
vb_g$ @ Timer.java:135
(anonymous) @ Timer.java:139
xI_g$ @ Impl.java:309
AI_g$ @ Impl.java:368
(anonymous) @ Impl.java:78
ConsoleLogger.java:33 ERROR!!! com.google.gwt.user.client.rpc.StatusCodeException: 404 Not Found <html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>Error 404 Not Found</title>
</head>
<body><h2>HTTP ERROR 404</h2>
<p>Problem accessing /stockwatcher.StockWatcher/stockPrices. Reason:
<pre>    Not Found</pre></p><hr><i><small>Powered by Jetty://</small></i><hr/>

</body>
</html>

Server console

"C:\Program Files\Java\jdk-11.0.10\bin\java.exe" -Dmaven.multiModuleProjectDirectory=C:\Users\user\Documents\Learn\GWT\StockWatcher "-Dmaven.home=C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2020.3.2\plugins\maven\lib\maven3" "-Dclassworlds.conf=C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2020.3.2\plugins\maven\lib\maven3\bin\m2.conf" "-Dmaven.ext.class.path=C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2020.3.2\plugins\maven\lib\maven-event-listener.jar" "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2020.3.2\lib\idea_rt.jar=61479:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2020.3.2\bin" -Dfile.encoding=UTF-8 -classpath "C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2020.3.2\plugins\maven\lib\maven3\boot\plexus-classworlds-2.6.0.jar;C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2020.3.2\plugins\maven\lib\maven3\boot\plexus-classworlds.license" org.codehaus.classworlds.Launcher -Didea.version=2021.1.1 net.ltgt.gwt.maven:gwt-maven-plugin:1.0.0:devmode
[INFO] Scanning for projects...
[INFO] 
[INFO] ---------------------< stockwatcher:StockWatcher >----------------------
[INFO] Building StockWatcher HEAD-SNAPSHOT
[INFO] ------------------------------[ gwt-app ]-------------------------------
[INFO] 
[INFO] >>> gwt-maven-plugin:1.0.0:devmode (default-cli) > process-classes @ StockWatcher >>>
[INFO] 
[INFO] --- gwt-maven-plugin:1.0.0:enforce-encoding (default-enforce-encoding) @ StockWatcher ---
[INFO] 
[INFO] --- gwt-maven-plugin:1.0.0:add-super-sources (default-add-super-sources) @ StockWatcher ---
[INFO] 
[INFO] --- gwt-maven-plugin:1.0.0:add-test-super-sources (default-add-test-super-sources) @ StockWatcher ---
[INFO] 
[INFO] --- gwt-maven-plugin:1.0.0:generate-module (default-generate-module) @ StockWatcher ---
[INFO] 
[INFO] --- maven-resources-plugin:3.0.2:resources (default-resources) @ StockWatcher ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\Users\user\Documents\Learn\GWT\StockWatcher\src\main\resources
[INFO] skip non existing resourceDirectory C:\Users\user\Documents\Learn\GWT\StockWatcher\src\main\super
[INFO] 
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ StockWatcher ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] <<< gwt-maven-plugin:1.0.0:devmode (default-cli) < process-classes @ StockWatcher <<<
[INFO] 
[INFO] 
[INFO] --- gwt-maven-plugin:1.0.0:devmode (default-cli) @ StockWatcher ---
[INFO] Super Dev Mode starting up
[INFO]    workDir: C:\Users\user\Documents\Learn\GWT\StockWatcher\target\gwt\devmode\work
[WARNING] 2021-05-13 14:38:07.107:INFO::main: Logging initialized @1464ms
[INFO]    Loading Java files in stockwatcher.StockWatcher.
[INFO]    Module setup completed in 11059 ms
[WARNING] 2021-05-13 14:38:17.745:INFO:oejs.Server:main: jetty-9.2.14.v20151106
[WARNING] 2021-05-13 14:38:17.772:INFO:oejsh.ContextHandler:main: Started o.e.j.s.ServletContextHandler@419ae2fd{/,null,AVAILABLE}
[WARNING] 2021-05-13 14:38:17.810:INFO:oejs.ServerConnector:main: Started ServerConnector@4c64e6ee{HTTP/1.1}{127.0.0.1:9876}
[WARNING] 2021-05-13 14:38:17.810:INFO:oejs.Server:main: Started @12163ms
[INFO] 
[INFO] The code server is ready at http://127.0.0.1:9876/
[WARNING] 2021-05-13 14:38:17.906:INFO:oejs.Server:main: jetty-9.2.14.v20151106
[WARNING] 2021-05-13 14:38:18.062:INFO:oejsh.ContextHandler:main: Started c.g.g.d.s.j.WebAppContextWithReload@5af10{/,file:/C:/Users/user/Documents/Learn/GWT/StockWatcher/target/gwt/devmode/war/,AVAILABLE}{C:\Users\user\Documents\Learn\GWT\StockWatcher\target\gwt\devmode\war}
[WARNING] 2021-05-13 14:38:18.062:INFO:oejs.ServerConnector:main: Started ServerConnector@312ccd51{HTTP/1.1}{127.0.0.1:8888}
[WARNING] 2021-05-13 14:38:18.062:INFO:oejs.Server:main: Started @12422ms
[INFO] GET /recompile/stockwatcher.StockWatcher
[INFO]    Job stockwatcher.StockWatcher_1_0
[INFO]       starting job: stockwatcher.StockWatcher_1_0
[INFO]       binding: user.agent=safari
[INFO]       Compiling module stockwatcher.StockWatcher
[INFO]          Unification traversed 657 fields and methods and 282 types. 2 are considered part of the current module and 11 had all of their fields and methods traversed.
[INFO]          Compiling 1 permutation
[INFO]             Compiling permutation 0...
[INFO]             Linking per-type JS with 2 new/changed types.
[INFO]             Source Maps Enabled
[INFO]          Compile of permutations succeeded
[INFO]          Compilation succeeded -- 1.690s
[INFO]       Linking into C:\Users\user\Documents\Learn\GWT\StockWatcher\target\gwt\devmode\work\stockwatcher.StockWatcher\compile-2\war\stockwatcher.StockWatcher; Writing extras to C:\Users\user\Documents\Learn\GWT\StockWatcher\target\gwt\devmode\work\stockwatcher.StockWatcher\compile-2\extras\stockwatcher.StockWatcher
[INFO]          Link succeeded
[INFO]          Linking succeeded -- 0.370s
[INFO]       2.607s total -- Compile completed
[INFO] GET /sourcemaps/stockwatcher.StockWatcher/3D0791663BC1DB0FD750DDEC8850522B_sourcemap.json
[INFO]    sent source map for module 'stockwatcher.StockWatcher' in 51 ms


Module

<module>
    <inherits name="com.google.gwt.user.User"/>
    <entry-point class="stockwatcher.client.StockWatcher"/>
    <inherits name='com.google.gwt.user.theme.standard.Standard'/>
    <!--<source path="client"/>-->
    <!--<public path="public"/>-->
</module>

likejudo

unread,
May 13, 2021, 6:43:52 PM5/13/21
to GWT Users
I changed

package stockwatcher.client;

import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;

@RemoteServiceRelativePath("")
public interface StockPriceService extends RemoteService {

StockPrice[] getPrices(String[] symbols);
}

and

now I got past that error but get a

ConsoleLogger.java:33 ERROR!!! com.google.gwt.user.client.rpc.InvocationException: <!DOCTYPE html>
<html>
<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <link type="text/css" rel="stylesheet" href="StockWatcher.css">
    <title>Stock Watcher UI</title>
    <script type="text/javascript" language="javascript" src="stockwatcher.StockWatcher.nocache.js"></script>
</head>
<body>
<h1>Stock Watcher UI</h1>
<div id="stockList"></div>
<iframe src="javascript:''" id="__gwt_historyFrame" tabIndex='-1' style="position:absolute;width:0;height:0;border:0"></iframe>
<noscript>
    <div style="width: 22em; position: absolute; left: 50%; margin-left: -11em; color: red; background-color: white; border: 1px solid red; padding: 4px; font-family: sans-serif">
        Your web browser must have JavaScript enabled
        in order for this application to display correctly.
    </div>
</noscript>
</body>
</html> from StockPriceService_Proxy.getPrices
Elf_g$ @ ConsoleLogger.java:33
27ConsoleLogger.java:33 ERROR!!! com.google.gwt.user.client.rpc.InvocationException: <!DOCTYPE html>
<html>
<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <link type="text/css" rel="stylesheet" href="StockWatcher.css">
    <title>Stock Watcher UI</title>
    <script type="text/javascript" language="javascript" src="stockwatcher.StockWatcher.nocache.js"></script>
</head>
<body>
<h1>Stock Watcher UI</h1>
<div id="stockList"></div>
<iframe src="javascript:''" id="__gwt_historyFrame" tabIndex='-1' style="position:absolute;width:0;height:0;border:0"></iframe>
<noscript>
    <div style="width: 22em; position: absolute; left: 50%; margin-left: -11em; color: red; background-color: white; border: 1px solid red; padding: 4px; font-family: sans-serif">
        Your web browser must have JavaScript enabled
        in order for this application to display correctly.
    </div>
</noscript>
</body>
</html> from StockPriceService_Proxy.getPrices
Elf_g$ @ ConsoleLogger.java:33
NRe_g$ @ SimpleConsoleLogHandler.java:36
aRe_g$ @ Logger.java:312
_Qe_g$ @ Logger.java:302
wRe_g$ @ Logger.java:236
vRe_g$ @ Logger.java:227
ERe_g$ @ Logger.java:178
jof_g$ @ ResponseFromServerPanel.java:148
T3c_g$ @ RequestCallbackAdapter.java:237
qjc_g$ @ Request.java:250
ykc_g$ @ RequestBuilder.java:412
(anonymous) @ XMLHttpRequest.java:329
xI_g$ @ Impl.java:309
AI_g$ @ Impl.java:368
(anonymous) @ Impl.java:78
XMLHttpRequest.send (async)
$Md_g$ @ XMLHttpRequest.java:305
ckc_g$ @ RequestBuilder.java:418
lkc_g$ @ RequestBuilder.java:242
o3c_g$ @ RemoteServiceProxy.java:372
L3c_g$ @ RemoteServiceProxy.java:74
Dof_g$ @ StockPriceService_Proxy.java:32
Pnf_g$ @ ResponseFromServerPanel.java:157
Vnf_g$ @ ResponseFromServerPanel.java:68
vb_g$ @ Timer.java:135
(anonymous) @ Timer.java:139
xI_g$ @ Impl.java:309
AI_g$ @ Impl.java:368
(anonymous) @ Impl.java:78

likejudo

unread,
May 13, 2021, 8:50:26 PM5/13/21
to GWT Users
I have pushed my code to github https://github.com/1dropaflame/StockWatcher

lofid...@gmail.com

unread,
May 15, 2021, 11:17:19 AM5/15/21
to GWT Users
I'll check it out...

Anil and Rita Philip

unread,
May 15, 2021, 11:51:14 AM5/15/21
to google-we...@googlegroups.com
Thanks, I joined the GWT discussion at Gitter

--
You received this message because you are subscribed to a topic in the Google Groups "GWT Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-web-toolkit/TclImrErWMY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-web-tool...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit/016a5286-d86d-4c55-bbef-82736670f2e4n%40googlegroups.com.

likejudo

unread,
May 15, 2021, 1:01:52 PM5/15/21
to GWT Users

lofid...@gmail.com

unread,
May 15, 2021, 2:05:25 PM5/15/21
to GWT Users
Hi likejudo,

I cloned your repository and changed things to reflect the GWT Maven plugin from TBroyer. Here is my cloned repo:

https://github.com/lofidewanto/stockwatcher

I updated the README...

Hope this helps,
Lofi

lofid...@gmail.com

unread,
May 15, 2021, 2:08:31 PM5/15/21
to GWT Users

This example is just using the GWT Maven plugin from TBroyer with GWT RPC / Simple Jetty on the server...

lofid...@gmail.com

unread,
May 15, 2021, 2:11:42 PM5/15/21
to GWT Users
In your example to call to the Spring Boot REST you need a REST from GWT and not GWT RPC call...

lofid...@gmail.com

unread,
May 15, 2021, 3:15:18 PM5/15/21
to GWT Users
If you need also to make the Spring Boot REST example working with the GWT GUI, just tell me, I could make a small rework to your "client" part... 

Also just tell me whether you need to use Domino REST or RestyGWT to access the REST on Spring Boot... I actually have 2 examples in this:

1) https://github.com/gwtboot/restygwt-enum-date
2) https://github.com/gwtboot/domino-rest-enum-date

Hope this helps...

likejudo

unread,
May 15, 2021, 3:34:56 PM5/15/21
to GWT Users
" you need also to make the Spring Boot REST example working with the GWT GUI, just tell me, I could make a small rework to your "client" part...   "
Yes, please. Much appreciated.

lofid...@gmail.com

unread,
May 15, 2021, 4:13:27 PM5/15/21
to GWT Users
OK, wait...

likejudo

unread,
May 15, 2021, 9:42:49 PM5/15/21
to GWT Users
Is it better to just stick with the Nalu archetype since it has Spring Boot?
I generated it and thinking of moving the stockwatcher code into it.

lofid...@gmail.com

unread,
May 16, 2021, 7:59:30 AM5/16/21
to GWT Users
So I managed to build the StockWatcher with Spring Boot and REST with Domino REST.


I updated both examples README: https://github.com/lofidewanto/stockwatcher

Two things don't work correctly in stockwatcher-springboot

1. I try to use also the GWT RPC call in Spring Boot, so you can use alternatively REST and GWT RPC. But the RPC part doesn't work yet...




But I think this is possible with REST as weil... I'll ask Domino Community.

Hope this helps!

lofid...@gmail.com

unread,
May 16, 2021, 8:24:17 AM5/16/21
to GWT Users
@likejudo: Sorry I checked in the actual code with Java Array so that I could ask in the Domino Community: https://gitter.im/DominoKit/domino

If you want to try now, you need to edit following classes:


You need to change from Array to ArrayList<String> as param...

That's it...

likejudo

unread,
May 16, 2021, 8:44:22 AM5/16/21
to GWT Users
Dr Lofi,
Thank you. I don't know what Domino REST is. 
Can it be done using plain REST? 
I don't know if Domino REST will be allowed by my employer since license fees will have to be negotiated etc. and will take a lot of paperwork to get permission and be hosted in our Nexus Repo.

lofid...@gmail.com

unread,
May 16, 2021, 9:20:44 AM5/16/21
to GWT Users
So now I change just to String and make the params manually... and it works just similar to GWT RPC.

I just need to make the GWT RPC also runnable in Spring Boot... so you can use both of them :-)


Domino REST ist a simple framework for working with REST on the client (JavaScript) part. All DominoUI, GWT Boot and co. are in Maven Central, so if you have an access to Maven Central you could use them easily...

You have to remember: 
- The result of your client part is  always JavaScript. 

You surely could use a simple HTTP call like this with Fetch APIs: https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch but I won't do this if you need to call some more REST APIs...

Hope this helps.

likejudo

unread,
May 16, 2021, 11:43:44 AM5/16/21
to GWT Users
Dr Lofi, 
What if I just use Nalu project - you had shared the link several emails ago. I am able to run their Greeting Service example.
Will there be any issues?

lofid...@gmail.com

unread,
May 16, 2021, 11:54:51 AM5/16/21
to GWT Users
Yes that also fine.

The main thing: use the TBroyer Maven plugin instead the old one or Eclipse plugin.

If you want to use REST, you should take a look at this example: https://github.com/lofidewanto/stockwatcher/tree/master/stockwatcher-springboot

Have fun!

likejudo

unread,
May 16, 2021, 12:26:00 PM5/16/21
to GWT Users
Dr Lofi,
Thank you for your help! I will keep you updated.

Thomas Broyer

unread,
May 17, 2021, 8:09:21 AM5/17/21
to GWT Users
On Sunday, May 16, 2021 at 5:54:51 PM UTC+2 lofid...@gmail.com wrote:
Yes that also fine.

The main thing: use the TBroyer Maven plugin instead the old one or Eclipse plugin.

Except, he said several times that he couldn't: “ I don't have a choice. I have to use what is in my employer's repository.”

likejudo

unread,
May 17, 2021, 10:32:00 AM5/17/21
to GWT Users
@TBroyer, @Lofi
When I looked in my employer's Nexus repo searching for "gwt-maven-plugin" I found only the Mojo Codehaus plugin.
So I assumed that we did not have it.
A few days ago, I searched instead for "net.ltgt.gwt.maven" and found it! :)

lofid...@gmail.com

unread,
May 17, 2021, 12:44:33 PM5/17/21
to GWT Users
Yeah, I think your Nexus is connected to Maven Central... So you would have everything which is already uploaded at Maven Central...

Other than Maven Central is difficult...

likejudo

unread,
May 17, 2021, 12:58:16 PM5/17/21
to GWT Users
Dr Lofi,
I need to make a file uploader for a spring boot server and was looking at the generated code. I see that the Impl extends  RemoteServiceServlet.
The example for file uploads however, has its own controller.


@Controller public class FileUploadController {
.....
@PostMapping("/") public String handleFileUpload(@RequestParam("file") MultipartFile file, RedirectAttributes redirectAttributes) {
 
NaluKit has the servicing method in the Impl.


@WebServlet("/stockwatcher/greet")
public class GreetingServiceImpl extends RemoteServiceServlet implements GreetingService {

I am confused which to follow.

Dr. Lofi Dewanto

unread,
May 17, 2021, 1:17:58 PM5/17/21
to google-we...@googlegroups.com
You need to decide first, what communication protocol you want to use between your Web browser (client) and your Spring Boot (server):


--
You received this message because you are subscribed to a topic in the Google Groups "GWT Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-web-toolkit/TclImrErWMY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-web-tool...@googlegroups.com.

likejudo

unread,
May 17, 2021, 4:00:12 PM5/17/21
to GWT Users
The REST example uses Postman as client, not GWT.
I need to use Spring Boot for server, and GWT for client. REST is fine if I don't have to add new libraries.
(I want to avoid adding libraries like Domino to keep it simple and not worry about yet learning another tool, availability in my repo, and license).

Working in baby steps, I want to send a file from the GWT client to SpringBoot server.

I added a multipart file parameter, but then get a compile error


@WebServlet("/stockwatcher/greet")
public class GreetingServiceImpl extends RemoteServiceServlet implements GreetingService {
public GreetingResponse greetServer(@RequestParam("file") MultipartFile file,
RedirectAttributes redirectAttributes) throws IllegalArgumentException {
// Verify that the input is valid.
System.out.println("greetServer is called!");
I tried changing the GreetingService also but also get a compile error:

[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ StockWatcher-shared ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 4 source files to C:\Users\User\Documents\Learn\GWT\Nalu\StockWatcher\StockWatcher-shared\target\classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /C:/Users/User/Documents/Learn/GWT/Nalu/StockWatcher/StockWatcher-shared/src/main/java/stockwatcher/GreetingService.java:[11,38] cannot find symbol
  symbol:   class MultipartFile
  location: interface stockwatcher.GreetingService
[ERROR] /C:/Users/User/Documents/Learn/GWT/Nalu/StockWatcher/StockWatcher-shared/src/main/java/stockwatcher/GreetingService.java:[11,58] cannot find symbol
  symbol:   class RedirectAttributes
  location: interface stockwatcher.GreetingService
[INFO] 2 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for StockWatcher 1.0-SNAPSHOT:
[INFO]
[INFO] StockWatcher ....................................... SUCCESS [  0.075 s]
[INFO] StockWatcher-shared ................................ FAILURE [  0.835 s]
[INFO] StockWatcher-client ................................ SKIPPED
[INFO] StockWatcher-server ................................ SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  1.914 s
[INFO] Finished at: 2021-05-17T14:50:09-05:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project StockWatcher-shared: Compilation failure: Compilation failure:
[ERROR] /C:/Users/User/Documents/Learn/GWT/Nalu/StockWatcher/StockWatcher-shared/src/main/java/stockwatcher/GreetingService.java:[11,38] cannot find symbol
[ERROR]   symbol:   class MultipartFile
[ERROR]   location: interface stockwatcher.GreetingService
[ERROR] /C:/Users/User/Documents/Learn/GWT/Nalu/StockWatcher/StockWatcher-shared/src/main/java/stockwatcher/GreetingService.java:[11,58] cannot find symbol
[ERROR]   symbol:   class RedirectAttributes
[ERROR]   location: interface stockwatcher.GreetingService
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <args> -rf :StockWatcher-shared

lofid...@gmail.com

unread,
May 17, 2021, 4:06:44 PM5/17/21
to GWT Users
If you want to use REST, you should use Domino REST simple framework for GWT, see: https://github.com/DominoKit/domino-rest


If you cannot add Domino REST, we need to use a simple JavaScript API but I won't recommend that to you... Maybe you check in your Nexus first whether you can find Domino REST? It is also in Maven Central...


GWT 2.9.0.

Thanks

likejudo

unread,
May 17, 2021, 4:41:24 PM5/17/21
to GWT Users
Unfortunately, I do not find it in our Nexus.
In the keyword search box, I searched for  org.dominokit and then I searched for domino-rest-client.
"No results found".

lofid...@gmail.com

unread,
May 17, 2021, 4:50:44 PM5/17/21
to GWT Users
Can you find following lib?

<dependency>
    <groupId>com.google.elemental2</groupId>
    <artifactId>elemental2-core</artifactId>
</dependency>

Without this one it is not possible - at least it doesn't make sense for me - to work with REST on GWT / JavaScript...

lofid...@gmail.com

unread,
May 17, 2021, 4:52:33 PM5/17/21
to GWT Users
Ahh forget... You need to run your local mvn first... Maybe you are the first person who will download the Domino libs... 


and run 
mvn clean install

likejudo

unread,
May 17, 2021, 5:53:58 PM5/17/21
to GWT Users
If I understand correctly,
I will try that but I am not allowed to clone any repo from github nor downlead any software.
I have been doing this POC in my personal laptop, not my workspace at work.


likejudo

unread,
May 17, 2021, 7:01:38 PM5/17/21
to GWT Users
Dr Lofi,
What archetype did you use? I am not allowed to clone nor copy-paste code into my workspace. 
Can you please give me the "maven generate" command line you used?

Dr. Lofi Dewanto

unread,
May 18, 2021, 2:07:02 AM5/18/21
to google-we...@googlegroups.com
If you use Eclipse just create a new Maven project and add this dependency in the pom.xml

<dependency>
    <groupId>com.google.elemental2</groupId>
    <artifactId>elemental2-core</artifactId>
    <version>1.1.0</Version>
</dependency>

Then run mvn clean package

You can do the same with IntelliJ or VSC.

likejudo

unread,
May 18, 2021, 7:37:53 AM5/18/21
to GWT Users
IntelliJ.
Unfortunately, it gives an error that "com.google.elemental2: elemental2-core.pom:unknown" in the repo.

Dr. Lofi Dewanto

unread,
May 18, 2021, 9:28:42 AM5/18/21
to google-we...@googlegroups.com
Upps my mistake... "Version" is wrong --> "version"... here you are....

<dependency>
    <groupId>com.google.elemental2</groupId>
    <artifactId>elemental2-core</artifactId>
    <version>1.1.0</version>
</dependency>

likejudo

unread,
May 18, 2021, 9:57:09 AM5/18/21
to GWT Users
thanks :) It found elemental2 but gave an error on dominokit. I see it is a RC not a Release. Perhaps that version number is a problem?
Cannot resolve org.dominokit:domino-jackson-processor:1.0.0-RC1

likejudo

unread,
May 18, 2021, 10:00:20 AM5/18/21
to GWT Users

likejudo

unread,
May 18, 2021, 10:53:43 AM5/18/21
to GWT Users
Can I do it without REST and only SpringBoot?

lofid...@gmail.com

unread,
May 19, 2021, 3:30:08 AM5/19/21
to GWT Users

Or just google "gwt rpc upload file"
Message has been deleted
Message has been deleted
Message has been deleted

likejudo

unread,
May 19, 2021, 11:05:21 AM5/19/21
to GWT Users
Looking at the generated code in Nalukit, doPost has been overridden as final in RemoteServlet. This method will not work.

public abstract class AbstractRemoteServiceServlet extends HttpServlet {
protected transient ThreadLocal<HttpServletRequest> perThreadRequest;
protected transient ThreadLocal<HttpServletResponse> perThreadResponse;

public AbstractRemoteServiceServlet() {
}

public final void doPost(HttpServletRequest request, HttpServletResponse response) {

lofid...@gmail.com

unread,
May 20, 2021, 4:08:53 PM5/20/21
to GWT Users
Sorry didn't see your questions...

Did you manage to upload file using GWT RPC?

likejudo

unread,
May 20, 2021, 5:58:09 PM5/20/21
to GWT Users
Thanks. No, I have put that aside. I am trying to generate the project from Broyer's plugin but have problems. Have you seen this before? https://gitter.im/gwtproject/gwt
Reply all
Reply to author
Forward
0 new messages