Skip to main content
summaryrefslogtreecommitdiffstats
path: root/jpa
diff options
context:
space:
mode:
authortle2010-04-21 23:35:44 +0000
committertle2010-04-21 23:35:44 +0000
commitd26c2e3a8fbfcfef92f1b64f263a76dc406ca44c (patch)
treedfb3dd6c0b5f0643c8817912756adc08a48faed9 /jpa
parentf4373c669cb89edd2cd88823f8918b04148d59ab (diff)
downloadwebtools.dali-d26c2e3a8fbfcfef92f1b64f263a76dc406ca44c.tar.gz
webtools.dali-d26c2e3a8fbfcfef92f1b64f263a76dc406ca44c.tar.xz
webtools.dali-d26c2e3a8fbfcfef92f1b64f263a76dc406ca44c.zip
Detect missing jaxb properties file
Diffstat (limited to 'jpa')
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.jaxb.core.schemagen/src/org/eclipse/jpt/eclipselink/jaxb/core/schemagen/Main.java12
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;
}

Back to the top