2011-12-02 108 views
3

我一直在6.7.2上開發相​​當長一段時間,昨天我注意到我的應用程序的怪異外觀版本。我去調試版本,發現這個:Vaadin警告:widgetset版本6.7.2似乎不匹配主題版本

Starting Vaadin client side engine. Widgetset: Xinco 
Widget set is built on version: 6.7.2 
Warning: widgetset version 6.7.2 does not seem to match theme version 
Starting application xincovaadin-1652339780 
Vaadin application servlet version: 6.7.2 
Application version: NONVERSIONED 
inserting load indicator 
Making UIDL Request with params: init 
Server visit took 30ms 
JSON parsing took 0ms 
Assuming CSS loading is not complete, postponing render phase. (.v-loading-indicator height == 0) 

我該如何解決這個問題?我嘗試重建我的小部件沒有運氣。上面的第11行重複了很多次。

參見:https://vaadin.com/forum/-/message_boards/view_message/953384

編輯:

從螢火蟲:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
<meta content="text/html; charset=utf-8" http-equiv="Content-Type"> 
<style type="text/css"> 
<link href="/xinco/VAADIN/themes/xinco/favicon.ico" type="image/vnd.microsoft.icon" rel="shortcut icon"> 
<link href="/xinco/VAADIN/themes/xinco/favicon.ico" type="image/vnd.microsoft.icon" rel="icon"> 
<title>Xinco</title> 
<link rel="stylesheet" type="text/css" href="/xinco/VAADIN/themes/xinco/styles.css"> 
<link rel="stylesheet" href="http://localhost:8084/xinco/VAADIN/widgetsets/Xinco/easyuploads.css"> 
<link rel="stylesheet" href="http://localhost:8084/xinco/VAADIN/widgetsets/Xinco/expandingtextarea/expandingtextarea.css"> 
<link rel="stylesheet" href="http://localhost:8084/xinco/VAADIN/widgetsets/Xinco/stepper/stepper.css"> 
</head> 
<body class="v-generated-body v-ff v-ff8 v-ff80 v-gecko v-win" scroll="auto"> 
<script type="text/javascript"> 
<iframe id="__gwt_historyFrame" src="javascript:false" style="position:absolute;width:0;height:0;border:0;overflow:hidden;" tabindex="-1"> 
<script src="/xinco/VAADIN/widgetsets/Xinco/Xinco.nocache.js?1323124855776" language="javascript"> 
<script src="http://localhost:8084/xinco/VAADIN/widgetsets/Xinco/swfupload.js" language="javascript"> 
<script defer="defer"> 
<script type="text/javascript"> 
<script type="text/javascript"> 
<div id="xincovaadin-1652339780" class="v-app v-theme-xinco v-app-Xinco"> 
<noscript>You have to enable javascript in your browser to use an application built with Vaadin.</noscript> 
<iframe id="Xinco" src="javascript:''" style="position: absolute; width: 0pt; height: 0pt; border: medium none;" tabindex="-1"> 
</body> 
</html> 

這是我所看到的在看網頁的源文件時:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> 
<style type="text/css">html, body {height:100%;margin:0;}</style><link rel="shortcut icon" type="image/vnd.microsoft.icon" href="/xinco/VAADIN/themes/xinco/favicon.ico" /><link rel="icon" type="image/vnd.microsoft.icon" href="/xinco/VAADIN/themes/xinco/favicon.ico" /><title>Xinco</title> 
</head> 
<body scroll="auto" class="v-generated-body"> 
<script type="text/javascript"> 
//<![CDATA[ 
if(!vaadin || !vaadin.vaadinConfigurations) { 
if(!vaadin) { var vaadin = {}} 
vaadin.vaadinConfigurations = {}; 
if (!vaadin.themesLoaded) { vaadin.themesLoaded = {}; } 
vaadin.debug = true; 
document.write('<iframe tabIndex="-1" id="__gwt_historyFrame" style="position:absolute;width:0;height:0;border:0;overflow:hidden;" src="javascript:false"></iframe>'); 
document.write("<script language='javascript' src='/xinco/VAADIN/widgetsets/Xinco/Xinco.nocache.js?1323183529006'><\/script>"); 
} 
vaadin.vaadinConfigurations["xincovaadin-1652339780"] = {appUri:'/xinco/vaadin', standalone: true, themeUri:"/xinco/VAADIN/themes/xinco", versionInfo : {vaadinVersion:"6.7.2",applicationVersion:"NONVERSIONED"},"comErrMsg": {"caption":"Communication problem","message" : "Take note of any unsaved data, and <u>click here<\/u> to continue.","url" : null},"authErrMsg": {"caption":"Authentication problem","message" : "Take note of any unsaved data, and <u>click here<\/u> to continue.","url" : null}}; 
//]]> 
</script> 
<script type="text/javascript"> 
//<![CDATA[ 
if(!vaadin.themesLoaded['xinco']) { 
var stylesheet = document.createElement('link'); 
stylesheet.setAttribute('rel', 'stylesheet'); 
stylesheet.setAttribute('type', 'text/css'); 
stylesheet.setAttribute('href', '/xinco/VAADIN/themes/xinco/styles.css'); 
document.getElementsByTagName('head')[0].appendChild(stylesheet); 
vaadin.themesLoaded['xinco'] = true; 
} 
//]]> 
</script> 
<script type="text/javascript"> 
//<![CDATA[ 
setTimeout('if (typeof Xinco == "undefined") {alert("Failed to load the widgetset: /xinco/VAADIN/widgetsets/Xinco/Xinco.nocache.js?1323183529006")};',15000); 
//]]> 
</script> 
<div id="xincovaadin-1652339780" class="v-app v-theme-xinco v-app-Xinco" ><div class="v-app-loading"></div></div> 
<noscript>You have to enable javascript in your browser to use an application built with Vaadin.</noscript></body> 
</html> 

