2013-12-17 49 views
0

我使用的Windows Azure SDK在GWT的Java,並獲得GWT這個問題:錯誤繼承模塊:Windows Azure的Blob存儲在GWT和GAE不Blob存儲區

No source code is available for type com.microsoft.windowsazure.services.core.storage.CloudStorageAccount; did you forget to inherit a required module? 

任何想法?對於<inherits name ="....."/>例如正確的值

這是代碼,但問題並非是代碼,是繼承名稱的正確值:

public class StorageSmple { 

    public static final String storageConnectionString = 
      "DefaultEndpointsProtocol=http;" + 
       "AccountName=xxxxxx;" + 
       "AccountKey=xxxxxxx"; 

    public void executeProgram() 
    { 
     try 
     { 
      CloudStorageAccount account; 
      CloudBlobClient serviceClient; 
      CloudBlobContainer container; 
      CloudBlockBlob blob; 

      account = CloudStorageAccount.parse(storageConnectionString); 
      serviceClient = account.createCloudBlobClient(); 
      // Container name must be lower case. 
      container = serviceClient.getContainerReference("gettingstarted"); 
      container.createIfNotExist(); 

      // Set anonymous access on the container. 
      BlobContainerPermissions containerPermissions; 
      containerPermissions = new BlobContainerPermissions(); 
      containerPermissions.setPublicAccess(BlobContainerPublicAccessType.CONTAINER); 
      container.uploadPermissions(containerPermissions); 

      // Upload an image file. 
      blob = container.getBlockBlobReference("image"); 
      File fileReference = new File ("www.xxx/a254.png"); 
      blob.upload(new FileInputStream(fileReference), fileReference.length()); 

      // At this point the image is uploaded. 
      // Next, create an HTML page that lists all of the uploaded images. 
      MakeHTMLPage(container); 

      System.out.println("Processing complete."); 
      System.out.println("Open index.html to see the images stored in your storage account."); 

     }catch (Exception e){ 
      System.out.print("Exception encountered: "); 
      System.out.println(e.getMessage()); 
     } 
    } 

    // Create an HTML page that can be used to display the uploaded images. 
    // This example assumes all of the blobs are for images. 
    public void MakeHTMLPage(CloudBlobContainer container) throws FileNotFoundException, URISyntaxException 
{ 


     // Enumerate the uploaded blobs. 
     for (ListBlobItem blobItem : container.listBlobs()) { 
      HTMLPanel b = new HTMLPanel("<img src='" + blobItem.getUri() + "'/><br/>"); 
      RootPanel.get().add(b); 
     } 

    } 
} 
+0

你有源代碼嗎? –

回答

0

我不是太熟悉Azure的,但我高度懷疑Azure Java SDK將在服務器端使用。這個SDK中必須有代碼不被GWT模擬。

GWT尚未模擬任何代碼(請參閱here瞭解模擬類列表)必須附帶GWT可翻譯的源代碼(請參閱<super-source/>here)。