Results 1 to 5 of 5
- 04-17-2012, 08:01 PM #1
Senior Member
- Join Date
- Apr 2012
- Posts
- 127
- Rep Power
- 0
Exception in thread "main" java.lang.ExceptionInInitializerError HELP!
I'm getting the above error after compiling successfully with no errors and then trying to run my program. Can someone help me interpret this error? thanks!
Java Code:C:\java_dev_new_complete>javac -cp ".;*.jar" com\amazonservices\mws\sellers\samp les\GetServiceStatusSample.java
Java Code:C:\java_dev_new_complete>java com.amazonservices.mws.sellers.samples.GetServiceS tatusSample
Java Code:Exception in thread "main" java.lang.ExceptionInInitializerError at com.amazonservices.mws.sellers.MarketplaceWebServiceSellersClient.<cl init>(MarketplaceWebServiceSellersClient.java:111) at com.amazonservices.mws.sellers.samples.GetServiceStatusSample.main(Ge tServiceStatusSample.java:69) Caused by: javax.xml.bind.JAXBException: Provider com.sun.xml.internal.bind.v2.C ontextFactory could not be instantiated: javax.xml.bind.JAXBException: "com.amaz onservices.mws.sellers.model" doesnt contain ObjectFactory.class or jaxb.index - with linked exception: [javax.xml.bind.JAXBException: "com.amazonservices.mws.sellers.model" doesnt con tain ObjectFactory.class or jaxb.index] at javax.xml.bind.ContextFinder.newInstance(Unknown Source) at javax.xml.bind.ContextFinder.find(Unknown Source) at javax.xml.bind.JAXBContext.newInstance(Unknown Source) at javax.xml.bind.JAXBContext.newInstance(Unknown Source) at com.amazonservices.mws.sellers.MarketplaceWebServiceSellersClient.<cl init>(MarketplaceWebServiceSellersClient.java:107) ... 1 more Caused by: javax.xml.bind.JAXBException: "com.amazonservices.mws.sellers.model" doesnt contain ObjectFactory.class or jaxb.index at com.sun.xml.internal.bind.v2.ContextFactory.createContext(Unknown Sou rce) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at javax.xml.bind.ContextFinder.newInstance(Unknown Source) ... 6 moreLast edited by SnakeDoc; 04-17-2012 at 08:05 PM. Reason: Clarity
- 04-17-2012, 09:46 PM #2
- 04-17-2012, 10:06 PM #3
Senior Member
- Join Date
- Apr 2012
- Posts
- 127
- Rep Power
- 0
Re: Exception in thread "main" java.lang.ExceptionInInitializerError HELP!
Hello db!
If you are referring to the documentation for the GetServiceStatusSample class file, then yes, i've read the entire provided documentation from Amazon (this class file is part of the Amazon MWS API Java Client Library)... and unfortunately Amazon's documentation... is lacking.
If you are referring to the documentation for the javax.bind.xml 3rd party dependency, then yes i've attempted to read this through and understand it, but I'm afraid I may be missing something.
my errors seem to tell me that i'm missing the jaxb.index file, however I'm unsure what that could be. I basically unzipped the provided Client Library from Amazon and configured the API credentials I was provided with... and then they say to run the sample code... whcih I'm trying to, but getting this error above.
in case it helps: https://developer.amazonservices.com...0701/java.html <--------- place to look at the API files and instructions.
- 04-18-2012, 12:44 AM #4
Senior Member
- Join Date
- Apr 2012
- Posts
- 127
- Rep Power
- 0
Re: Exception in thread "main" java.lang.ExceptionInInitializerError HELP!
Ok i figured this one out. Thanks db for your assistance.
ended being I was importing the javax.bind.xml dependency incorrectly. I ended up starting over this time using Eclipse and got no errors. Woot! (although this means I have zero understanding of how to properly do this on my own without the help of an IDE... :-/ )
- 04-18-2012, 06:31 AM #5
Re: Exception in thread "main" java.lang.ExceptionInInitializerError HELP!
I was referring to the documentation for ExceptionInInitializerError.
Glad your problem is solved, one way or another. You probably had a wrong version of a dependency on your classpath.
dbWhy do they call it rush hour when nothing moves? - Robin Williams
Similar Threads
-
Got struck with this :- " Exception in thread "main" java.lang.NullPointerException"
By Vermont in forum New To JavaReplies: 5Last Post: 12-21-2011, 06:44 PM -
Exception in thread "main" java.lang.NumberFormatException:input string: "060320
By renu in forum New To JavaReplies: 14Last Post: 04-08-2011, 06:01 PM -
Question about error "Exception in thread "main" java.lang.NoSuchMethodError: main
By ferdzz in forum New To JavaReplies: 5Last Post: 06-22-2010, 03:51 PM -
Runtime error "Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0
By shantimudigonda in forum New To JavaReplies: 1Last Post: 11-20-2009, 07:58 PM -
Exception in thread "main" java.lang.NullPointerException at LinkedList.main(Link
By kavitha_0821 in forum New To JavaReplies: 1Last Post: 07-16-2009, 10:35 AM


LinkBack URL
About LinkBacks
Reply With Quote


Bookmarks