This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I am using WebLogic Workshop9.2 with JDK 1.5. My code is running fine on it. When I tried to run it on Weblogic 10 with JDK 1.6, I am getting following compile time error "Type mismatch: cannot convert from AccessType to XmlAccessType". I have to run with latest JAXB jars but not able to resolve it.
Joined: Sep 26, 2007
I am facing the same problem again. Any resolution?
That's because weblogic 9.2 and weblogic 10 have different server classpath.
Chances are that weblogic 10 has a different version of the JAXB jar in its classpath (that it uses by default) but it is not the version expected by your application.
So if you have JAXB jar in your web-inf/lib you need to tell weblogic to use your version of JAXB instead of his.
You do that by adding under WEB-INF the file weblogic.xml with the following content
This did'nt work for me. I am still getting the same error.
Joined: Oct 21, 2008
Hum I remember now that the jdk1.6 has a bigger api than jdk1.5 and it comes with a default impleementation for JAXB.
Maybe at runtime the JAXB from the jdk which is used and it's the version expected by your app.
There is mechanism to override the apis provided by default in the jdk.
so if you have a different version of JAXB you want to use on your file system just tell the jdk to use your version
instead of its default impl.
try to give that a go
Joined: Sep 26, 2007
Then how to resolve it? Should I creata a endorsed dit in <java-home>\lib\endorsed location and place all the JAXB jars from <project dir>/WEB-INF/lib to endorsed folder?
Step 1: Forget about WebLogic for now, write a small Java application which you can run under Java 6, and have it do the process you're now doing in WebLogic. Make sure it only uses the Java 6 version of JAXB and doesn't use any of the pre-Java-6 JAXB jars.
Step 2: When you have that working, implement the changes you had to make into the code which will run in WebLogic. Deploy that code into WebLogic, without any of the pre-Java-6 JAXB jars.