CodeServer looks for (not required?) source

93 views
Skip to first unread message

Gordan Krešić

unread,
Jan 10, 2021, 9:53:34 AM1/10/21
to GWT Users
When using SDM's Code Server, I get following error during initial load:

[ERROR] Could not find org.apache.commons.lang3.LocaleUtils in types
compiled from source. Is the source glob too strict?

That's it, no further reference which class depends on LocaleUtils. Is there
a way to increase log verbosity of code server?

Possibly relevant: "normal" GWT compile task works fine. Probably optimizer
strips some unused methods that causes problems for Code Server (which
doesn't do code pruning).

If it's relevant, I'm running CodeServer via steffenschaefer's
gwt-gradle-plugin, but not there, nor in official GWT docs do I find any
option for making Code Server more verbose:

http://www.gwtproject.org/doc/latest/DevGuideCompilingAndDebugging.html#SuperDevMode

https://github.com/steffenschaefer/gwt-gradle-plugin/blob/master/gwt-gradle-plugin/src/main/java/de/richsource/gradle/plugins/gwt/GwtSuperDevOptions.java

-gkresic.

Vassilis Virvilis

unread,
Jan 10, 2021, 11:40:21 AM1/10/21
to google-we...@googlegroups.com
AFAIK the reference is in the code you try to compile not in the GWT compiler per se...

  Vassilis

--
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/5586e08b-7076-643f-ce87-493a8c22c386%40steatoda.com.


--
Vassilis Virvilis

lofid...@gmail.com

unread,
Jan 10, 2021, 3:58:24 PM1/10/21
to GWT Users
Actually you have following options for the transpiler with Maven plugin. Maybe it is the same with the Gradle?


See the GWT Maven Plugin part...

<arg>-logLevel</arg>
<arg>INFO</arg>

<arg>-style</arg>
<arg>PRETTY</arg>

Hope this helps.

Gordan Krešić

unread,
Jan 10, 2021, 4:25:58 PM1/10/21
to google-we...@googlegroups.com
On 10. 01. 2021. 17:39, Vassilis Virvilis wrote:
> AFAIK the reference is in the code you try to compile not in the GWT
> compiler per se...

Not sure I understand - I didn't say that bug is in the compiler, just that
compiler doesn't see any problem with my code, while code server does.

Problem for sure is in my code, I just don't have any clue where to look
for. Last step would be to bisect commits, but I did many not-so-clean
commits in my project and dependent libraries, so that would be pretty time
consuming task. I was hoping someone have some trick up their sleeves :)

BTW, I could swear that I had similar problem many winters ago, but now I
can't remember how I solved that.

-gkresic.

Gordan Krešić

unread,
Jan 10, 2021, 4:29:06 PM1/10/21
to google-we...@googlegroups.com
On 10. 01. 2021. 21:58, lofid...@gmail.com wrote:
> Actually you have following options for the transpiler with Maven plugin.
> Maybe it is the same with the Gradle?
>
> <arg>-logLevel</arg>
> <arg>INFO</arg>

This changes log level for compiled code, not code server's output. Out of
despair I even tried changing this to ALL, but, of course, it didn't help.

> <arg>-style</arg>
> <arg>PRETTY</arg>

How this could be of any effect? It also affects only JS output, while my
problem is with Java input files.

-gkresic.

Vassilis Virvilis

unread,
Jan 10, 2021, 6:07:30 PM1/10/21
to google-we...@googlegroups.com
I have seen differences between code server and the compiler. Not sure if that was such a case.

I do remember however that the reference was in my java code thrown to the codeserver.

How about a grep org.apache.commons.lang3.LocaleUtils in your source code (classpath)?

Hope that helps.

--
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.


--
Vassilis Virvilis

Thomas Broyer

unread,
Jan 11, 2021, 3:29:46 AM1/11/21
to GWT Users
Fwiw, there are <logLevel> and <style> properties rather than using codeserverArgs: https://tbroyer.github.io/gwt-maven-plugin/codeserver-mojo.html

Thomas Broyer

