Walkthrough: AWS: Java Code Sample: Step 6

Step: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | N

6) javac *.java 

The instruction is saying "compile all the code." This assumes you're in the JavaSampleCode directory (you made a copy of this directory, right?). When I did this command using version 3.1 of Amazon's SDK, the Java compiler produced seven errors.

% javac *.java
BrowseNodeSoap.java:28: cannot resolve symbol
symbol  : method setBrowse_Node (java.lang.String)
location: class com.amazon.soap.axis.BrowseNodeRequest
                request.setBrowse_Node((String)this.parameters.get("Browse Node"));
                       ^
ExchangeSoap.java:25: cannot resolve symbol
symbol  : method setExchange_Id (java.lang.String)
location: class com.amazon.soap.axis.ExchangeRequest
                request.setExchange_Id((String)this.parameters.get("Exchangeid"));
                       ^
ListManiaSoap.java:26: cannot resolve symbol
symbol  : method setLm_Id (java.lang.String)
location: class com.amazon.soap.axis.ListManiaRequest
                request.setLm_Id((String)this.parameters.get("ListManiaId"));
                       ^
ListSoap.java:28: cannot resolve symbol
symbol  : method setLm_Id (java.lang.String)
location: class com.amazon.soap.axis.ListManiaRequest
                request.setLm_Id((String)this.parameters.get("List"));
                       ^
SellerProfileSoap.java:26: cannot resolve symbol
symbol  : method setSeller_Id (java.lang.String)
location: class com.amazon.soap.axis.SellerProfileRequest
                request.setSeller_Id((String)this.parameters.get("Sellerid"));
                       ^
SellerSoap.java:27: cannot resolve symbol
symbol  : method setSeller_Id (java.lang.String)
location: class com.amazon.soap.axis.SellerRequest
                request.setSeller_Id((String)this.parameters.get("Sellerid"));
                       ^
WishlistSoap.java:27: cannot resolve symbol
symbol  : method setWishlist_Id (java.lang.String)
location: class com.amazon.soap.axis.WishlistRequest
                request.setWishlist_Id((String)this.parameters.get("WishListId"));
                       ^
7 errors

Let's look at the first error on line 28 of the BrowseNodeSoap.java file:

BrowseNodeSoap.java:28: cannot resolve symbol
symbol  : method setBrowse_Node (java.lang.String)
location: class com.amazon.soap.axis.BrowseNodeRequest
                request.setBrowse_Node((String)this.parameters.get("Browse Node"));
                       ^

The compiler cannot resolve the symbol "setBrowse_Node". This incorrect symbol is being used in the class com.amazon.soap.axis.BrowseNodeRequest. This is one of those programs generated by WSDL2Java (from Step 5).

If you examine both files carefully (BrowseNodeSoap.java and BrowseNodeRequest.java), you'll see that the JavaSampleCode file BrowseNodeSoap.java makes this reference (in line 28):

 	request.setBrowse_Node((String)this.parameters.get("Browse Node"));

But if you look at the file com\amazon\soap\axis\BrowseNodeRequest.java, you'll see that it has a method setBrowse_node, which does not have a capital "N".

 	public void setBrowse_node(java.lang.String browse_node) {

To fix the error, modify the code in the JavaCodeSample directory, not the com\amazon\soap\axis directory (as the files in that directory are generated by WSDL2Java). The fix is to change setBrowse_Node to setBrowse_node (lowercasing the word "node").

This is the fix for all of the errors that the compiler produced. I had to examine the JavaCodeSample file against the corresponding boilerplate code generated by WSDL2Java. The difference in all the errors was a capital letter used in place of a lowercase letter.

Next
Step: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | N


Rick (rgu@TheWorld.com) Umali
Last Update: 2/24/2004