This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
When I run "validate XML" of my persistence.xml I got the following errors: ------------------------------------------------------------- XML validation started. Checking file:/D:/SPS/project/patient-service-gf3/src/conf/persistence.xml... cvc-complex-type.2.4.a: Invalid content was found starting with element 'mapping-file'. One of '{"http://java.sun.com/xml/ns/persistence":jar-file, "http://java.sun.com/xml/ns/persistence":class, "http://java.sun.com/xml/ns/persistence":exclude-unlisted-classes, "http://java.sun.com/xml/ns/persistence":properties}' is expected. [14] cvc-complex-type.2.4.a: Invalid content was found starting with element 'mapping-file'. One of '{"http://java.sun.com/xml/ns/persistence":jar-file, "http://java.sun.com/xml/ns/persistence":class, "http://java.sun.com/xml/ns/persistence":exclude-unlisted-classes, "http://java.sun.com/xml/ns/persistence":properties}' is expected. [26] cvc-complex-type.2.4.a: Invalid content was found starting with element 'mapping-file'. One of '{"http://java.sun.com/xml/ns/persistence":jar-file, "http://java.sun.com/xml/ns/persistence":class, "http://java.sun.com/xml/ns/persistence":exclude-unlisted-classes, "http://java.sun.com/xml/ns/persistence":properties}' is expected. [38] cvc-complex-type.2.4.a: Invalid content was found starting with element 'mapping-file'. One of '{"http://java.sun.com/xml/ns/persistence":jar-file, "http://java.sun.com/xml/ns/persistence":class, "http://java.sun.com/xml/ns/persistence":exclude-unlisted-classes, "http://java.sun.com/xml/ns/persistence":properties}' is expected. [50] cvc-complex-type.2.4.a: Invalid content was found starting with element 'mapping-file'. One of '{"http://java.sun.com/xml/ns/persistence":jar-file, "http://java.sun.com/xml/ns/persistence":class, "http://java.sun.com/xml/ns/persistence":exclude-unlisted-classes, "http://java.sun.com/xml/ns/persistence":properties}' is expected. [62] XML validation finished. ------------------------------------------------------------------ And because of those errors I can't deploy the application to Glassfish 3.0 (build 59). Deployment to Glassfish Prelude works without any problem. I'm using NetBeans IDE Dev (Build 200908130201) Here is my persistence.xml: <?xml version="1.0" encoding="UTF-8"?> <persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"> <persistence-unit name="lmap-access" transaction-type="JTA"> <jta-data-source>jdbc/lmap-access</jta-data-source> <jar-file>lib/access-control-lib.jar</jar-file> <properties/> </persistence-unit> <persistence-unit name="lmap-enterprise" transaction-type="JTA"> <jta-data-source>jdbc/lmap-enterprise</jta-data-source> </persistence-unit> <persistence-unit name="midwood" transaction-type="JTA"> <jta-data-source>jdbc/midwood</jta-data-source> <jar-file>lib/medenterprise-domain.jar</jar-file> <mapping-file>META-INF/medenterprise.xml</mapping-file> <jar-file>lib/patient-service-domain.jar</jar-file> <mapping-file>META-INF/patient-service.xml</mapping-file> <jar-file>lib/medical-billing-domain.jar</jar-file> <mapping-file>META-INF/medical-billing.xml</mapping-file> <properties> <property name="eclipselink.cache.shared.default" value="false"/> </properties> </persistence-unit> <persistence-unit name="benson" transaction-type="JTA"> <jta-data-source>jdbc/benson</jta-data-source> <jar-file>lib/medenterprise-domain.jar</jar-file> <mapping-file>META-INF/medenterprise.xml</mapping-file> <jar-file>lib/patient-service-domain.jar</jar-file> <mapping-file>META-INF/patient-service.xml</mapping-file> <jar-file>lib/medical-billing-domain.jar</jar-file> <mapping-file>META-INF/medical-billing.xml</mapping-file> <properties> <property name="eclipselink.cache.shared.default" value="false"/> </properties> </persistence-unit> <persistence-unit name="canarsie" transaction-type="JTA"> <jta-data-source>jdbc/canarsie</jta-data-source> <jar-file>lib/medenterprise-domain.jar</jar-file> <mapping-file>META-INF/medenterprise.xml</mapping-file> <jar-file>lib/patient-service-domain.jar</jar-file> <mapping-file>META-INF/patient-service.xml</mapping-file> <jar-file>lib/medical-billing-domain.jar</jar-file> <mapping-file>META-INF/medical-billing.xml</mapping-file> <properties> <property name="eclipselink.cache.shared.default" value="false"/> </properties> </persistence-unit> <persistence-unit name="avez" transaction-type="JTA"> <jta-data-source>jdbc/avez</jta-data-source> <jar-file>lib/medenterprise-domain.jar</jar-file> <mapping-file>META-INF/medenterprise.xml</mapping-file> <jar-file>lib/patient-service-domain.jar</jar-file> <mapping-file>META-INF/patient-service.xml</mapping-file> <jar-file>lib/medical-billing-domain.jar</jar-file> <mapping-file>META-INF/medical-billing.xml</mapping-file> <properties> <property name="eclipselink.cache.shared.default" value="false"/> </properties> </persistence-unit> <persistence-unit name="jns" transaction-type="JTA"> <jta-data-source>jdbc/jns</jta-data-source> <jar-file>lib/medenterprise-domain.jar</jar-file> <mapping-file>META-INF/medenterprise.xml</mapping-file> <jar-file>lib/patient-service-domain.jar</jar-file> <mapping-file>META-INF/patient-service.xml</mapping-file> <jar-file>lib/medical-billing-domain.jar</jar-file> <mapping-file>META-INF/medical-billing.xml</mapping-file> <properties> <property name="eclipselink.cache.shared.default" value="false"/> </properties> </persistence-unit> </persistence>
After placing all <mapping-file> elements before <jar-file> elements every things started work. XML validation was successful and application was deployed without problem to Glassfish 3 (build 59). Anyway I believe the issue must be fixed because specification didn't specify explicitly that <mapping-file> element should be always located before <jar-file> element. <mapping-file>META-INF/medenterprise.xml</mapping-file> <mapping-file>META-INF/patient-service.xml</mapping-file> <mapping-file>META-INF/medical-billing.xml</mapping-file> <jar-file>lib/medenterprise-domain.jar</jar-file> <jar-file>lib/patient-service-domain.jar</jar-file> <jar-file>lib/medical-billing-domain.jar</jar-file>
<xsd:sequence> Element Requires the elements in the group to appear in the specified sequence within the containing element. xsd is part of specification, mapping-file and jar-file are in sequence elements.
> mapping-file and jar-file are in sequence elements. Then related editor should enforce this rule :)
which one editor, xml or design? I don't see support for mapped-file/jar in design view, and in xml editor you can enter anything you want manually without any restrictions
I'm suggesting to enforce some restrictions in xml editor. For example not allow to create tag "mapping-file" below "jar-file" tag. XML Spy has this kind of restrictions and that working good.
then it's more like enhancement request for xml
>then it's more like enhancement request for xml You are right it's enhancement. Thank you for supporting idea!