Exception in thread “main” javax.xml.bind.PropertyException: name: eclipselink.media-type value: application/json

前端 未结 3 902
鱼传尺愫
鱼传尺愫 2021-02-12 16:28

I\'m attempting to follow the example located here but get an javax.xml.bind.PropertyException. I receive this exception because of the following line of code:

m         


        
3条回答
  •  抹茶落季
    2021-02-12 16:54

    You need to have the EclipseLink jars (2.4.0 or newer) on your class path, and a jaxb.properties file in the same package as the classes used to bootstrap theJAXBContext with the following entry:

    javax.xml.bind.context.factory=org.eclipse.persistence.jaxb.JAXBContextFactory
    

    Below is a link to an example on GitHub that you can run to see everything working:

    • https://github.com/bdoughan/blog20110819

提交回复
热议问题