Unable to find 'com/google/gwt/core/Core.gwt.xml' - what am I missing?

182 views
Skip to first unread message

mmo...@gmail.com

unread,
Feb 2, 2023, 11:16:58 AM2/2/23
to google-we...@googlegroups.com

I am trying to upgrade our project to use GWT 2.10  and the “new” GWT maven-plugin (by T. Broyer) for debugging (before we were on GWT 2.7 and the old plugin):

 

Meanwhile I am able to build the project. If I deploy the generated .war file to a Tomcat server the application runs OK. There are still a few rough edges but we are getting there.

Only if I try to run the code-server in order to be able to debug the application (I am using the maven goal “mvn gwt:codeserver” to start it) then I always get this output:

 

[INFO] --- gwt-maven-plugin:1.0.1:codeserver (default-cli) @ zhstregisterjp-parent ---

[INFO] Ignoring ch.zh.ksta.zhstregisterjp:zhstregisterjp-internal-services:jar:3.10-SNAPSHOT; neither a gwt-lib or jar:sources; Did you forget to use <type>gwt-lib</type> in the dependency declaration?

[INFO] Ignoring ch.zh.ksta.zhstregisterjp:zhstregisterjp-web-service-common:jar:3.10-SNAPSHOT; neither a gwt-lib or jar:sources; Did you forget to use <type>gwt-lib</type> in the dependency declaration?

[INFO] Ignoring ch.zh.ksta.zhstregisterjp:zhstregisterjp-sam-web-service:jar:3.10-SNAPSHOT; neither a gwt-lib or jar:sources; Did you forget to use <type>gwt-lib</type> in the dependency declaration?

[INFO] Ignoring ch.zh.ksta.zhstregisterjp:zhstregisterjp-c3-web-service:jar:3.10-SNAPSHOT; neither a gwt-lib or jar:sources; Did you forget to use <type>gwt-lib</type> in the dependency declaration?

[INFO] Ignoring ch.zh.ksta.zhstregisterjp:zhstregisterjp-c3adapter-web-service:jar:3.10-SNAPSHOT; neither a gwt-lib or jar:sources; Did you forget to use <type>gwt-lib</type> in the dependency declaration?

[INFO] Ignoring ch.zh.ksta.zhstregisterjp:zhstregisterjp-zhquest-web-service:jar:3.10-SNAPSHOT; neither a gwt-lib or jar:sources; Did you forget to use <type>gwt-lib</type> in the dependency declaration?

[INFO] Ignoring ch.zh.ksta.zhstregisterjp:zhstregisterjp-zhdokumente-web-service:jar:3.10-SNAPSHOT; neither a gwt-lib or jar:sources; Did you forget to use <type>gwt-lib</type> in the dependency declaration?

[INFO] Ignoring ch.zh.ksta.zhstregisterjp:zhstregisterjp-batch:jar:3.10-SNAPSHOT; neither a gwt-lib or jar:sources; Did you forget to use <type>gwt-lib</type> in the dependency declaration?

[INFO] Turning off precompile in incremental mode.

[INFO] Super Dev Mode starting up

[INFO]    workDir: D:\Projects\KStA_ZH_RegisterJP\code\application\target\gwt\codeserver

[INFO]    Loading inherited module 'ch.zh.ksta.zhstregisterjp.ZHStRegisterJPWeb'

[INFO]       Loading inherited module 'com.google.gwt.core.Core'

[INFO]          [ERROR] Unable to find 'com/google/gwt/core/Core.gwt.xml' on your classpath; could be a typo, or maybe you forgot to include a classpath entry for source?

 

Those .jar files it complains about at the begin contain parts of the application that contain no GWT code at all but I didn’t find a possibility to signal that to the plugin to silence these warnings, yet. But I think they are harmless.

 

However, the code-server then always dies with this dreaded Unable to find 'com/google/gwt/core/Core.gwt.xml' error.

However, gwt-dev-2.10.0.jar and gwt-user-2.10.0.jar are on the module’s dependency-list:

 

             …

             <dependency>

                    <groupId>com.google.gwt</groupId>

                    <artifactId>gwt-dev</artifactId>

             </dependency>

             <dependency>

                    <groupId>com.google.gwt</groupId>

                    <artifactId>gwt-user</artifactId>

             </dependency>

                             

      

and – if I dig into these .jars – the gwt-user-2.10.0.jar *does* contain that missing file: /com/google/gwt/core/Core.gwt.xml.

So, why can the code-server not locate it??? Any ideas?

 

 

Thomas Broyer

