openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kevin Sutter (JIRA)" <>
Subject [jira] Commented: (OPENJPA-513) More issues with the IBM JDK
Date Fri, 15 Feb 2008 17:20:07 GMT


Kevin Sutter commented on OPENJPA-513:

After a bit more digging, here's the scoop on the xml validation...

By default, our OpenJPA code wants to validate the persistence.xml file when we read it in.
 In the PersistenceProductDerivation$ConfigurationParser, we set the validation to true:

        public ConfigurationParser(Map map) {
            _map = map;

But, later in the static initializer for the XMLMetaDataParser, there is a check for the Sun
Xerxes parser.  This sets _schemaBug to true:

    static {
        try {
            // check for Xerces version 2.0.2 to see if we need to disable
            // schema validation, which works around the bug reported at:
            _schemaBug = "Xerces-J 2.0.2".equals(Class.forName
        } catch (Throwable t) {
            // Xerces might not be available
            _schemaBug = false;

So, then when we determine what type of parser (validating or not), we end up running without
validation for the Sun JDK ALL THE TIME:

        if (schemaSource != null && _schemaBug) {
            if (_log != null && _log.isTraceEnabled())
            schemaSource = null;
        boolean validating = _validating && (getDocType() != null 
            || schemaSource != null);

So, as soon as Sun's Xerxes parser gets updated with this fix, then this same testcase will
fail with the Sun JDK.  Which brings me back to my original point of this not being a valid
test for standard JPA.

It looks like we (OpenJPA) wanted to run with a validating parser.  But, due to the bug in
the Sun Xerxes parser, we've been running without validation for the Sun JDK and with validation
for all other JDK's (including the IBM JDK).  Since it looks like we want a validating parser,
then I think this TestPersistenceUnitWithoutXSD should be removed.  And, maybe we should look
at providing a switch to run with or without validation.


> More issues with the IBM JDK
> ----------------------------
>                 Key: OPENJPA-513
>                 URL:
>             Project: OpenJPA
>          Issue Type: Sub-task
>          Components: build / infrastructure
>    Affects Versions: 1.0.2, 1.1.0
>            Reporter: Kevin Sutter
>            Assignee: Kevin Sutter
>             Fix For: 1.1.0
> Now that I have a resolution (JDK patch) for OPENJPA-429, when I run a 1.1.0 build, I
am getting some errors from the test phase of openjpa-persistence-jdbc.  The following tests
are failing according to the surefire report:
> Results :
> Tests in error:
>   testEntityListeners(org.apache.openjpa.persistence.callbacks.TestEntityListeners)
>   testGlobalListeners(org.apache.openjpa.persistence.callbacks.TestEntityListeners)
>   testPersistenceUnitWithoutXSD(org.apache.openjpa.persistence.xml.TestPersistenceUnitWithoutXSD)
>   testEnhancementOfAllPUsWithinAResource(org.apache.openjpa.enhance.TestEnhancementWithMultiplePUs)
> Tests run: 568, Failures: 0, Errors: 4, Skipped: 0

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message