Re: Duplicated entry in DeobfuscatorBuilder for maven compile

154 views
Skip to first unread message

Thomas Broyer

unread,
Dec 10, 2012, 12:38:24 PM12/10/12
to google-we...@googlegroups.com
How are you running the ValidationTool? (I suppose annotation processing during maven-compiler-plugin) Does it happen during "mvn clean compile" or only "mvn compile"?
Feel free to file an issue after you double-check it's not an environmental issue (e.g. some classes compiled by Eclipse and others by javac, etc.)
Also, is this GWT 2.4.0 or 2.5.0? Try requestfactory-apt:2.5.0 before reporting an issue.

On Monday, December 10, 2012 5:41:37 PM UTC+1, SiJa wrote:
Hallo,

there is a duplicated entry in DeobfuscatorBuilder class when I compile the application with maven and the lists with the proxies for the duplicated bean are different. But if I compile the application with eclipse-compiler, there is no duplicated entry and nothing went wrong (only the first entry of the list above for OPAssertionWithInformation).

withOperation(new OperationKey("KUn4aunHWrVyneYsWoPuvNECTaM="),
  new OperationData.Builder()
  .withClientMethodDescriptor("(Lxxx/gui/shared/beans/rf/proxies/filtering/FilterLoadConfigProxy;Lxxx/gui/shared/beans/rf/proxies/paging/PagingLoadConfigProxy;)Lcom/google/web/bindery/requestfactory/shared/Request;")
  .withDomainMethodDescriptor("(Lxxx/editor/loadconfig/FilterLoadConfig;Lxxx/editor/loadconfig/PagingLoadConfig;)Lxxx/editor/loadconfig/PagingLoadResultOPAssertion;")
  .withMethodName("loadObjectPropertyAssertions")
  .withRequestContext("xxx.gui.shared.beans.rf.WebInterfaceRequestFactory$PropertyAssertionRequest")
  .build());
...
withClientToDomainMappings("xxx.editor.model.OPAssertionWithInformation", Arrays.asList("xxx.gui.shared.beans.rf.proxies.model.OPAssertionWithInfEntityProxy", "xxx.gui.shared.beans.rf.proxies.model.OPAssertionWithMinInformationProxy"));
...
withClientToDomainMappings("xxx.editor.model.OPAssertionWithInformation", Arrays.asList("xxx.gui.shared.beans.rf.proxies.model.OPAssertionWithInfEntityProxy"));
...

The first entry for OPAssertionWithInformation is the right one because my proxies look like this

 @ProxyFor(value = OPAssertionWithInformation.class, locator = OPAssertionLocator.class)
public interface OPAssertionWithInfEntityProxy extends EntityProxy {
    ...
}

 @ProxyFor(OPAssertionWithInformation.class)
public interface OPAssertionWithMinInformationProxy extends ValueProxy {
   ...
}

I need both proxies.

Now if I call the method "loadObjectPropertyAssertions" with param OPAssertionWithMinInformationProxy, I get an exception that "The domain type OPAssertionWithInformation cannot be sent to the client", because the second entry in DeobfuscatorBuilder overrides the first entry and so OPAssertionWithMinInformationProxy cannot be found.

I´ve been searching for a couple of days but I don´t understand why the result of eclipse and maven compile are different and why maven compile produces this duplicated entry. Can anybody help me?

SiJa

unread,
Dec 11, 2012, 3:15:33 AM12/11/12
to google-we...@googlegroups.com
It doesn´t matter which GWT version I use. It´s the same behaviour in version 2.4.0 and 2.5.0. It happens during "mvn clean compile" and "mvn compile". Before I used "mvn clean compile" I deleted every generated source code and eclipse automatically build was disabled. The ValidationTool runs during maven-compiler-plugin. That´s the entry in pom-file.

<plugin>
   <artifactId>maven-compiler-plugin</artifactId>
   <version>2.5.1</version>
   <configuration>
      <source>1.6</source>
      <target>1.6</target>
   </configuration>
   <dependencies>
      <dependency>
         <groupId>com.google.web.bindery</groupId>
         <artifactId>requestfactory-apt</artifactId>
         <version>${gwtVersion}</version>
      </dependency>
   </dependencies>
</plugin>

Thomas Broyer

unread,
Dec 11, 2012, 4:48:57 AM12/11/12
to google-we...@googlegroups.com
Which JDK are you using? (OpenJDK? Oracle? 6? 7?)

Please file an issue with as much information as possible, and if you can make a small project that reproduces the issue it'd be even better.

SiJa

unread,
Dec 11, 2012, 8:52:46 AM12/11/12
to google-we...@googlegroups.com
We use:
java version "1.6.0_35"
Java(TM) SE Runtime Environment (build 1.6.0_35-b10)
Java HotSpot(TM) Client VM (build 20.10-b01, mixed mode, sharing)

Apache Maven 3.0.3 (r1075438; 2011-02-28 18:31:09+0100)

We fixed the bug by renaming an EntityProxy, which is not a sub oder supeproxy of OPAssertionWithMinInformationProxy. The proxy APWithInEntityProxy is now called ANPWithInfEntityProxy and everything is ok. We have no idea why renaming solved the problem. We are trying to create a small project which reproduces the issue. But I am not sure if we are successful, because the issue happens in a complex application.

Thank you for your help so far.

SiJa

unread,
Dec 18, 2012, 8:50:04 AM12/18/12
to google-we...@googlegroups.com
The error can be reproduced with this project. If you call "mvn clean package" and check WebInterfaceRequestFactoryDeobfuscatorBuilder.java you can see the duplicated entry for bean OPAssertionWithInformation. Eclipse compile also gives you two entries. If you rename APWithInfEntityProxy.java in ANPWithInfEntityProxy.java Eclipse compile gives you only one entry.
lsp.zip

Thomas Broyer

unread,
Dec 18, 2012, 9:37:46 AM12/18/12
to google-we...@googlegroups.com


On Tuesday, December 18, 2012 2:50:04 PM UTC+1, SiJa wrote:
The error can be reproduced with this project. If you call "mvn clean package" and check WebInterfaceRequestFactoryDeobfuscatorBuilder.java you can see the duplicated entry for bean OPAssertionWithInformation. Eclipse compile also gives you two entries. If you rename APWithInfEntityProxy.java in ANPWithInfEntityProxy.java Eclipse compile gives you only one entry.

I'm sorry I don't reproduce using either OpenJDK 7u9 (Ubuntu package) or Oracle JDK 6u27 with "mvn clean compile" (or "mvn clean package"). I haven't tried in Eclipse yet.
I'm afraid you'll have to try to debug it. It might have to do with multiple invocations of the annotation processor and/or the fact that we use ExecutableElement instances as keys in maps (I've seen some comments in a Dagger pull request about the fact the compiler objects are not guaranteed to be reused between rounds, and Dagger is thus using Strings as keys in internal maps: see https://github.com/square/dagger/pull/111 and https://github.com/square/dagger/pull/108).

Apache Maven 3.0.4 (r1232337; 2012-01-17 09:44:56+0100)
Java version: 1.6.0_27, vendor: Sun Microsystems Inc.
Default locale: fr_FR, platform encoding: UTF-8
OS name: "linux", version: "3.5.0-19-generic", arch: "amd64", family: "unix"

Apache Maven 3.0.4 (r1232337; 2012-01-17 09:44:56+0100)
Java version: 1.7.0_09, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-7-openjdk-amd64/jre
Default locale: fr_FR, platform encoding: UTF-8
OS name: "linux", version: "3.5.0-19-generic", arch: "amd64", family: "unix"
Reply all
Reply to author
Forward
0 new messages