Request Factory unable to resolve domain objects

55 views
Skip to first unread message

Marko Vuksanovic

unread,
Dec 12, 2011, 6:35:55 PM12/12/11
to google-we...@googlegroups.com
I am just trying to get RF running and have run into an issue when doing GWT compile. Basically the problem is that GWT compiler
complains that domain classes cannot be resolved. This prevents me from compiling with -strict option. I have made sure that both
sources and compiled classes are on classpath. I have also made sure that request-factory is run.

Does anyone have any ideas how to get rid of this errors? And why do I get them in the first place?

Validating units:
   Errors in 'file:/D:/devel/project/sag-cliserv/src/com/example/sag/shared/application/storage/proxy/StoredItemProxy.java'
      Line 3: The import com.example.sag.server.application.StoredItem cannot be resolved
      Line 4: The import com.example.sag.server.application.StoredItemLocator cannot be resolved
      Line 11: StoredItem cannot be resolved to a type
      Line 11: StoredItemLocator cannot be resolved to a type
      Line 11: Class<StoredItemLocator> cannot be resolved to a type
   Errors in 'file:/D:/devel/project/sag-cliserv/src/com/example/sag/shared/application/storage/rf/StoredItemContext.java'
      Line 4: The import com.example.sag.server.application.StoredItemLocator cannot be resolved
      Line 14: StoredItemLocator cannot be resolved to a type
Removing invalidated units
   Compilation unit 'file:/D:/devel/project/sag-cliserv/src/com/example/sag/shared/application/storage/rf/SagRequestFactory.java' is removed due to invalid reference(s):
      com.example.sag.shared.application.storage.rf.StoredItemContext
   Compilation unit 'file:/D:/devel/project/sag-cliserv/src/com/example/sag/client/application/storage/StorageService.java' is removed due to invalid reference(s):
      com.example.sag.shared.application.storage.rf.SagRequestFactory
   Compilation unit 'file:/D:/devel/project/sag-cliserv/src/com/example/sag/shared/application/storage/rf/SagRequestContextProvider.java' is removed due to invalid reference(s):
      com.example.sag.shared.application.storage.rf.SagRequestFactory
 
Below is the ant script snippet used to do javac  
 
<target name="javac" description="Compile java source to bytecode">
    <javac srcdir="src" includes="**" encoding="utf-8" 
           destdir="war/WEB-INF/classes"
           source="1.5" target="1.5" nowarn="true"
           debug="true" debuglevel="lines,vars,source">
        <classpath refid="project.class.path"/>
        <compilerarg value="-proc:only"/>
        <compilerarg line="-s .apt_generated"/>
    </javac>
    <javac srcdir="src" includes="**" encoding="utf-8"
           destdir="war/WEB-INF/classes"
           source="1.5" target="1.5" nowarn="true"
           debug="true" debuglevel="lines,vars,source">
        <classpath refid="project.class.path"/>
    </javac>
    <javac srcdir=".apt_generated" includes="**" encoding="utf-8"
           destdir="war/WEB-INF/classes"
           source="1.5" target="1.5" nowarn="true"
           debug="true" debuglevel="lines,vars,source">
        <classpath refid="project.class.path"/>
    </javac>
    <copy todir="war/WEB-INF/classes">
        <fileset dir="src" excludes="**/*.java"/>
    </copy>
</target>

And this is the GWT compile part

<target name="gwtc" description="GWT compile to JavaScript (production mode)">
    <java failonerror="true" fork="true" classname="com.google.gwt.dev.Compiler">
        <classpath>
            <pathelement location="src"/>
            <fileset dir="${gwt.sdk}" includes="*.jar"/>
            <pathelement location="${lib.root}/gwt-log-3.1.6.jar"/>
            <pathelement location="${lib.root}/gwt-oauth2-0.2-alpha.jar"/>
            <pathelement location="${lib.root}/google-oauth-java-client-1.6.0-beta.jar"/>
        </classpath>
        <jvmarg value="-Xmx256M"/>
        <jvmarg line="-Dgwt.jsinlinerratio=1.2"/>
        <arg line="-style OBF"/>
        <arg line="-XdisableClassMetadata"/>
        <arg line="-XdisableCastChecking"/>
        <arg line="-optimize 9"/>
        <!--<arg line="-logLevel DEBUG"/>-->
        <arg value="-compileReport"/>
        <arg value="-soyc"/>
        <arg value="-strict"/>
        <arg value="-war"/>
        <arg value="war"/>
        <arg value="com.example.sag.startup"/>
    </java>
</target>

M.

Thomas Broyer

unread,
Dec 13, 2011, 4:00:09 AM12/13/11
to google-we...@googlegroups.com
You could try removing imports of your domain classes, and use FQCNs in your annotations (i.e. @ProxyFor(value=com.example.sag.server.application.StoredItem.class, locator=com.example.sag.server.application.StoredItemLocator.class); or switch to ProxyForName/ServiceName as a last resort.

Also, I believe war/WEB-INF/classes should be in in your "gwtc" classpath.
Reply all
Reply to author
Forward
0 new messages