Error inherits module: Windows azure blobstore in gwt and not GAE Blobstore

110 views Asked by At

I used Windows Azure SDK for java in gwt, and obtain this problem in gwt:

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

Any idea?, for example correct value for <inherits name ="....."/>

this is the code, but the problem not is the code, is the correct value for 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);
        }

    }
}
1

There are 1 answers

0
spg On

I'm not too familiar with Azure, but I highly suspect that the Azure Java SDK is to be used on the server side. There must be code in this SDK that is not emulated by GWT.

Any code that is not already emulated by GWT (see here for a list of emulated classes) must be accompanied by GWT-translatable sources (see <super-source/> here).