unread,
Jan 11, 2021, 3:42:46 AM1/11/21
to GWT Users
On Sunday, January 10, 2021 at 10:29:06 PM UTC+1 Gordan Krešić wrote:
On 10. 01. 2021. 21:58, lofid...@gmail.com wrote:
> Actually you have following options for the transpiler with Maven plugin.
> Maybe it is the same with the Gradle?
>
> <arg>-logLevel</arg>
> <arg>INFO</arg>

This changes log level for compiled code, not code server's output.

No, it's the GWT compiler/codeserver/etc. log level.
Adjusting runtime's log level is done through a gwt.logging.logLevel <property> or -property.
 
Out of
despair I even tried changing this to ALL, but, of course, it didn't help.

Did it change the overall output? If not, then you didn't actually set it to ALL.

Gordan Krešić

unread,
Jan 11, 2021, 5:47:14 AM1/11/21
to google-we...@googlegroups.com
On 11. 01. 2021. 09:42, Thomas Broyer wrote:
> On Sunday, January 10, 2021 at 10:29:06 PM UTC+1 Gordan Krešić wrote:
>
> On 10. 01. 2021. 21:58, lofid...@gmail.com wrote:
> > Actually you have following options for the transpiler with Maven
> plugin.
> > Maybe it is the same with the Gradle?
> >
> > <arg>-logLevel</arg>
> > <arg>INFO</arg>
>
> This changes log level for compiled code, not code server's output.
>
> No, it's the GWT compiler/codeserver/etc. log level.
> Adjusting runtime's log level is done through a gwt.logging.logLevel
> <property> or -property.

Oops, my mistake. Gradle plugin I'm using has property named "logLevel" but
it look like it uses it only for configuring client level logging.

When I run CodeServer by hand and pass -logLevel it does give more detailed
output and indeed points me to right direction.

Thanks Thomas nad Lofi.

Unreletaed to this, but Thomas one more question if I may: can you see a
problem with folloging Gradle task:

task gwtCodeServerManual(type: JavaExec) {
main = 'com.google.gwt.dev.codeserver.CodeServer'
classpath += files(sourceSets.main.compileClasspath,
sourceSets.main.runtimeClasspath)
args += '-logLevel ALL'
args += '-bindAddress 0.0.0.0'
args += '-port 9877'
args += '-launcherDir war'
args += '-XmethodNameDisplayMode FULL'
args += 'com.steatoda.mole.gwt.Desk'
}

From --debug output it seems that it passes parameters properly, but
somehow CodeServer complains (here it complains with "Unknown argument:
-logLevel ALL", but it will complain on ANY parameter, whichever I define
first):

11:30:43.721 [INFO] [org.gradle.process.internal.DefaultExecHandle] Starting
process 'command '/usr/local/jdk1.8.0_251/bin/java''. Working directory:
/home/gkresic/Sources/mole Command: /usr/local/jdk1.8.0_251/bin/java
-Dfile.encoding=UTF-8 -Duser.country=US -Duser.language=en -Duser.variant
-cp <LotsOfJars> com.google.gwt.dev.codeserver.CodeServer -logLevel ALL
-bindAddress 0.0.0.0 -port 9877 -launcherDir war -XmethodNameDisplayMode
FULL com.steatoda.mole.gwt.Desk
[...]
11:30:43.722 [DEBUG] [org.gradle.process.internal.DefaultExecHandle]
Changing state to: STARTING
11:30:43.722 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Waiting
until process started: command '/usr/local/jdk1.8.0_251/bin/java'.
11:30:43.723 [DEBUG] [org.gradle.process.internal.DefaultExecHandle]
Changing state to: STARTED
11:30:43.723 [INFO] [org.gradle.process.internal.DefaultExecHandle]
Successfully started process 'command '/usr/local/jdk1.8.0_251/bin/java''
11:30:43.723 [DEBUG] [org.gradle.process.internal.ExecHandleRunner] waiting
until streams are handled...
11:30:44.045 [ERROR] [system.err] Unknown argument: -logLevel ALL
11:30:44.048 [ERROR] [system.err] Google Web Toolkit 2.9.0
11:30:44.049 [ERROR] [system.err] CodeServer [-[no]allowMissingSrc]
[-[no]compileTest] [-compileTestRecompiles count] [-[no]failOnError]
[-[no]precompile] [-port port] [-src dir] [-workDir dir] [-launcherDir]
[-bindAddress host-name-or-address] [-style (DETAILED|OBFUSCATED|PRETTY)]
[-setProperty name=value,value...] [-[no]incremental] [-sourceLevel [auto,
1.8, 1.9, 1.10, 1.11]] [-logLevel (ERROR|WARN|INFO|TRACE|DEBUG|SPAM|ALL)]
[-[no]generateJsInteropExports]
[-includeJsInteropExports/excludeJsInteropExports regex]
[-XmethodNameDisplayMode (NONE|ONLY_METHOD_NAME|ABBREVIATED|FULL)]
[-X[no]closureFormattedOutput] [module]
11:30:44.083 [ERROR] [system.err]
11:30:44.083 [ERROR] [system.err] where
11:30:44.085 [ERROR] [system.err] -[no]allowMissingSrc
Allows -src flags to reference missing directories. (defaults to OFF)
11:30:44.089 [ERROR] [system.err] -[no]compileTest
Exits after compiling the modules. The exit code will be 0 if the
compile succeeded. (defaults to OFF)
11:30:44.089 [ERROR] [system.err] -compileTestRecompiles
The number of times to recompile (after the first one) during a
compile test.
[...] more of CodeServer's help


