diff --git a/openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/AnnotationPersistenceMappingParser.java b/openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/AnnotationPersistenceMappingParser.java index 0fde0c8a3..6d605d4df 100644 --- a/openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/AnnotationPersistenceMappingParser.java +++ b/openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/AnnotationPersistenceMappingParser.java @@ -1537,11 +1537,13 @@ public class AnnotationPersistenceMappingParser // cache the JAXB XmlType class if it is present so we do not // have a hard-wired dependency on JAXB here Class xmlTypeClass = null; - try { - xmlTypeClass = Class.forName("javax.xml.bind.annotation.XmlType"); - } catch (Exception e) { + if (fm.getValueInfo().getStrategy() != null && + fm.getValueInfo().getStrategy().equals("org.apache.openjpa.jdbc.meta.strats.XMLValueHandler")) { + try { + xmlTypeClass = Class.forName("javax.xml.bind.annotation.XmlType"); + } catch (Exception e) { + } } - int unique = 0; DBIdentifier sSecondary = DBIdentifier.NULL; for (int i = 0; i < pcols.length; i++) {