问题
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'
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-->
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.
回答1:
Loading inherited module 'com.sencha.gxt.core.Core' [ERROR] Line 96: Value 'ie6' in not a valid value for property 'user.agent'
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.
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.
回答2:
There are some properties which are being set in the GWT and GXT jars like Ex :- user.agent - for GWT lesser than 2.6.0 - they support ie6 :- user.agent - for GWT greater than 2.6.0 - they do not support ie6
So you will get compilation error if you have different versions of GWT and GXT.
Even if you find a work around - it may fail later when you use the different widgets of GWT and GXT. So it is better to change the version earlier.
If youe Base GWT version is lesser than 2.6.0 - then you need GXT jar version lesser than 3.0.1
If you base GWT version greater than or equal to 2.6.0 then you need to add GXT jar version 3.1.X
来源:https://stackoverflow.com/questions/32451248/not-able-to-run-gxt-3-1-1-application-after-upgrading-from-3-0-0