源代碼可以從fr下載om here。該項目是一個NetBeans項目。

回答

4

你使用哪個主題?假設它是一個自定義主題,如果您使用默認主題,錯誤消息會消失嗎?

還要確保:

  • 清理您的項目和應用程序服務器,並重建項目
  • 您沒有兩個不同版本的Vaadin JAR在你的WEB-INF/lib目錄目錄
  • 您還沒有複製從舊Vaadin JAR主題目錄到VAADIN/themes目錄
  • 你(假定)的自定義主題不繼承任何舊的主題
  • 如果您在瀏覽器中檢查加載的css文件(當我嘗試此操作時Firebug派上用場),styles.css(或其中一個styles.css)包含以下開頭部分:

    .v-theme-版本:在{ 內容:「6_7_2」; } .v-theme-version-6_7_2 { display:none; }

我設法生產出此錯誤的唯一方法就是繼承從另一個Vaadin版本的主題自定義主題。

更新: 我檢查了你的項目,我想我知道什麼是錯的。 web.xml中的servlet映射應該讀取/ VAADIN/*而不是/ vaadin/*。如果您將主題從您的vaadin.jar複製到項目中的VAADIN /主題,它應該在沒有此更改的情況下工作。通常情況下,您還應該複製Vaadin widgetset,但由於您使用的是自定義的widgetset,因此不必執行此操作。

來源:https://vaadin.com/book/-/page/application.environment.html#section.web.web-xml

+0

我有一個自定義主題。我正在導入@import「../chameleon/styles.css」;自定義主題幾乎爲空,只需添加一個fav圖標即可。我查看了我的自定義style.css文件,並且它沒有任何地方有6_7_2。我沒有Vaadin jar的多個副本,我唯一的主題是我的vaadin-chameleon-theme-1.1.0.jar。我的style.css文件是由chamaleon主題應用程序生成的。 – javydreamercsw

+0

它被命名爲style.css或styles.css?它應該是後者。您的導入看起來很好。您是否通過查看HTML源代碼來檢查瀏覽器中的6_7_2? – miq

+0

您的自定義styles.css中不應該有6_7_2零件,除非它不是從其他主題繼承而是從零開始創建的。您也可以嘗試刪除vaadin-chameleon-theme-1.1.0.jar。當我在2個操作系統中下載相同的自定義主題時,我注意到一個有趣的事情;在Windows 7中,我獲得了my-chameleon.jar,README.txt和vaadin-chameleon-theme-1.1.0.jar,但在Linux Mint中,我只獲得了my-chameleon.jar。嘗試下載Firebug並檢查CSS是否已加載。你應該看到這樣的東西:http://dl.dropbox.com/u/9481707/custom_theme.png – miq

0

你是否從vaadin.jar提取了VAADIN/themes文件夾,以便它靜態地提供服務?在這種情況下,您需要使用Vaadin 6.7.2的內容更新該目錄。

或者,您是否在VAADIN /主題下創建了與您正在使用的Vaadin主題同名的文件夾?

+0

1)我沒有提取Vaadin /主題從罐子文件夾中。 2)是的,我做到了。自定義主題幾乎爲空,只需添加一個fav圖標即可。我的style.css文件是由chamaleon主題應用程序生成的。 – javydreamercsw

+0

您的主題文件夾的名稱是什麼,並且styles.css頂部的導入如何顯示? –

+0

這個名字是新科。導入是:@import「../chameleon/styles.css」; – javydreamercsw