'Throwable.HasJavaThrowable' has invalid name '?'.

65 views
Skip to first unread message

mmo

unread,
Jun 29, 2022, 1:10:09 PM6/29/22
to GWT Users
When compiling one of our GWT-based projects with the new GWT 2.10.0 I get:

...
[INFO] --- gwt-maven-plugin:2.10.0:compile (default) @ zhstregisterjp-web ---
[INFO] Compiling module ch.zh.ksta.zhstregisterjp.ZHStRegisterJPWebDevelopment
[INFO]    Ignored 5 units with compilation errors in first pass.
[INFO] Compile with -strict or with -logLevel set to DEBUG or WARN to see all errors.
[INFO]    Ignored 14 units with compilation errors in first pass.
[INFO] Compile with -strict or with -logLevel set to TRACE or DEBUG to see all errors.
[INFO]    Errors in com/google/gwt/emul/java/lang/Throwable.java
[INFO]       [ERROR] Line 344: 'Throwable.HasJavaThrowable' has invalid name '?'.

Pardon me?

Any hint or direction what I could do or search for here to get over this?

Michael Conrad

unread,
Jun 29, 2022, 4:28:02 PM6/29/22
to google-we...@googlegroups.com
I see the following in your stack trace.

It would probably help to track the issue down if you set the GWT compile to strict.

Jens

unread,
Jun 29, 2022, 5:05:06 PM6/29/22
to GWT Users
Yeah as Michael already said, I strongly encourage you to use "-strict" GWT compiler / DevMode parameter in all of your GWT projects and fix all GWT compile errors you are then seeing. We should have make that parameter the default setting long time ago. I really don't see any benefit of not using it.

The error you are seeing indicates that you have an old GWT 2.8.0 on your class path which is used for compilation. GWT 2.8.0 does not know anything about "*" or "?" as native JsInterop type names and thus disallows them. Both names have been implemented in GWT 2.8.1+ and have a special meaning. 


So use -strict to see GWT compilation errors that need to be fixed and check your classpath so that you really only have one GWT SDK version.

-- J.

mmo

unread,
Jun 30, 2022, 10:22:08 AM6/30/22
to GWT Users
Pardon my ignorance but I never had to dive very deeply into many of these GWT details and options, yet.

Is that "-strict" that Michael and you mention the same as setting:

                <artifactId>gwt-maven-plugin</artifactId>
                ...
                <configuration>
                    ...
                    <failOnError>true</failOnError>
                </configuration>
                ...
in a pom.xml? 
I searched for strict in the maven plugin's description and this seems to be the only match I found.

Anyway - after settings said option I got much more GWT compiler output and there are tons of error messages with the pattern "No source code is available for type <type>. did you forget to inherit a required module".
Unfortunately, the classes referenced are misc. stuff from com.google.gwt.user, com.google.common.collect,  org.apache.commons.collections, org.springframework.security.core, etc., i.e. all classes that I can not shift into the UI's shared or client folder. How can one make the sources of these classes known to the GWT compiler?

Michael Conrad

unread,
Jun 30, 2022, 11:04:22 AM6/30/22
to google-we...@googlegroups.com
How many of these libs are you thinking would need converting to JS for the client bundle?

At a glance, it really looks like you got a dependency chain fubar. The GWT client code should not have any kind of dependency to java.sql.DataSource as an example. It looks like you are trying to compile server side only code as a GWT dependency.

Thomas Broyer

unread,
Jul 1, 2022, 3:28:57 PM7/1/22
to GWT Users
On Thursday, June 30, 2022 at 4:22:08 PM UTC+2 mmo wrote:
Pardon my ignorance but I never had to dive very deeply into many of these GWT details and options, yet.

Is that "-strict" that Michael and you mention the same as setting:

                <artifactId>gwt-maven-plugin</artifactId>
                ...
                <configuration>
                    ...
                    <failOnError>true</failOnError>
                </configuration>
                ...
in a pom.xml? 
I searched for strict in the maven plugin's description and this seems to be the only match I found.

Yes, that's the same (the argument was initially called -strict and later renamed to -failOnError, with -strict kept as a alias so many keep using -strict, but the gwt-maven-plugin⋅s both have it as failOnError)
 
Anyway - after settings said option I got much more GWT compiler output and there are tons of error messages with the pattern "No source code is available for type <type>. did you forget to inherit a required module".
Unfortunately, the classes referenced are misc. stuff from com.google.gwt.user, com.google.common.collect,  org.apache.commons.collections, org.springframework.security.core, etc., i.e. all classes that I can not shift into the UI's shared or client folder. How can one make the sources of these classes known to the GWT compiler?

I'd rather say the <source> in your gwt.xml includes non-client code: https://www.gwtproject.org/doc/latest/DevGuideOrganizingProjects.html#DevGuidePathFiltering
Reply all
Reply to author
Forward
0 new messages