Results 1 to 5 of 5
  1. #1
    SnakeDoc is offline Senior Member
    Join Date
    Apr 2012
    Posts
    129
    Rep Power
    0

    Question 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 more
    Last edited by SnakeDoc; 04-17-2012 at 08:05 PM. Reason: Clarity

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,423
    Rep Power
    20

    Default Re: Exception in thread "main" java.lang.ExceptionInInitializerError HELP!

    Quote Originally Posted by SnakeDoc View Post
    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?
    Have you read the API for that class?

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  3. #3
    SnakeDoc is offline Senior Member
    Join Date
    Apr 2012
    Posts
    129
    Rep Power
    0

    Default 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.

  4. #4
    SnakeDoc is offline Senior Member
    Join Date
    Apr 2012
    Posts
    129
    Rep Power
    0

    Default 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... :-/ )

  5. #5
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,423
    Rep Power
    20

    Default 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.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. Replies: 5
    Last Post: 12-21-2011, 06:44 PM
  2. Replies: 14
    Last Post: 04-08-2011, 06:01 PM
  3. Replies: 5
    Last Post: 06-22-2010, 03:51 PM
  4. Replies: 1
    Last Post: 11-20-2009, 07:58 PM
  5. Replies: 1
    Last Post: 07-16-2009, 10:35 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •