Hi,
I am trying to create a simple jax-rpc client, to query the amazon web services. I am getting the following runtime errors .... does any body know where the problem could be. I am also pasting the code for my AmazonProxy class. I created the client side files using the wscompile tool.
Exception in thread "main" java.lang.NoClassDefFoundError: javax.activation.Data
Handler
at com.sun.xml.rpc.encoding.soap.StandardSOAPTypeMappings.class$(StandardSOAPTypeMappings.java:28)
at com.sun.xml.rpc.encoding.soap.StandardSOAPTypeMappings.<init>(StandardSOAPTypeMappings.java:445)
at com.sun.xml.rpc.encoding.StandardTypeMappings.getSoap(StandardTypeMappings.java:28)
at com.sun.xml.rpc.client.BasicService.createSoapMappings(BasicService.java:170)
at com.sun.xml.rpc.client.BasicService.createStandardTypeMappingRegistry(BasicService.java:160)
at myAmazonClient.AmazonSearchService_SerializerRegistry.getRegistry(AmazonSearchService_SerializerRegistry.java:22)
at myAmazonClient.AmazonSearchService_Impl.<init>(AmazonSearchService_Impl.java:22)
at AmazonProxy.getBookNames(amazonproxy.java:32)
at AmazonProxy.main(amazonproxy.java:64)
import myAmazonClient.*;
import javax.xml.rpc.*;
import java.util.Vector;
import java.net.URL;
public class AmazonProxy{
private String[] imageURL;
private String[] bookReviews;
private String[] books;
static int detailLength;
public AmazonProxy() {
}
public Vector getBookTypes() {
Vector v = new Vector();
v.addElement("Blue Prints");
v.addElement("Web Services");
v.addElement("Wireless");
v.addElement("J2EE");
v.addElement("Solaris");
v.addElement("J2SE");
v.addElement("EJB");
v.addElement("JMS");
return v;
}
public String[] getBookNames(String type) {
// String books[];
try{
Stub stub = (Stub) (new myAmazonClient.AmazonSearchService_Impl().getAmazonSearchPort());
myAmazonClient.AmazonSearchPort asp = (myAmazonClient.AmazonSearchPort) stub;
myAmazonClient.KeywordRequest kwr = new myAmazonClient.KeywordRequest(type,"1","books","D3HW0PG66IPLAM","heavy","D3HW0PG66IPLAM","");
myAmazonClient.ProductInfo pinfo = asp.keywordSearchRequest(kwr);
myAmazonClient.Details details[] = pinfo.getDetails();
String newline = System.getProperty("line.separator");
detailLength = details.length;
books = new String[detailLength];
imageURL = new String[detailLength];
bookReviews = new String[detailLength];
for (int i=0;i<detailLength;i++) {
// extract data from details vector
books[i] = details[i].getProductName();
}
} catch (Exception e) {
System.out.println("this is an exception test");
//handle exception
}
return books;
}
public String[] getImageURL() {
return imageURL;
}
public String[] getBookReviews() {
return bookReviews;
}
public static void main(String args[]) throws Exception {
try{
String[] bookNames = new String[detailLength];
AmazonProxy amazon = new AmazonProxy();
System.out.println("sullshit");
bookNames = amazon.getBookNames("J2EE");
for (int i=0;i<detailLength;i++) {
// extract data from details vector
System.out.println(bookNames[i]);
}
}catch (Exception e) {
System.out.println(e);
}
}
}
I am doing this as a class project and would appreciate all the help that I can get. I would be looking forward to all replies.
Thanks
atif