Error processing @WithTokenizers, cannot find type

453 views
Skip to first unread message

Tony B

unread,
Dec 17, 2012, 5:00:25 PM12/17/12
to google-we...@googlegroups.com
Hello,
   I have a weird situation.  I am getting the following error in my
16:48:34.027 [ERROR] [wmsapp] Error processing @WithTokenizers, cannot find type com.wmsvision.wmsapp.client.activities.productsearch.ProductSummaryDetailPlace.ProductSummaryDetailPlaceTokenizer

The problem is that I know this exists.   First of all, this happens in the following code:
package com.wmsvision.wmsapp.client;

import com.google.gwt.place.shared.PlaceHistoryMapper;
import com.google.gwt.place.shared.WithTokenizers;
import com.wmsvision.wmsapp.client.activities.HomePlace.HomePlaceTokenizer;
import com.wmsvision.wmsapp.client.activities.WmsListPlace.WmsListPlaceTokenizer;
import com.wmsvision.wmsapp.client.activities.about.AboutPlace.AboutPlaceTokenizer;
import com.wmsvision.wmsapp.client.activities.configuration.ConfigPlace.ConfigPlaceTokenizer;
import com.wmsvision.wmsapp.client.activities.login.LoginPlace.LoginPlaceTokenizer;
import com.wmsvision.wmsapp.client.activities.productsearch.ProductSummaryDetailPlace.ProductSummaryDetailPlaceTokenizer;
import com.wmsvision.wmsapp.client.activities.productsearch.ProductSummaryMasterPlace.ProductSummaryMasterPlaceTokenizer;
import com.wmsvision.wmsapp.client.activities.productsearch.ProductSummaryPlace.ProductSummaryPlaceTokenizer;
import com.wmsvision.wmsapp.client.activities.receiving.ReceivingPlace.ReceivingPlaceTokenizer;
import com.wmsvision.wmsapp.client.activities.relocation.RelocationPlace.RelocationPlaceTokenizer;

@WithTokenizers({ HomePlaceTokenizer.class,
            LoginPlaceTokenizer.class,
            AboutPlaceTokenizer.class,
            WmsListPlaceTokenizer.class,
            ReceivingPlaceTokenizer.class,
            RelocationPlaceTokenizer.class,
            ProductSummaryPlaceTokenizer.class,
            ProductSummaryDetailPlaceTokenizer.class,
            ProductSummaryMasterPlaceTokenizer.class,
            ConfigPlaceTokenizer.class})
public interface AppPlaceHistoryMapper extends PlaceHistoryMapper {
}

I have a similar place defined in the same package that seems to work fine ( it is called "import com.wmsvision.wmsapp.client.activities.productsearch.ProductSummaryMasterPlace" ).  Anyway, the "DetailPlace" should only be accessible from the "MasterPlace", so maybe I don't need it in my AppPlaceHistoryMapper above.  But I would still like to understand why it is not working.

Here is the class file in question, the one it cannot seem to find:
package com.wmsvision.wmsapp.client.activities.productsearch;

import com.google.gwt.place.shared.Place;
import com.google.gwt.place.shared.PlaceTokenizer;

public class ProductSummaryDetailPlace extends Place {
    private String product;
    private long index;
    private String id;
    private final String separator = "#:PRODUCTINDEX:#";
   
    public ProductSummaryDetailPlace(String product, long index) {
        super();
        this.product = product;
        this.index = index;
        
        createId();
    }
   
    public ProductSummaryDetailPlace( String id ) {
        this( "", 0 );
        
        String tokens[] = ( id != null ? id.split(separator) : null );
        
        if( tokens != null && tokens.length >= 1 ){
            this.product = tokens[0];
            
            if( tokens.length >= 2 ){
                this.index = Long.getLong( tokens[1] );
            }
            
            createId();
        }
    }
   
    private void createId( ) {
        this.id = product.trim() + separator + index;
    }


    public String getProduct() {
        return product;
    }



    public void setProduct(String product) {
        String oldProduct = this.product;
        
        this.product = product;
        
        // Product changed, so recalculate id
        if( !oldProduct.equals(product)) {
            createId();
        }
    }



