问题描述:

 package com.wa.test.client;

import com.google.gwt.core.client.EntryPoint;

import com.nubotech.gwt.oss.client.OnlineStorageService;

import com.nubotech.gwt.oss.client.OnlineStorageServiceFactory;

import com.nubotech.gwt.oss.client.auth.Credential;

public class TestAmazon implements EntryPoint {

public void onModuleLoad() {

Credential credential = new Credential("[email protected]", "QFTG8an1yTB");

OnlineStorageService storageService = OnlineStorageServiceFactory.getService(credential);

storageService.createBucket("myFirstBucket");

}

}

<?xml version="1.0" encoding="UTF-8"?>

<module rename-to='testamazon'>

<!-- Inherit the core Web Toolkit stuff. -->

<inherits name='com.google.gwt.user.User'/>

<inherits name='com.nubotech.gwt.oss.Oss'/>

<!-- Inherit the default GWT style sheet. You can change -->

<!-- the theme of your GWT application by uncommenting -->

<!-- any one of the following lines. -->

<inherits name='com.google.gwt.user.theme.clean.Clean'/>

<!-- <inherits name='com.google.gwt.user.theme.standard.Standard'/> -->

<!-- <inherits name='com.google.gwt.user.theme.chrome.Chrome'/> -->

<!-- <inherits name='com.google.gwt.user.theme.dark.Dark'/> -->

<!-- Other module inherits -->

<!-- Specify the app entry point class. -->

<entry-point class='com.wa.test.client.TestAmazon'/>

<!-- Specify the paths for translatable code -->

<source path='client'/>

<source path='shared'/>

![enter image description here][1]</module>

This is my code and also include jar file gwt-s3-api-0.9.3.

Its give an error as follow:

12:40:38.347 [ERROR] [testamazon] Errors in 'jar:file:/D:/Technologies/Java/Amazon/jar/

gwt-s3-api-0.9.3.jar!/com/nubotech/gwt/oss/client/s3/MockS3OnlineStorageService.java'

[ERROR] [testamazon] - Line 28: The import com.google.gwt.user.client.HTTPRequest

cannot be resolved

网友答案:

You are using mismatched version of jars. com.google.gwt.user.client.HTTPRequest was available in older version of GWT gwt-servlet.jar and gwt-user.jar . It got deprecated in GWT 1.5 and in latest GWT it is eliminated. You should be using GWT RequestBuilder.

<inherits name='com.google.gwt.http.HTTP'/>

In Java code.

import com.google.gwt.http.client.RequestBuilder

Reference - http://google-web-toolkit.googlecode.com/svn/javadoc/1.5/com/google/gwt/user/client/HTTPRequest.html

The third party jar you are using is very old and not updated for 3 years.

In your case the MockS3OnlineStorageService.java inside the gwt-s3-api-0.9.3.jar is using HTTPRequest class which is no longer supported in GWT 2.4

相关阅读:
Top