2012-07-27 64 views
0

我有一個maven + spring + gwt(2.4.0)項目。當我運行MVN GWT:跑我得到以下錯誤:錯誤:此處不能使用類型byte []。 (在代理類的請求工廠)

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.5.1:compile (default-compile) on project star: Compilation failure: Compilation failure: 
[ERROR] C:\Users\radu_chilom\Eclipse Workspaces\Spring3\star\src\main\java\com\base\star\shared\proxies\customer\CDocumentProxy.java:[19,8] error: The type byte[] cannot be used here 
[ERROR] C:\Users\radu_chilom\Eclipse Workspaces\Spring3\star\src\main\java\com\base\star\shared\proxies\customer\CDocumentProxy.java:[21,25] error: The type byte[] cannot be used here 
[ERROR] C:\Users\radu_chilom\Eclipse Workspaces\Spring3\star\src\main\java\com\base\star\shared\proxies\dealer\DealerTargetAgreementProxy.java:[35,36] error: The type byte[] cannot be used here 
[ERROR] C:\Users\radu_chilom\Eclipse Workspaces\Spring3\star\src\main\java\com\base\star\shared\proxies\dealer\DealerTargetAgreementProxy.java:[40,15] error: The type byte[] cannot be used here 
[ERROR] C:\Users\radu_chilom\Eclipse Workspaces\Spring3\star\src\main\java\com\base\star\shared\services\dealer\TreeNodeTargetAgreementRequest.java:[29,33] error: Could not find domain method similar to java.util.List<com.base.star.server.dto.dealer.FileTextDTO> getTreeNodeTargetAgreementsList(java.lang.Long) 

我CDocumpentProxy.java樣子:

@ProxyFor(value = com.base.star.server.domain.CDocument.class, locator= 
com.base.star.server.locators.customer.CDocumentLocator.class) 
public interface CDocumentProxy extends EntityProxy { 

byte[] getDocument(); //line 19 

void setDocument(byte[] document); //line 21 

如果我建立與STS 2.9.2工程項目建立起。所以我認爲這個問題對於maven-compiler-plugin來說是不好的配置。

在我.pom文件我有配置Maven編譯器,插件,如:

<plugin> 
    <groupId>org.apache.maven.plugins</groupId> 
    <artifactId>maven-compiler-plugin</artifactId> 
    <version>2.5.1</version> 
    <configuration> 
    <source>1.6</source> 
    <target>1.6</target> 
    <encoding>UTF-8</encoding> 
    </configuration> 
</plugin> 

我不能使用字節[]作爲返回類型的要求在工廠代理的方法?我只是不明白的錯誤..

回答

1

您不能要求在工廠中使用數組:https://developers.google.com/web-toolkit/doc/latest/DevGuideRequestFactory#transportable

話雖這麼說,對於byte[]當量,我寧願使用一個StringList<Byte>,和GWT模擬String#getBytes爲UTF-8和ISO-8859-1字符集。

+0

你說得對。謝謝。所以我已經將所有字節數組更改爲字符串。但我仍然有1個錯誤。最後一個:[ERROR] C:\ Users \ radu_chilom \ Eclipse Workspaces \ Spring3 \ star \ src \ main \ java \ com \ base \ star \ shared \ services \ dealer \ TreeNodeTargetAgreementRequest.java:[29,33] error:無法找到類似於java.util.List getTreeNodeTargetAgreementsList(java.lang.Long)的域方法。 – 2012-07-27 12:01:25

+0

你不明白的是什麼?也許你的方法(在服務器端_service_中)命名不一樣,具有不同的參數或返回類型,或者它不是'public'。 – 2012-07-27 14:32:35

+0

謝謝。它現在有效。 – 2012-07-27 14:41:37

相關問題