unread,
Feb 3, 2023, 5:54:02 AM2/3/23
to GWT Users
See https://tbroyer.github.io/gwt-maven-plugin/codeserver.html for the differences between gwt:compile and gwt:codeserver.
Here, because it looks like you have both server and client code in the same Maven project, I'd say this is because your gwt-user is in scope=provided so it's not available at runtime.
You can workaround this by reconfiguring the gwt:codeserver's classpathScope: https://tbroyer.github.io/gwt-maven-plugin/codeserver-mojo.html#classpathScope

To troubleshoot: run Maven with debug logs (mvn -X gwt:codeserver), the plugin will emit two lines starting with "Classpath: " and "Arguments: " respectively that you can inspect; and you'll also see debug logs from GWT. Also, turn on failOnError, maybe there was something earlier that caused that error.

Michael Moser

unread,
Feb 3, 2023, 11:25:00 AM2/3/23
to google-we...@googlegroups.com

Thanks a lot for the advice!

I ran the goal with the -X option and the mentioned lines read (the classpath it is endless, but I replaced the non-relevant parts here with «…»):

 

[DEBUG] Classpath: D:\Projects\KStA_ZH_RegisterJP\code\application\zhstregisterjp-web\target\registerjp\WEB-INF\classes; ... D:\m2repository\rjp\org\gwtproject\gwt-servlet\2.10.0\gwt-servlet-2.10.0.jar;D:\m2repository\rjp\org\gwtproject\gwt-dev\2.10.0\gwt-dev-2.10.0.jar; ...

[DEBUG] Arguments: com.google.gwt.dev.codeserver.CodeServer -nofailOnError -logLevel INFO -workDir D:\Projects\KStA_ZH_RegisterJP\code\application\target\gwt\codeserver -style DETAILED -launcherDir "D:\Program Files\Apache Software Foundation\Tomcat 8.5\webapps\registerjp\ZHStRegisterJPWeb" -allowMissingSrc -src D:\Projects\KStA_ZH_RegisterJP\code\application\zhstregisterjp-web\src\main\java -src D:\Projects\KStA_ZH_RegisterJP\code\application\zhstregisterjp-common\src\main\java -src D:\Projects\KStA_ZH_RegisterJP\code\application\zhstregisterjp-common\target\generated-sources ch.zh.ksta.zhstregisterjp.ZHStRegisterJPWeb

[INFO] Turning off precompile in incremental mode.

[INFO] Super Dev Mode starting up

[INFO]    workDir: D:\Projects\KStA_ZH_RegisterJP\code\application\target\gwt\codeserver

[INFO]    Loading inherited module 'ch.zh.ksta.zhstregisterjp.ZHStRegisterJPWeb'

[INFO]       Loading inherited module 'com.google.gwt.core.Core'

[INFO]          [ERROR] Unable to find 'com/google/gwt/core/Core.gwt.xml' on your classpath; could be a typo, or maybe you forgot to include a classpath entry for source?

 

But the gwt-user-2.10.0.jar is indeed NOT part of the classpath here and I don’t get, why!

As I mentioned: it’s part of the dependencies-list oft he module (as shown in my first mail). IMHO already that should suffice to make it appear in that classpath!

I also added a <classpathScope>test</classpathScope> to the plugin’s configuration as descibed in the codeserver goal’s description:

                 

                  <plugin>

                      <groupId>net.ltgt.gwt.maven</groupId>

                        <artifactId>gwt-maven-plugin</artifactId>

                        <executions>

                              <execution>

                                    <goals>

                                         <goal>compile</goal>

                                         <goal>test</goal>

                                         <goal>codeserver</goal>

                                    </goals>

                              </execution>

                        </executions>

                        <configuration>

                            <classpathScope>test</classpathScope>

                             

 

From the docs I’ld say, «test» is supposed to cover ALL scopes. So, why is the gwt-user-2.10.0.jar not part of the game here?

 

Thomas Broyer

unread,
Feb 3, 2023, 11:48:59 AM2/3/23
to GWT Users
Hard to tell without seeing the project.
From your logs, it actually looks like you have cleanly separated server/shared/client modules; in this case, configuration of the classpathScope needs to be done in the root POM, where the gwt:codeserver is called. Only the moduleName will be read from the submodule, nothing else (well, Maven dependencies as well, but nothing else from the plugin's configuration)

Michael Moser

unread,
Feb 3, 2023, 2:09:57 PM2/3/23
to google-we...@googlegroups.com
  • in this case, configuration of the classpathScope needs to be done in the root POM, where the gwt:codeserver is called.

 

Aaah! THAT was the magic bullet! Now it starts up ok!

 

Thanks such a lot! I guess I would never have found out!

 

Michael

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, 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/d5fefb72-e944-4cc0-a4cc-82258d33d8e9n%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages