2.7RC1 compiles fine but recompile returns errors

232 views
Skip to first unread message

Koen Maes

unread,
Nov 7, 2014, 12:22:05 PM11/7/14
to google-web-tool...@googlegroups.com
Hi

I am trying my project with 2.7RC1. I can compile the whole project without errors.

But when I start the application, recompile is triggered and this gives me two different errors :

1)  java.util.StringTokenizer is not found
         Tracing compile failure path for type 'com.klawt.shared.domain.SearchFieldsTokenizer'
            [ERROR] Errors in 'file:/home/koen/workspace/klawt/shared/com/klawt/shared/domain/SearchFieldsTokenizer.java'
               [ERROR] Line 16: No source code is available for type java.util.StringTokenizer; did you forget to inherit a required module?

2) Troubles with GSS/CSS resource

         Computing all possible rebind results for 'com.klawt.screen.ui.Resources'
            Rebinding com.klawt.screen.ui.Resources
               Invoking generator com.google.gwt.resources.rebind.context.InlineClientBundleGenerator
                  Preparing method base_admin
                     The following problems were detected
                        [WARN] Line 75 column 54: encountered "*". Was expecting one of: "|=" "~=" "=" "]" 
         [ERROR] Errors in 'gen/com/klawt/screen/ui/menu/InvoiceMenuViewImpl_InvoiceMenuUiBinderImpl.java'
            [ERROR] Line 108: Rebind result 'com.klawt.screen.ui.BaseAdminCssResource' must be a class

The class BaseAdminCssResource is a CSSResource.

public interface BaseAdminCssResource extends CssResource {

@ClassName("widget")
String widget();

@ClassName("widget-header")
String widgetHeader();

       .... and so on....
}


Anybody to give me some hints what is wrong ...

thx
Koen

Jens

unread,
Nov 7, 2014, 12:51:27 PM11/7/14
to google-web-tool...@googlegroups.com
1.) GWT does not emulate java.util.StringTokenizer as you can see in https://gwt.googlesource.com/gwt/+/master/user/super/com/google/gwt/emul/java/util/ . So this error is kind of expected unless you provide your own emulation of that class.

2.) The gss/css file of your BaseAdminCssResource seem to contain a star sign ( * ) which the generator did not expect. Do you use any GSS syntax and maybe forgot to enable GSS (it is disabled by default)? Here is a good writeup on the various gss parameters: https://groups.google.com/d/msg/google-web-toolkit-contributors/---dVu3IvC4/ZbXINAWGGGsJ

-- J.

Roberto Lublinerman

unread,
Nov 7, 2014, 2:20:55 PM11/7/14
to google-web-tool...@googlegroups.com
The reason why your are seeing error (1)  in 2.7 and not in 2.6 (I assume) is that to implement minimal (class level) recompiles all the methods of a class are traversed in 2.7 where only entry point reachable methods were traversed in 2.6. In the past if you had a class that, for example, provided constants and those were the only members really used by this project, such a class would compile even if one of its methods referred to a class that is not emulated.

--
You received this message because you are subscribed to the Google Groups "GWT Contributors" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit-co...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit-contributors/a50cc5ac-f548-4432-a673-9c02073d3542%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Koen Maes

unread,
Nov 7, 2014, 2:49:27 PM11/7/14
to google-web-tool...@googlegroups.com
thx for the pointers Jens and Roberto... I'll try your suggestions.

Koen Maes

unread,
Nov 7, 2014, 3:49:06 PM11/7/14
to google-web-tool...@googlegroups.com
Well,

Error (1) is easy to fix.

I corrected the WARNING with the star sign. The BaseAdminCssResource seems to compile fine during incremental compilation :'

         Resolving com.klawt.screen.ui.BaseAdminCssResource
            Found type 'com.klawt.screen.ui.BaseAdminCssResource'
               Resolving method widget
                  Resolving annotation for com.google.gwt.resources.client.CssResource$ClassName
              <...skip...>
               Resolving method subnavbar
                  Resolving annotation for com.google.gwt.resources.client.CssResource$ClassName
               Resolving method subnavbar_inner
                  Resolving annotation for com.google.gwt.resources.client.CssResource$ClassName


But I am still left with this error :

         [ERROR] Errors in 'gen/com/klawt/screen/ui/menu/InvoiceMenuViewImpl_InvoiceMenuUiBinderImpl.java'
            [ERROR] Line 108: Rebind result 'com.klawt.screen.ui.BaseAdminCssResource' must be a class
        <...skip...>
        Compile with -strict or with -logLevel set to TRACE or DEBUG to see all errors.
         [ERROR] Errors in 'gen/com/klawt/screen/ui/menu/InvoiceMenuViewImpl_InvoiceMenuUiBinderImpl.java'
            [ERROR] Line 108: Rebind result 'com.klawt.screen.ui.BaseAdminCssResource' must be a class

When I check the generated sources this is what I find in the file InvoiceMenuViewImpl_InvoiceMenuUiBinderImpl.java

    /**
     * Getter for base called 0 times. Type: IMPORTED. Build precedence: 1.
     */
    private com.klawt.screen.ui.BaseAdminCssResource get_base() {
      return build_base();
    }
    private com.klawt.screen.ui.BaseAdminCssResource build_base() {
      // Creation section.
      final com.klawt.screen.ui.BaseAdminCssResource base = (com.klawt.screen.ui.BaseAdminCssResource) GWT.create(com.klawt.screen.ui.BaseAdminCssResource.class);
      // Setup section.

      return base;
    }


This is what the UiBinder file looks like that is causing the error :

<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
xmlns:g="urn:import:com.google.gwt.user.client.ui" xmlns:b="urn:import:com.github.gwtbootstrap.client.ui"
xmlns:m="urn:import:com.klawt.screen.ui.menu">

<ui:with type="com.klawt.screen.ui.BaseAdminCssResource" field="base"></ui:with>
<ui:with type="com.klawt.i18n.I18nConstants" field="constants"></ui:with>

<g:HTMLPanel tag="ul">
<m:SubNavbarTitle ui:field="title"></m:SubNavbarTitle>
<b:NavWidget ui:field="documents" icon="FILE_TEXT_ALT">
<g:HTMLPanel tag="span">
<ui:text from="{constants.DOCUMENTS}" />
</g:HTMLPanel>
</b:NavWidget>
<b:NavWidget ui:field="emails" icon="ENVELOPE">
<g:HTMLPanel tag="span">
<ui:text from="{constants.EMAILS}" />
</g:HTMLPanel>
</b:NavWidget>
</g:HTMLPanel>


</ui:UiBinder>

Any ideas ??

Julien Dramaix

unread,
Nov 7, 2014, 3:55:54 PM11/7/14
to google-web-tool...@googlegroups.com
Koen,

Could you give us more information about the error (2) ? Does your BaseAdminCssResource use a .css or a .gss file ? Did you enable GSS ? Did you enable the auto conversion ? Could you paste the css line related with the warning message (line 75) ?

Thanks,

Julien

Jens

unread,
Nov 7, 2014, 4:08:08 PM11/7/14
to google-web-tool...@googlegroups.com
As far as I know you can not call GWT.create(MyCssResource.class) directly since there is no <generate-with> rule defined for anything extending CssResource. This should fail in GWT 2.6.1 as well. Your error basically means no generator and no replace rule has provided a concrete implementation for the CssResource interface.

At least I always use <ui:with type="com.example.MyClientBundle" field="res" /> and then use "res.css.cssClass" or if I really want to use <ui:with type="com.example.MyCssResource" field="css" /> then I use @UiField(provided = true) and assign a CssResource instance from a corresponding ClientBundle to it.


-- J.

Koen Maes

unread,
Nov 8, 2014, 3:28:25 PM11/8/14
to google-web-tool...@googlegroups.com
Hi Julien

I am using a css, I did not make any changes. I did not enable auto conversion.

Finally it turns out that it was a stupid mistake that was never caught in 2.6. Thanks to Jens for the hint ....
I replaced
<ui:with type="com.klawt.screen.ui.BaseAdminCssResource" field="base"></ui:with>
with
<ui:with type="com.klawt.screen.ui.Resources" field="res"></ui:with>
And then I have access to res.base(). That is how I am doing it in all the other UIbinder files.

The compile error is gone but now I am running into OutOfMemoryError :

         Unification traversed 68403 fields and methods and 5847 types. 5794 are considered part of the current module and 5794 had all of their fields and methods traversed.
Purging cache files from /home/koen/workspace/klawt/gwt-unitCache
Wrote 5574 units to persistent cache.
         Compiling 1 permutation
            Creating PermutationWorkerFactory instances
            Compiling permutation 0...
            Permutation took 32210 ms
            [ERROR] OutOfMemoryError: Increase heap size or lower gwt.jjs.maxThreads
java.lang.OutOfMemoryError: GC overhead limit exceeded
at com.google.gwt.dev.js.ast.JsModVisitor.doAccept(JsModVisitor.java:176)
at com.google.gwt.dev.js.ast.JsVisitor.accept(JsVisitor.java:109)

I already added this to the java arguments ...

-Xmx4096m -Xms512m -XX:PermSize=64m -XX:MaxPermSize=256m -Dgwt.compiler.localWorkers=1 

But it doesn't solve the OutOfMemoryError.

Any suggestions ?


Koen Maes

unread,
Nov 8, 2014, 3:43:03 PM11/8/14
to google-web-tool...@googlegroups.com
Sorry - solved
I had -Xmx512m further down the line.

Thx for the great support and congrats on the new release. Incremental compilations is awesome !!

Koen
Reply all
Reply to author
Forward
0 new messages