简体   繁体   中英

How to make it work newer version of jaxb-api.jar with OC4J server together?

When I try the code block:

JAXBContext jc = 
    JAXBContext.newInstance(JaxbRootElement.class,jaxbElement.getClass());

I got the following error:

java.lang.NoSuchMethodError:
    javax.xml.bind.JAXBContext.newInstance([Ljava/lang/Class;)Ljavax/xml/bind/JAXBContext;

How to tell OC4J server to use my own JAXB-API.jar instead of its own older version?

Ok I found the solution: As OC4J has java 1.5 embedded with it, I needed to find the missing extra jars for the JAXBContext usage.I Put jars in lib directory and add them to my server.xml Here the missing jars:

  • jaxb-impl-2.2.jar
  • activation-1.1.1.jar
  • jaxb-api-2.2.jar

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM