Community
Participate
Working Groups
Build Identifier: 20110615-0604 To reproduce: - Install eclipse indigo for java ee developers in linux 64 bit. - have workspace in /home/username/workspace - create a project with a JAXB tagged file (@xmlrootelement) - try to create a XML schema for that file: a) context-menu on project b) choose "new" -> "other.." c) choose "JAXB" -> "Schema from JAXB classes" d) select your project e) select your JAXB annotated file --> an exception is thrown that the file /home/youprojectname/yourschemaname.xsd does not exist it can't, because the path should be /home/username/workspace/youprojectname/yourschemaname.xsd Reproducible: Always
What is the JAXB project platform, Generic or EclipseLink? Also can you attach the exception stack trace. Thanks.
Plattform is generic. This is the console output: loading... my.class.path generating schema... Schema /home/myprojectname/NewXMLSchema1111.xsd generated14.07.2011 12:33:31 com.sun.xml.bind.v2.schemagen.XmlSchemaGenerator$Namespace writeTo INFO: java.io.FileNotFoundException: /home/myprojectname/NewXMLSchema1111.xsd (No such file or directory) com.sun.xml.txw2.TxwException: java.io.FileNotFoundException: /home/myprojectname/NewXMLSchema1111.xsd (No such file or directory) at com.sun.xml.txw2.output.StreamSerializer.<init>(StreamSerializer.java:76) at com.sun.xml.txw2.output.ResultFactory.createSerializer(ResultFactory.java:55) at com.sun.xml.bind.v2.schemagen.XmlSchemaGenerator$Namespace.writeTo(XmlSchemaGenerator.java:578) at com.sun.xml.bind.v2.schemagen.XmlSchemaGenerator$Namespace.access$700(XmlSchemaGenerator.java:474) at com.sun.xml.bind.v2.schemagen.XmlSchemaGenerator.write(XmlSchemaGenerator.java:456) at com.sun.xml.bind.v2.runtime.JAXBContextImpl.generateSchema(JAXBContextImpl.java:788) at org.eclipse.jpt.jaxb.core.schemagen.Main.generateSchema(Main.java:111) at org.eclipse.jpt.jaxb.core.schemagen.Main.generate(Main.java:80) at org.eclipse.jpt.jaxb.core.schemagen.Main.execute(Main.java:62) at org.eclipse.jpt.jaxb.core.schemagen.Main.main(Main.java:47) Caused by: java.io.FileNotFoundException: /home/myprojectname/NewXMLSchema1111.xsd (No such file or directory) at java.io.FileOutputStream.open(Native Method) at java.io.FileOutputStream.<init>(FileOutputStream.java:194) at java.io.FileOutputStream.<init>(FileOutputStream.java:84) at com.sun.xml.txw2.output.StreamSerializer.<init>(StreamSerializer.java:72) ... 9 more java.io.IOException: java.io.FileNotFoundException: /home/myprojectname/NewXMLSchema1111.xsd (No such file or directory) at com.sun.xml.bind.v2.schemagen.XmlSchemaGenerator$Namespace.writeTo(XmlSchemaGenerator.java:679) at com.sun.xml.bind.v2.schemagen.XmlSchemaGenerator$Namespace.access$700(XmlSchemaGenerator.java:474) at com.sun.xml.bind.v2.schemagen.XmlSchemaGenerator.write(XmlSchemaGenerator.java:456) at com.sun.xml.bind.v2.runtime.JAXBContextImpl.generateSchema(JAXBContextImpl.java:788) at org.eclipse.jpt.jaxb.core.schemagen.Main.generateSchema(Main.java:111) at org.eclipse.jpt.jaxb.core.schemagen.Main.generate(Main.java:80) at org.eclipse.jpt.jaxb.core.schemagen.Main.execute(Main.java:62) at org.eclipse.jpt.jaxb.core.schemagen.Main.main(Main.java:47) Also interesting the message "Schema /home/myprojectname/NewXMLSchema1111.xsd generated" although it is not generated, because that directory does not exist.
Created attachment 200131 [details] Proposed patch for 3.0.1
(In reply to comment #3) > Created attachment 200131 [details] > Proposed patch for 3.0.1 Did you have a chance to test this change on Windows?
(In reply to comment #4) > Did you have a chance to test this change on Windows? Yes it was tested on Windows.
Only 1 minor thing to mention...in NewSchemaFileWizardPage.getFileRelativePath() there is a redundant call to getProject(). Other than that, looks good.
Applied to 3.0.1 stream and to head.