If I copy/paste that same cmdline to plain bash script, it works.

Gradle 4.8.

-gkresic.

Jens

unread,
Jan 11, 2021, 11:00:36 AM1/11/21
to GWT Users

Unreletaed to this, but Thomas one more question if I may: can you see a
problem with folloging Gradle task:

task gwtCodeServerManual(type: JavaExec) {
main = 'com.google.gwt.dev.codeserver.CodeServer'
classpath += files(sourceSets.main.compileClasspath,
sourceSets.main.runtimeClasspath)
args += '-logLevel ALL'
args += '-bindAddress 0.0.0.0'
args += '-port 9877'
args += '-launcherDir war'
args += '-XmethodNameDisplayMode FULL'
args += 'com.steatoda.mole.gwt.Desk'
}

From --debug output it seems that it passes parameters properly, but
somehow CodeServer complains (here it complains with "Unknown argument:
-logLevel ALL", but it will complain on ANY parameter, whichever I define
first):

A parameter option (like ALL in -logLevel ALL) is also an argument on its own, so you need to split your argument string into two as needed.

Personally I define arguments the following way:

args = [
  '-sourceLevel', '11',
  '-strict',
  '-workDir', gwtCodeServerWorkDir,
  '-launcherDir', gwtCodeServerWarDir,
  '-failOnError',
  '-bindAddress', '0.0.0.0',
  '-port', port,
  '-style', 'PRETTY',
  '-XmethodNameDisplayMode', 'ABBREVIATED'
]



-- J.

Gordan Krešić

unread,
Jan 11, 2021, 12:44:31 PM1/11/21
to google-we...@googlegroups.com
On 11. 01. 2021. 17:00, Jens wrote:
>
> A parameter option (like ALL in -logLevel ALL) is also an argument on its
> own, so you need to split your argument string into two as needed.

Yep, thanks.

-gkresic.

Gordan Krešić

unread,
Jan 11, 2021, 12:54:26 PM1/11/21
to GWT Users
On 10. 01. 2021. 15:53, Gordan Krešić wrote:
> When using SDM's Code Server, I get following error during initial load:
>
>     [ERROR] Could not find org.apache.commons.lang3.LocaleUtils in types
> compiled from source. Is the source glob too strict?
>
> That's it, no further reference which class depends on LocaleUtils. Is there
> a way to increase log verbosity of code server?

To summarize: one of my classes did reference LocaleUtils, but not directly.
It had static member field of type OffendingClass that internally had
methods which use LocaleUtils.

That field was not accessed in client code, co compiler, after it pruned AST
didn't stumbled upon it, as I suspected. SDM skips such optimizations and
did found OffendingClass in AST, but for some reason didn't report class name.

Decreasing log level od CodeServer didn't report offending class either, but
gave me some clues where to look for.

TIL:

1. When CodeServer doesn't report offending class, look at static members
and static class initializers.

2. GWT Gradle landscape is in poor condition.

-gkresic.
Reply all
Reply to author
Forward
0 new messages