GWTP编译错误Rest-Dispatch

时间:2014-09-04 11:47:44

标签: rest gwt ant ivy gwtp

我在使用GWTP Rest-Dispatch时遇到问题,当我包含Rest-Dispatch配置(如wiki中所述)时,这些编译器错误:http://pastebin.com/eWNg2c94(编译日志)

我不知道造成这种情况的原因是什么,我正在使用常春藤依赖管理器(IvyDE eclipse)。我已经验证了所有gwtp-rest依赖项存在。我正在使用两个Dispatchers(Rpc / Rest)这里是我的应用程序gwt模块配置。

<?xml version="1.0" encoding="UTF-8"?>
<module rename-to="ims">
    <!-- Inherit the core Web Toolkit stuff -->
    <inherits name="com.google.gwt.user.User" />
    <inherits name="com.google.gwt.logging.Logging"/>

    <set-property name="gwt.logging.consoleHandler" value="DISABLED"/>
    <set-property name="gwt.logging.popupHandler" value="DISABLED" />

    <extend-property name="locale" values="en"></extend-property>

    <!-- Core module inherits -->
    <inherits name="nz.co.doltech.framework.module.Framework" />
    <inherits name="nz.co.doltech.ims.Resources" />

    <!-- Theme module inherits -->
    <inherits name="nz.co.doltech.framework.themes.SyrenaTheme"/>

    <!-- GXT -->
    <!--stylesheet src="reset.css" /-->
    <!--inherits name='com.sencha.gxt.ui.GXT' /-->

    <!-- GXT Theme -->
    <!-- <inherits name='com.sencha.gxt.theme.blue.Blue'/> -->
    <!-- <inherits name='com.sencha.gxt.theme.gray.Gray' /> -->
    <!--inherits name="com.sencha.gxt.theme.neptune.Theme" /-->

    <!-- Library module inherits -->
    <inherits name="com.gwtplatform.dispatch.rest.DispatchRest"/>
    <inherits name="com.gwtplatform.dispatch.rpc.DispatchRpc"/>
    <inherits name="com.gwtplatform.mvp.Mvp"/>
    <inherits name="com.google.gwt.uibinder.UiBinder"/>
    <inherits name="com.google.gwt.query.Query"/>

    <inherits name="org.gwtbootstrap3.GwtBootstrap3CDN"/>
    <inherits name="nz.co.doltech.framework.extensions.gwtbootstrap3.datepicker.Datepicker"/>

    <inherits name="org.atmosphere.gwt.Client"/>

    <replace-with class="org.atmosphere.gwt.client.impl.IEHTMLFileCometTransport">
      <when-type-is class="org.atmosphere.gwt.client.impl.CometTransport"/>
      <any>
        <when-property-is name="user.agent" value="ie6"/>
        <when-property-is name="user.agent" value="ie8"/>
        <when-property-is name="user.agent" value="ie9"/>
      </any>
    </replace-with>

    <!-- Framework module inherits -->
    <inherits name="nz.co.doltech.framework.libraries.maydu.validation.ValidationLibrary" />
    <inherits name="nz.co.doltech.framework.libraries.chosen.Chosen" />

    <!-- Module entry point -->
    <entry-point class="nz.co.doltech.ims.client.Application"/>

    <extend-configuration-property name="gin.ginjector.modules" 
        value="nz.co.doltech.ims.client.gin.ClientModule" />

    <set-configuration-property name="gwtp.bootstrapper"  
         value="nz.co.doltech.ims.client.BootstrapperImpl"/>

    <set-configuration-property name="gwtp.prebootstrapper"  
         value="nz.co.doltech.ims.client.BootstrapperImpl.PreBootstrapperImpl"/>

    <extend-configuration-property name="document.compatMode" value="BackCompat" />

    <!-- Specify the paths for translatable code -->
    <source path="client" />
    <source path="shared" />

    <generate-with class="com.google.gwt.uibinder.rebind.FixedUiBinderGenerator">
        <when-type-assignable class="com.google.gwt.uibinder.client.UiBinder"/>
    </generate-with>

    <!-- RPC Serialization Ignores -->
    <extend-configuration-property name="rpc.blacklist" value="javax.*"/>
    <extend-configuration-property name="rpc.blacklist" value="com.google.gwt.user.client.ui.*"/>
    <extend-configuration-property name="rpc.blacklist" value="com.google.gwt.query.client.*"/>
    <extend-configuration-property name="rpc.blacklist" value="com.google.gwt.aria.client.*"/>
    <extend-configuration-property name="rpc.blacklist" value="com.google.gwt.dom.client.*"/>
    <extend-configuration-property name="rpc.blacklist" value="com.google.gwt.validation.client.*"/>
    <extend-configuration-property name="rpc.blacklist" value="nz.co.doltech.framework.extensions.gwtbootstrap3.client.*"/>
    <extend-configuration-property name="rpc.blacklist" value="nz.co.doltech.framework.libraries.maydu.validation.client.*"/>
    <extend-configuration-property name="rpc.blacklist" value="nz.co.doltech.framework.themes.syrena.ui.*"/>
</module>

我的ANT构建脚本:

  <!--
  ================================
     Build Application Binaries
  ================================
  -->

  <target name="javac" depends="tests" description="Compile java source">
    <mkdir dir="war/WEB-INF/classes" />
    <javac srcdir="src" includes="**" encoding="utf-8" destdir="war/WEB-INF/classes" source="1.7" target="1.7"
        nowarn="true" debug="true" debuglevel="lines,vars,source" includeantruntime="false">
      <classpath refid="project.class.path" />
      <classpath refid="tomcat.libs"/>
    </javac>
    <copy todir="war/WEB-INF/classes">
      <fileset dir="src" excludes="**/*.java" />
      <fileset dir="resources" excludes="**/*.java" />
      <fileset dir="database" excludes="**/*.java" />
    </copy>
  </target>

  <target name="gwtc" depends="javac" description="GWT compile to JavaScript">
    <java failonerror="true" fork="true" classname="com.google.gwt.dev.Compiler" maxmemory="512m">
      <classpath>
        <pathelement location="src"/>
        <path refid="project.class.path"/>
      </classpath>
      <arg value="-war"/>
      <arg value="war"/>

      <!--arg value="-strict" /-->

      <!-- Logging level arguments -->
      <!--arg value="-logLevel" />
      <arg value="ERROR" /-->

      <!-- Optimization arguments -->
      <!--arg value="-XenableClosureCompiler"/>
      <arg value="-XdisableClassMetadata"/-->

      <!-- add jvmarg -Xss16M or similar if you see a StackOverflowError -->
      <jvmarg value="-Xmx512M"/>

      <!-- Additional arguments like -style PRETTY or -logLevel DEBUG -->
      <arg value="nz.co.doltech.framework.module.Framework"/>
      <arg value="nz.co.doltech.framework.login.Login"/>
      <arg value="nz.co.doltech.ims.Ims"/>
    </java>
  </target>

  <target name="build" depends="gwtc" description="Build web application entry point"/>

如果其他人遇到类似的问题,我真的非常感谢你的帮助。

1 个答案:

答案 0 :(得分:0)

您没有使用MvpWithEntryPoint而是您自己的入口点,因此您需要告诉GIN加载生成的模块。你能确定你的Ginjector看起来像这里描述的那样:https://github.com/ArcBees/GWTP/wiki/Rest-Dispatch#installing-with-your-own-ginjector

具体来说,在@GinModules中,您需要在界面中添加以下参数:properties = {"gin.ginjector.modules"}和以下方法:RestDispatch getRestDispatch();