Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JAXB "AccessType cannot be resolved"

 
Richard Roszak
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I’m working on a large project that is using JDK1.5 and it looks as if the xsd’s have generated java files using JAXB 1.0. I’m trying to use JAXB 2.0 to generate new java files where I have modified the xsd’s. I generate the java files but there are compile errors:

“AccessType cannot be resolved” and “The import javax.xml.bind.annotation.AccessType cannot be resolved”

Is it possible to have generated files in the same project using both versions of JAXB?

Thanks
 
R Srini
Ranch Hand
Posts: 215
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just curious. Is there a specific reason for you to maintain generated source from two different versions? Are there existing consumers whose code will break if you upgrade to 2.0? Or are you worried about breaking your existing code's behaviour if you regenerate all the classes?

If not, you could regenerate all the code for 2.0 - its a one-time deal. Of course, if you need to maintain the original code for compatibility reasons, and have the new code coexist, then that is a different matter.

In case you are using Web Services Developer Pack 2.0, then please look at this: http://java.sun.com/webservices/docs/2.0/ReleaseNotes.html#RedistributableComponents . Look for this section: "Using JAXP 1.3.1_01 in Java WSDP 2.0 with J2SE 5.0". Maybe this is what you need?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic