asolfre / typica

Automatically exported from code.google.com/p/typica
Apache License 2.0
0 stars 0 forks source link

JAXBuddy.getUnmarshaller() fails with NoSuchMethodException for 'ObjectFactory.createContext()' [against M/DB] #75

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.
SimpleDB db = new SimpleDB(accessKey, secretKey,
                           false, mdbIpAddress);
db.setResourcePrefix("/mdb/request.mgwsi");
2.
Domain domain = db.createDomain(tableName);

What is the expected output? What do you see instead?
I get "Problem parsing returned message" on the console,
I can't get farther than 'db.createDomain(tableName)'
above. Important to note that this command *works*, the 
domain is created. It's the reply that can't be retrieved
(here I mean the reply is 'domain') because during the
process for some reason the ContextFinder of JAXB tries 
to invoke 'createContext()' on
com.xerox.amazonws.typica.sdb.jaxb.ObjectFactory,
which indeed does not exist (see stack trace below). How
come JAXB tries to find a 'createContext()' in ObjectFactory ?
Line 109 in JAXBuddy is:
jc = JAXBContext.newInstance(typePackage, c.getClassLoader());

What version of the product are you using? On what operating system?
JDK 1.5
Typica 1.6
Windows XP

Please provide any additional information below.
I took your class DBLoader coming from the article 
'Relating to Amazon SimpleDB' and slightly adapted it 
to connect to M/DB appliance (see first section above).
As I said the command works: from a browser connected to
M/DB I can see my domain once I've run the code above,
until I get the exception.

The whole stack trace:
Problem parsing returned message.
com.xerox.amazonws.sdb.SDBException: Problem parsing returned message.
        at com.xerox.amazonws.sdb.SimpleDB.makeRequestInt(SimpleDB.java:246)
        at com.xerox.amazonws.sdb.SimpleDB.createDomain(SimpleDB.java:155)
        at com.directthought.simpledb.DBLoader.main(DBLoader.java:143)
Caused by: javax.xml.bind.JAXBException: Provider
com.xerox.amazonws.typica.sdb.jaxb.ObjectFactory could not be instantiated:
java.lang.NoSuchMethodException:
com.xerox.amazonws.typica.sdb.jaxb.ObjectFactory.createContex
t(java.lang.String, java.lang.ClassLoader)
 - with linked exception:
[java.lang.NoSuchMethodException:
com.xerox.amazonws.typica.sdb.jaxb.ObjectFactory.createContext(java.lang.String,
java.lang.ClassLoader)]
        at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:172)
        at javax.xml.bind.ContextFinder.find(ContextFinder.java:257)
        at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:372)
        at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:337)
        at
com.xerox.amazonws.common.JAXBuddy.getUnmarshaller(JAXBuddy.java:109)
        at
com.xerox.amazonws.common.JAXBuddy.deserializeXMLStream(JAXBuddy.java:79)
        at
com.xerox.amazonws.common.AWSQueryConnection.makeRequest(AWSQueryConnection.java
:414)
        at com.xerox.amazonws.sdb.SimpleDB.makeRequestInt(SimpleDB.java:242)
        ... 2 more
Caused by: java.lang.NoSuchMethodException:
com.xerox.amazonws.typica.sdb.jaxb.ObjectFactory.createContext(java.lang.String,
java.lang.ClassLoader)
        at java.lang.Class.getMethod(Class.java:1581)
        at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:140)
        ... 9 more

Original issue reported on code.google.com by sglrig...@gmail.com on 30 Dec 2009 at 3:45

GoogleCodeExporter commented 9 years ago
Woops I'M SORRY I opened this issue to quickly: in fact I added
myself the line 
javax.xml.bind.context.factory=com.xerox.amazonws.typica.sdb.jaxb.ObjectFactory
in a jaxb.properties file that I appended to typica.jar, because
yesterday without this properties file my process failed with
"cannot find jaxb.properties file" error; today I removed the
jaxb.properties from typica.jar and... so far everything works
fine. You can close/reject this issue actually.

Original comment by sglrig...@gmail.com on 30 Dec 2009 at 4:52

GoogleCodeExporter commented 9 years ago

Original comment by dkavan...@gmail.com on 22 Mar 2010 at 4:16