    public long getIndex() {
        return index;
    }



    public void setIndex(long index) {
        long oldIndex = this.index;
        
        this.index = index;
        
        // Index changed, so recalculate id
        if( oldIndex != index ) {
            createId();
        }
    }



    public String getId() {
        return id;
    }
   
    public static class ProductSummaryDetailPlaceTokenizer
            implements PlaceTokenizer<ProductSummaryDetailPlace> {

        @Override
        public ProductSummaryDetailPlace getPlace(String token) {
            return new ProductSummaryDetailPlace(token);
        }

        @Override
        public String getToken(ProductSummaryDetailPlace place) {
            return place.getId();
        }
    }
}

Thanks.

Tony

Tony B

unread,
Dec 18, 2012, 5:01:42 PM12/18/12
to google-we...@googlegroups.com
Sadly, not yet.   If I found out something, I will update this thread.

On Tuesday, December 18, 2012 9:51:26 AM UTC-5, sean.l...@perceptivesoftware.com wrote:
Hi Tony,

Having same problem - did you find a resolution to this?

Thanks

Sean

Pablo Nussembaum

unread,
Dec 20, 2012, 10:19:07 AM12/20/12
to google-we...@googlegroups.com
I have a similar problem with @WithTokenizers and I used some the
workarounds from this issue:
http://code.google.com/p/google-web-toolkit/issues/detail?id=5658
> this.id <http://this.id> = product.trim() +
> --
> You received this message because you are subscribed to the Google
> Groups "Google Web Toolkit" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/google-web-toolkit/-/KopV8Zn4Y2MJ.
> To post to this group, send email to google-we...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-web-tool...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/google-web-toolkit?hl=en.


Tony B

unread,
Dec 20, 2012, 12:25:30 PM12/20/12
to google-we...@googlegroups.com
Right now I am using GWT 2.4.  So your suggesting I use GWT 2.5?

Or maybe you changed the GWT source code to mimic the work around they mentioned.

Tony B

unread,
Dec 20, 2012, 12:48:59 PM12/20/12
to google-we...@googlegroups.com
Ok, this is screwy.  Now it is working, and I did not really change anything in this section.  Here is what I did that could have impacted this:
  1. Restarted Eclipse at least one time
  2. Did a full GWT compile ( with GWT 2.4 ) at least one time
  3. Change GWT SDK from 2.4 to 2.5, and started debugger.  It worked
  4. Changed GWT SDK back to 2.4, and started debugger.  It worked.

I don't know if one or all of the above acts fix it, or if some code change I forgot fixed it.  Anyway, thanks.

Tony

RyanZA

unread,
Dec 21, 2012, 9:19:22 AM12/21/12
to google-we...@googlegroups.com
It appears to depend on the compiled GWT code to find the correct class - but it runs before the compilation step. So new classes don't appear until it successfully compiles.

eg. You create a new .java class and add it to the tokenizer. Try to compile and it will fail. Remove the annotation and compile. Then add the annotation back and compile again, and it should work.

I've taken to just skipping the annotations and just implementing my own mapper - it gives you much better control of exactly what tokens to pass when/where and lets you use the nice #! for search engine crawling...

Wayne Rasmuss

unread,
Jan 17, 2014, 9:44:49 PM1/17/14
to google-we...@googlegroups.com
I just had this problem. My solution was pretty much what Ryan said above but I have some more details. I had added a place tokenizer to my place history mapper. A class this new tokenizer depended on was correct from a java perspective, but had problems with inherited modules, and some conflicts between the gwt and non gwt versions of guava jars. By commenting out the tokenizers as suggested above, I was able to finally see these errors. Then they were pretty straight forward fixes.

Jason Washo

unread,
Mar 31, 2015, 5:08:11 PM3/31/15
to google-we...@googlegroups.com
I experienced this exact problem, and it was because I was accidentally referencing java code that was not supported/emulated by GWT (UUID). It appears that if GWT encounters that type of error, it also prevents Binding and throws the Binding error as well.
Reply all
Reply to author
Forward
0 new messages