本文介绍了从3.0.0升级后无法运行Gxt 3.1.1应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试将我的项目GWT和Gxt从2.5.1,3.0.0升级到2.7,3.1.1。我能够用一些解决方法成功构建项目,但无法运行它。我收到的错误是:

I have tried upgrading my projects GWT and Gxt from 2.5.1,3.0.0 to 2.7,3.1.1 . I was able to build the project successfully with some workarounds but am not able to run it. Error I am getting is :

Loading inherited module 'com.ApplicationShellModule'
   Loading inherited module 'com.sencha.gxt.ui.GXT'
      Loading inherited module 'com.sencha.gxt.data.Data'
         Loading inherited module 'com.sencha.gxt.core.Core'
            [ERROR] Line 96: Value 'ie6' in not a valid value for property 'user.agent'

我在尝试在applicationShellModule.gxt.xml中查找原因,这是我的gxt配置,如下面的第96行所示:

I am trying to find the cause in applicationShellModule.gxt.xml which is my gxt configuration which is as follows near line 96:

  <property-provider name="gxt.user.agent">
    <![CDATA[
    {window.alert("inside user agent gxt");

        var ua = navigator.userAgent.toLowerCase();
        if (ua.indexOf('trident') != -1) {
            if (11 == document.documentMode) return 'gecko1_9';
            return 'ie8';
        }
        if (ua.indexOf('msie') != -1) {
            return 'ie8';
        }
        return 'chrome';
    } ]]>
  </property-provider>

  <property-provider name="user.agent">
    <![CDATA[
    { window.alert("inside user agent");

    return 'ie8';

        var ua = navigator.userAgent.toLowerCase();
        if (ua.indexOf('trident') != -1) {
            if (11 == document.documentMode) return 'gecko1_8';
            return 'ie8';
        }
        if (ua.indexOf('msie') != -1) {
            return 'ie8';
        }
        return 'safari';
    } ]]>
  </property-provider>

  <property-provider name="user.agent.os">
    <![CDATA[
    {window.alert("inside user agent os");

        return 'windows';
    } ]]>
  </property-provider>

  <!-- Supported Browsers -->
<!-- uncomment this for dev after upgrade
  <set-property name="gxt.user.agent" value="chrome, ie8, gecko1_9" />
  <set-property name="user.agent.os" value="windows" />
  <extend-property name="locale" values="en,es,ko,pt,ru,fr,hu,pl,zh_CN,zh_TW,tr,uk"/>
  <set-property-fallback name="locale" value="en" />
  <collapse-property name="locale" values="en, default" />
-->
<!-- changes for upgrade gwt -->
<set-property name="user.agent" value="ie8,ie9,opera,gecko1_8,safari" />
<set-property name="gxt.user.agent" value="ie8" />
    <set-property name="user.agent.os" value="windows" />
    <extend-property name="locale" values="en" />
    <set-property-fallback name="locale" value="en" />
    <collapse-property name="locale" values="en" />
    <collapse-all-properties />
               <set-configuration-property name="CssResource.obfuscationPrefix"
        value="empty" />
<add-linker name="xsiframe"/>
<set-configuration-property name="devModeRedirectEnabled" value="true"/>
<set-property name="compiler.useSourceMaps" value="true"/>
<!-- upgrade changes over check last line setting to false below revert it to original-->

我已经在这里手动设置了用户代理,可以看到浏览器列表但不是ie6正在出现这个错误。我已经搜索了字符串'ie6',但是我找不到这个错误的实际原因。请帮我解决问题。

I have set the user agent manually here as can be seen to a list of browsers but not ie6 which is coming under the error. I have searched for the string 'ie6' but nowhere I am getting the actual reason for this error. Please help me get out of the issue.

推荐答案

Loading inherited module 'com.sencha.gxt.core.Core'
       [ERROR] Line 96: Value 'ie6' in not a valid value for property 'user.agent'


如果你看到这个,你的类路径中至少还有一个GXT 3.0版本 - 3.1.1中的Core.gwt.xml有一个

If you are seeing this, you have at least one copy of GXT 3.0 still on your classpath - the Core.gwt.xml in 3.1.1 has a blank line on 96.

正如El Hoss在评论中提到的那样,GWT 2.7放弃了对IE6的支持,为了兼容,GXT 3.1也做了同样的事情。如果您看到对IE6的引用,您可以在您自己的项目中使用IE6进行自定义,或者实际上没有使用正确版本的GWT或GXT。

As El Hoss mentions in the comments, GWT 2.7 dropped support for IE6, and to be compatible, GXT 3.1 did the same. If you are seeing references to IE6, you either have customizations in your own project that use IE6, or are not actually using the correct versions of GWT or GXT.

这篇关于从3.0.0升级后无法运行Gxt 3.1.1应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-12 13:44