Unable to generate JAXB classes [message #804386] |
Wed, 22 February 2012 10:14  |
Eclipse User |
|
|
|
I am trying to generate the jaxb classes in eclipse from a xsd file and am getting the error: Could not find the main class: java/util/Arrays/useLegacyMergeSort=true. This is with Indigo, windows vista, java version 7 and as far as I know I am using the latest updates for all. I had been generating the jaxb classes okay on this machine a few months ago. I tried adding -Djava.util.Arrays.useLegacyMergeSort=true to my eclipse.ini but with no luck. Any suggestions please?
|
|
|
|
|
|
Re: Unable to generate JAXB classes [message #805307 is a reply to message #804471] |
Thu, 23 February 2012 11:03   |
Eclipse User |
|
|
|
It sounds like there might be some cached settings that are causing a problem, but I think we should make sure this workaround is reasonable. Running JAXB 2.2 in Java 1.6 can be problematic, and requires special JRE configuration. As long as you are generating 2.2 classes in Dali, and running 2.2 in production, that should be OK, but running newer JAXB generated code in older (1.6 embedded JAXB 2.1) could cause problems.
Dali will recreate the launch config with each run, so that would explain why your changes aren't sticking around. Dali will use the execution environment specified for the particular project it is running in, so I assume that it is set to 1.6 in this case, and as a result we will use 1.6. This is because as I mentioned before, the generation is sensitive to JDK and JAXB levels. Since you are actually trying to use JAXB 2.2 libs, they may have a runtime dependency on Java 7, which perhaps results in the error you are seeing when running against 1.6.
Neil
|
|
|
|
Re: Unable to generate JAXB classes [message #805462 is a reply to message #805350] |
Thu, 23 February 2012 15:01  |
Eclipse User |
|
|
|
That's correct. Please see the bug below for more info on running JAXB 2.2 with 1.6. It is certainly possible, but does involve making some changes to the JRE. That said, I have not had much success making this configuration work inside of Eclipse.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=345453
Also, with JAXB it's important to understand your deployment environment when generating classes. You could end up generating classes that don't work if you generate with JAXB 2.2 and deploy to a JAXB 2.1/JRE 1.6 environment.
Neil
|
|
|
Powered by
FUDForum. Page generated in 0.05334 seconds