【问题标题】:GWTP Compile Error Rest-DispatchGWTP 编译错误 Rest-Dispatch
【发布时间】:2014-09-04 22:53:22
【问题描述】:

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

我不知道是什么原因造成的,我正在使用 Ivy 依赖管理器(IvyDE eclipse)。我已经验证了所有 gwtp-rest 依赖项都存在。我正在使用两个调度程序(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"/>

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

【问题讨论】:

    标签: rest gwt ant ivy gwtp


    【解决方案1】:

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

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

    【讨论】:

    • 我在哪里初始化我的 ginjector?我以前没有,所以我现在添加它,但不确定如何初始化它。引导 wiki 页面未指定。
    • 删除了我的入口点并添加了 MvpWithEntryPoint 并仍然收到此错误。
    猜你喜欢
    • 2015-02-25
    • 2016-05-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-09-04
    相关资源
    最近更新 更多