Community
Participate
Working Groups
Create a jpa project that does not have eclipselink moxy on the classpath. Select 'New' -> 'JAXB' -> 'Schema from JAXB Classes' and choose some classes. You will see the 'Use EclipseLink MOXy as the JAXB implementation' checkbox unchecked. Choose a schema location that has spaces in it on the Windows platform and press OK. I generated to the C:\Documents and Settings\foo.xsd location and it generated a schema named Documents on the C drive. If the workspace is in a location with spaces in the directories and you generate directly in to the workspace, the generation fails with: java.io.FileNotFoundException: C:\Documents%20and%20Settings\kamoore\workspace\Foo\Foo.xsd (The system cannot find the path specified) We need double quotes around the file name passed to the schema generator, at least on the windows platform
Created attachment 168842 [details] proposed patch
I am still getting a file not found exception with this patch: java.io.IOException: java.io.FileNotFoundException: C:\Eclipse\runtime-New_configuration\aaa\..\..\..\Documents%20and%20Settings\kamoore\My%20Documents\aaa.xsd (The system cannot find the path specified) at com.sun.xml.bind.v2.schemagen.XmlSchemaGenerator$Namespace.writeTo(XmlSchemaGenerator.java:698)
i spoke too soon, forgot i can't just apply the patch to my workspace and test it
Ok, now that I'm actually testing the patch, it looks good to me. Only testing on the windows platform
I've reproduced the same errors on Linux regarding spaces. I've also tested the patch on Linux and unfortunately the Generic JAXB schema generation does not appear to work (with or without spaces) with the patch applied. Everything appears to complete normally (with or without spaces, but the XSD file is never created to disk. I removed the patch to ensure that the function worked in a non-space environment and have confirmed that it does, so this patch does appear to degrade a working scenario on Linux. I'll do some more testing to confirm these results.
Created attachment 172661 [details] proposed patch
New patch doesn't regress functionality on Linux. Patch committed for 2.3.1 and head.