diff options
Diffstat (limited to 'jpa/plugins/org.eclipse.jpt.eclipselink.jaxb.core.schemagen')
-rw-r--r-- | jpa/plugins/org.eclipse.jpt.eclipselink.jaxb.core.schemagen/src/org/eclipse/jpt/eclipselink/jaxb/core/schemagen/Main.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.jaxb.core.schemagen/src/org/eclipse/jpt/eclipselink/jaxb/core/schemagen/Main.java b/jpa/plugins/org.eclipse.jpt.eclipselink.jaxb.core.schemagen/src/org/eclipse/jpt/eclipselink/jaxb/core/schemagen/Main.java index d026efaac4..5d828c4f64 100644 --- a/jpa/plugins/org.eclipse.jpt.eclipselink.jaxb.core.schemagen/src/org/eclipse/jpt/eclipselink/jaxb/core/schemagen/Main.java +++ b/jpa/plugins/org.eclipse.jpt.eclipselink.jaxb.core.schemagen/src/org/eclipse/jpt/eclipselink/jaxb/core/schemagen/Main.java @@ -36,6 +36,8 @@ public class Main private boolean isDebugMode; static public String NO_FACTORY_CLASS = "doesnt contain ObjectFactory.class"; //$NON-NLS-1$ + static public String CANNOT_BE_CAST_TO_JAXBCONTEXT = "cannot be cast to org.eclipse.persistence.jaxb.JAXBContext"; //$NON-NLS-1$ + static public String JAXB_PROPERTIES_FILE_NOT_FOUND = "\nEclipseLink JAXBContextFactory must be specified in the jaxb.properties file to use EclipseLink MOXy for schema generation.\njavax.xml.bind.context.factory=org.eclipse.persistence.jaxb.JAXBContextFactory "; // ********** static methods ********** @@ -104,6 +106,16 @@ public class Main } System.err.println("\nSchema " + this.targetSchemaName + " not created"); //$NON-NLS-1$ } + catch (ClassCastException e) { + String message = e.getMessage(); + if(message.indexOf(CANNOT_BE_CAST_TO_JAXBCONTEXT) > -1) { + System.err.println(JAXB_PROPERTIES_FILE_NOT_FOUND); + } + else { + e.printStackTrace(); + } + System.err.println("\nSchema " + this.targetSchemaName + " not created"); //$NON-NLS-1$ + } return jaxbContext; } |