• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Type mismatch: cannot convert from AccessType to XmlAccessType

 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
Please help.
 
Himanhsu Yadav
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am facing the same problem again. Any resolution?
 
Ranch Hand
Posts: 180
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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

<container-descriptor>
<prefer-web-inf-classes>true</prefer-web-inf-classes>
</container-descriptor>

I hope that'll help
 
Himanhsu Yadav
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This did'nt work for me. I am still getting the same error.
 
ntumba lobo
Ranch Hand
Posts: 180
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
http://download.oracle.com/javase/1.5.0/docs/guide/standards/index.html

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
 
Himanhsu Yadav
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Marshal
Posts: 28226
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic