org.glassfish.deployment.common.DeploymentException: invalid mapping: META-INF/course-queries.xml

Hibernate JIRA | David Loeffler | 6 years ago
  1. 0

    I have a Java EE 6 project that has a large number of named queries. The named queries are organized into a number of files that are specified in the persistence.xml file with the <mapping-file> tags. However on deploying to the app server Hibernate throws an exception that the version "2.0" should not be used, it should be "1.0". This is the version of JPA which is specified in other files like orm.xml (no error from this file, even though it is basically empty). If I switch to eclipselink things work fine. Why do I not want to use eclipselink then? Because it has an error with collections of enums where it uses varchar instead of int no matter how much I tweak the annotations. I did a small sample application with hibernate where I had only the orm.xml file. That worked just fine. Here is a sample of the header the included mapping file that got the error {code:title=META-INF/course-queries.xml|borderStyle=solid} <?xml version="1.0" encoding="UTF-8"?> <entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_2_0.xsd" version="2.0"> ... </entity-mappings> {code} {noformat} WARNING: DPL8030: Sun specific deployment descriptor (WEB-INF/sun-web.xml in archive /Users/loeffler/NetBeansProjects/DC4/dist/gfdeploy/DC4/DC4-war_war/) is deprecating, please use Glassfish specific deployment descriptor WEB-INF/glassfish-web.xml in the future. SEVERE: log4j:WARN No appenders could be found for logger (org.hibernate.cfg.annotations.Version). SEVERE: log4j:WARN Please initialize the log4j system properly. SEVERE: log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info. SEVERE: Exception while invoking class org.glassfish.persistence.jpa.JPADeployer prepare method org.hibernate.MappingException: invalid mapping: META-INF/course-queries.xml at org.hibernate.ejb.Ejb3Configuration.addXMLEntities(Ejb3Configuration.java:718) at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:593) at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:72) at org.glassfish.persistence.jpa.PersistenceUnitLoader.loadPU(PersistenceUnitLoader.java:193) at org.glassfish.persistence.jpa.PersistenceUnitLoader.<init>(PersistenceUnitLoader.java:109) at org.glassfish.persistence.jpa.JPADeployer.prepare(JPADeployer.java:135) at com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:661) at org.glassfish.javaee.full.deployment.EarDeployer.prepareBundle(EarDeployer.java:285) at org.glassfish.javaee.full.deployment.EarDeployer.access$200(EarDeployer.java:81) at org.glassfish.javaee.full.deployment.EarDeployer$1.doBundle(EarDeployer.java:136) at org.glassfish.javaee.full.deployment.EarDeployer$1.doBundle(EarDeployer.java:133) at org.glassfish.javaee.full.deployment.EarDeployer.doOnBundles(EarDeployer.java:210) at org.glassfish.javaee.full.deployment.EarDeployer.doOnAllTypedBundles(EarDeployer.java:219) at org.glassfish.javaee.full.deployment.EarDeployer.doOnAllBundles(EarDeployer.java:245) at org.glassfish.javaee.full.deployment.EarDeployer.prepare(EarDeployer.java:133) at com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:661) at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:312) at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:199) at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:286) at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:322) at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:337) at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:965) at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:92) at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1088) at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1077) at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:366) at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:203) at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:166) at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:113) at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:245) at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:802) at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:705) at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:986) at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:178) at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135) at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102) at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88) at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76) at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53) at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57) at com.sun.grizzly.ContextTask.run(ContextTask.java:69) at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:526) at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:507) at java.lang.Thread.run(Thread.java:637) Caused by: org.xml.sax.SAXParseException: cvc-complex-type.3.1: Value '2.0' of attribute 'version' of element 'entity-mappings' is not valid with respect to the corresponding attribute use. Attribute 'version' has a fixed value of '1.0'. at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195) at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:131) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:384) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:318) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(XMLSchemaValidator.java:417) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaError(XMLSchemaValidator.java:3181) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.processOneAttribute(XMLSchemaValidator.java:2801) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.processAttributes(XMLSchemaValidator.java:2713) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:2065) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:705) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:400) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDriver.scanRootElementHook(XMLNSDocumentScannerImpl.java:626) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:3103) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:922) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205) at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522) at org.dom4j.io.SAXReader.read(SAXReader.java:465) at org.dom4j.io.SAXReader.read(SAXReader.java:343) at org.hibernate.ejb.Ejb3Configuration.addXMLEntities(Ejb3Configuration.java:716) ... 43 more SEVERE: Exception while invoking class org.glassfish.javaee.full.deployment.EarDeployer prepare method org.glassfish.deployment.common.DeploymentException: invalid mapping: META-INF/course-queries.xml at org.glassfish.javaee.full.deployment.EarDeployer.prepare(EarDeployer.java:161) at com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:661) at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:312) at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:199) at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:286) at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:322) at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:337) at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:965) at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:92) at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1088) at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1077) at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:366) at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:203) at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:166) at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:113) at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:245) at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:802) at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:705) at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:986) at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:178) at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135) at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102) at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88) at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76) at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53) at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57) at com.sun.grizzly.ContextTask.run(ContextTask.java:69) at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:526) at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:507) at java.lang.Thread.run(Thread.java:637) Caused by: org.hibernate.MappingException: invalid mapping: META-INF/course-queries.xml at org.hibernate.ejb.Ejb3Configuration.addXMLEntities(Ejb3Configuration.java:718) at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:593) at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:72) at org.glassfish.persistence.jpa.PersistenceUnitLoader.loadPU(PersistenceUnitLoader.java:193) at org.glassfish.persistence.jpa.PersistenceUnitLoader.<init>(PersistenceUnitLoader.java:109) at org.glassfish.persistence.jpa.JPADeployer.prepare(JPADeployer.java:135) at com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:661) at org.glassfish.javaee.full.deployment.EarDeployer.prepareBundle(EarDeployer.java:285) at org.glassfish.javaee.full.deployment.EarDeployer.access$200(EarDeployer.java:81) at org.glassfish.javaee.full.deployment.EarDeployer$1.doBundle(EarDeployer.java:136) at org.glassfish.javaee.full.deployment.EarDeployer$1.doBundle(EarDeployer.java:133) at org.glassfish.javaee.full.deployment.EarDeployer.doOnBundles(EarDeployer.java:210) at org.glassfish.javaee.full.deployment.EarDeployer.doOnAllTypedBundles(EarDeployer.java:219) at org.glassfish.javaee.full.deployment.EarDeployer.doOnAllBundles(EarDeployer.java:245) at org.glassfish.javaee.full.deployment.EarDeployer.prepare(EarDeployer.java:133) ... 29 more Caused by: org.xml.sax.SAXParseException: cvc-complex-type.3.1: Value '2.0' of attribute 'version' of element 'entity-mappings' is not valid with respect to the corresponding attribute use. Attribute 'version' has a fixed value of '1.0'. at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195) at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:131) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:384) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:318) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(XMLSchemaValidator.java:417) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaError(XMLSchemaValidator.java:3181) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.processOneAttribute(XMLSchemaValidator.java:2801) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.processAttributes(XMLSchemaValidator.java:2713) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:2065) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:705) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:400) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDriver.scanRootElementHook(XMLNSDocumentScannerImpl.java:626) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:3103) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:922) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205) at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522) at org.dom4j.io.SAXReader.read(SAXReader.java:465) at org.dom4j.io.SAXReader.read(SAXReader.java:343) at org.hibernate.ejb.Ejb3Configuration.addXMLEntities(Ejb3Configuration.java:716) ... 43 more SEVERE: Exception while preparing the app org.glassfish.deployment.common.DeploymentException: invalid mapping: META-INF/course-queries.xml at org.glassfish.javaee.full.deployment.EarDeployer.prepare(EarDeployer.java:161) at com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:661) at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:312) at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:199) at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:286) at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:322) at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:337) at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:965) at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:92) at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1088) at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1077) at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:366) at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:203) at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:166) at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:113) at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:245) at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:802) at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:705) at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:986) at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:178) at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135) at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102) at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88) at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76) at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53) at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57) at com.sun.grizzly.ContextTask.run(ContextTask.java:69) at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:526) at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:507) at java.lang.Thread.run(Thread.java:637) Caused by: org.hibernate.MappingException: invalid mapping: META-INF/course-queries.xml at org.hibernate.ejb.Ejb3Configuration.addXMLEntities(Ejb3Configuration.java:718) at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:593) at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:72) at org.glassfish.persistence.jpa.PersistenceUnitLoader.loadPU(PersistenceUnitLoader.java:193) at org.glassfish.persistence.jpa.PersistenceUnitLoader.<init>(PersistenceUnitLoader.java:109) at org.glassfish.persistence.jpa.JPADeployer.prepare(JPADeployer.java:135) at com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:661) at org.glassfish.javaee.full.deployment.EarDeployer.prepareBundle(EarDeployer.java:285) at org.glassfish.javaee.full.deployment.EarDeployer.access$200(EarDeployer.java:81) at org.glassfish.javaee.full.deployment.EarDeployer$1.doBundle(EarDeployer.java:136) at org.glassfish.javaee.full.deployment.EarDeployer$1.doBundle(EarDeployer.java:133) at org.glassfish.javaee.full.deployment.EarDeployer.doOnBundles(EarDeployer.java:210) at org.glassfish.javaee.full.deployment.EarDeployer.doOnAllTypedBundles(EarDeployer.java:219) at org.glassfish.javaee.full.deployment.EarDeployer.doOnAllBundles(EarDeployer.java:245) at org.glassfish.javaee.full.deployment.EarDeployer.prepare(EarDeployer.java:133) ... 29 more Caused by: org.xml.sax.SAXParseException: cvc-complex-type.3.1: Value '2.0' of attribute 'version' of element 'entity-mappings' is not valid with respect to the corresponding attribute use. Attribute 'version' has a fixed value of '1.0'. at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195) at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:131) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:384) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:318) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(XMLSchemaValidator.java:417) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaError(XMLSchemaValidator.java:3181) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.processOneAttribute(XMLSchemaValidator.java:2801) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.processAttributes(XMLSchemaValidator.java:2713) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:2065) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:705) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:400) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDriver.scanRootElementHook(XMLNSDocumentScannerImpl.java:626) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:3103) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:922) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205) at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522) at org.dom4j.io.SAXReader.read(SAXReader.java:465) at org.dom4j.io.SAXReader.read(SAXReader.java:343) at org.hibernate.ejb.Ejb3Configuration.addXMLEntities(Ejb3Configuration.java:716) ... 43 more {noformat}

    Hibernate JIRA | 6 years ago | David Loeffler
    org.glassfish.deployment.common.DeploymentException: invalid mapping: META-INF/course-queries.xml
  2. 0

    I have a Java EE 6 project that has a large number of named queries. The named queries are organized into a number of files that are specified in the persistence.xml file with the <mapping-file> tags. However on deploying to the app server Hibernate throws an exception that the version "2.0" should not be used, it should be "1.0". This is the version of JPA which is specified in other files like orm.xml (no error from this file, even though it is basically empty). If I switch to eclipselink things work fine. Why do I not want to use eclipselink then? Because it has an error with collections of enums where it uses varchar instead of int no matter how much I tweak the annotations. I did a small sample application with hibernate where I had only the orm.xml file. That worked just fine. Here is a sample of the header the included mapping file that got the error {code:title=META-INF/course-queries.xml|borderStyle=solid} <?xml version="1.0" encoding="UTF-8"?> <entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_2_0.xsd" version="2.0"> ... </entity-mappings> {code} {noformat} WARNING: DPL8030: Sun specific deployment descriptor (WEB-INF/sun-web.xml in archive /Users/loeffler/NetBeansProjects/DC4/dist/gfdeploy/DC4/DC4-war_war/) is deprecating, please use Glassfish specific deployment descriptor WEB-INF/glassfish-web.xml in the future. SEVERE: log4j:WARN No appenders could be found for logger (org.hibernate.cfg.annotations.Version). SEVERE: log4j:WARN Please initialize the log4j system properly. SEVERE: log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info. SEVERE: Exception while invoking class org.glassfish.persistence.jpa.JPADeployer prepare method org.hibernate.MappingException: invalid mapping: META-INF/course-queries.xml at org.hibernate.ejb.Ejb3Configuration.addXMLEntities(Ejb3Configuration.java:718) at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:593) at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:72) at org.glassfish.persistence.jpa.PersistenceUnitLoader.loadPU(PersistenceUnitLoader.java:193) at org.glassfish.persistence.jpa.PersistenceUnitLoader.<init>(PersistenceUnitLoader.java:109) at org.glassfish.persistence.jpa.JPADeployer.prepare(JPADeployer.java:135) at com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:661) at org.glassfish.javaee.full.deployment.EarDeployer.prepareBundle(EarDeployer.java:285) at org.glassfish.javaee.full.deployment.EarDeployer.access$200(EarDeployer.java:81) at org.glassfish.javaee.full.deployment.EarDeployer$1.doBundle(EarDeployer.java:136) at org.glassfish.javaee.full.deployment.EarDeployer$1.doBundle(EarDeployer.java:133) at org.glassfish.javaee.full.deployment.EarDeployer.doOnBundles(EarDeployer.java:210) at org.glassfish.javaee.full.deployment.EarDeployer.doOnAllTypedBundles(EarDeployer.java:219) at org.glassfish.javaee.full.deployment.EarDeployer.doOnAllBundles(EarDeployer.java:245) at org.glassfish.javaee.full.deployment.EarDeployer.prepare(EarDeployer.java:133) at com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:661) at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:312) at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:199) at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:286) at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:322) at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:337) at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:965) at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:92) at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1088) at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1077) at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:366) at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:203) at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:166) at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:113) at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:245) at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:802) at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:705) at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:986) at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:178) at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135) at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102) at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88) at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76) at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53) at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57) at com.sun.grizzly.ContextTask.run(ContextTask.java:69) at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:526) at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:507) at java.lang.Thread.run(Thread.java:637) Caused by: org.xml.sax.SAXParseException: cvc-complex-type.3.1: Value '2.0' of attribute 'version' of element 'entity-mappings' is not valid with respect to the corresponding attribute use. Attribute 'version' has a fixed value of '1.0'. at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195) at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:131) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:384) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:318) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(XMLSchemaValidator.java:417) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaError(XMLSchemaValidator.java:3181) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.processOneAttribute(XMLSchemaValidator.java:2801) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.processAttributes(XMLSchemaValidator.java:2713) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:2065) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:705) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:400) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDriver.scanRootElementHook(XMLNSDocumentScannerImpl.java:626) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:3103) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:922) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205) at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522) at org.dom4j.io.SAXReader.read(SAXReader.java:465) at org.dom4j.io.SAXReader.read(SAXReader.java:343) at org.hibernate.ejb.Ejb3Configuration.addXMLEntities(Ejb3Configuration.java:716) ... 43 more SEVERE: Exception while invoking class org.glassfish.javaee.full.deployment.EarDeployer prepare method org.glassfish.deployment.common.DeploymentException: invalid mapping: META-INF/course-queries.xml at org.glassfish.javaee.full.deployment.EarDeployer.prepare(EarDeployer.java:161) at com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:661) at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:312) at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:199) at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:286) at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:322) at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:337) at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:965) at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:92) at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1088) at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1077) at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:366) at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:203) at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:166) at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:113) at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:245) at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:802) at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:705) at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:986) at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:178) at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135) at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102) at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88) at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76) at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53) at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57) at com.sun.grizzly.ContextTask.run(ContextTask.java:69) at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:526) at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:507) at java.lang.Thread.run(Thread.java:637) Caused by: org.hibernate.MappingException: invalid mapping: META-INF/course-queries.xml at org.hibernate.ejb.Ejb3Configuration.addXMLEntities(Ejb3Configuration.java:718) at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:593) at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:72) at org.glassfish.persistence.jpa.PersistenceUnitLoader.loadPU(PersistenceUnitLoader.java:193) at org.glassfish.persistence.jpa.PersistenceUnitLoader.<init>(PersistenceUnitLoader.java:109) at org.glassfish.persistence.jpa.JPADeployer.prepare(JPADeployer.java:135) at com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:661) at org.glassfish.javaee.full.deployment.EarDeployer.prepareBundle(EarDeployer.java:285) at org.glassfish.javaee.full.deployment.EarDeployer.access$200(EarDeployer.java:81) at org.glassfish.javaee.full.deployment.EarDeployer$1.doBundle(EarDeployer.java:136) at org.glassfish.javaee.full.deployment.EarDeployer$1.doBundle(EarDeployer.java:133) at org.glassfish.javaee.full.deployment.EarDeployer.doOnBundles(EarDeployer.java:210) at org.glassfish.javaee.full.deployment.EarDeployer.doOnAllTypedBundles(EarDeployer.java:219) at org.glassfish.javaee.full.deployment.EarDeployer.doOnAllBundles(EarDeployer.java:245) at org.glassfish.javaee.full.deployment.EarDeployer.prepare(EarDeployer.java:133) ... 29 more Caused by: org.xml.sax.SAXParseException: cvc-complex-type.3.1: Value '2.0' of attribute 'version' of element 'entity-mappings' is not valid with respect to the corresponding attribute use. Attribute 'version' has a fixed value of '1.0'. at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195) at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:131) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:384) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:318) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(XMLSchemaValidator.java:417) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaError(XMLSchemaValidator.java:3181) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.processOneAttribute(XMLSchemaValidator.java:2801) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.processAttributes(XMLSchemaValidator.java:2713) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:2065) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:705) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:400) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDriver.scanRootElementHook(XMLNSDocumentScannerImpl.java:626) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:3103) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:922) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205) at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522) at org.dom4j.io.SAXReader.read(SAXReader.java:465) at org.dom4j.io.SAXReader.read(SAXReader.java:343) at org.hibernate.ejb.Ejb3Configuration.addXMLEntities(Ejb3Configuration.java:716) ... 43 more SEVERE: Exception while preparing the app org.glassfish.deployment.common.DeploymentException: invalid mapping: META-INF/course-queries.xml at org.glassfish.javaee.full.deployment.EarDeployer.prepare(EarDeployer.java:161) at com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:661) at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:312) at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:199) at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:286) at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:322) at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:337) at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:965) at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:92) at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1088) at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1077) at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:366) at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:203) at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:166) at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:113) at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:245) at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:802) at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:705) at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:986) at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:178) at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135) at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102) at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88) at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76) at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53) at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57) at com.sun.grizzly.ContextTask.run(ContextTask.java:69) at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:526) at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:507) at java.lang.Thread.run(Thread.java:637) Caused by: org.hibernate.MappingException: invalid mapping: META-INF/course-queries.xml at org.hibernate.ejb.Ejb3Configuration.addXMLEntities(Ejb3Configuration.java:718) at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:593) at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:72) at org.glassfish.persistence.jpa.PersistenceUnitLoader.loadPU(PersistenceUnitLoader.java:193) at org.glassfish.persistence.jpa.PersistenceUnitLoader.<init>(PersistenceUnitLoader.java:109) at org.glassfish.persistence.jpa.JPADeployer.prepare(JPADeployer.java:135) at com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:661) at org.glassfish.javaee.full.deployment.EarDeployer.prepareBundle(EarDeployer.java:285) at org.glassfish.javaee.full.deployment.EarDeployer.access$200(EarDeployer.java:81) at org.glassfish.javaee.full.deployment.EarDeployer$1.doBundle(EarDeployer.java:136) at org.glassfish.javaee.full.deployment.EarDeployer$1.doBundle(EarDeployer.java:133) at org.glassfish.javaee.full.deployment.EarDeployer.doOnBundles(EarDeployer.java:210) at org.glassfish.javaee.full.deployment.EarDeployer.doOnAllTypedBundles(EarDeployer.java:219) at org.glassfish.javaee.full.deployment.EarDeployer.doOnAllBundles(EarDeployer.java:245) at org.glassfish.javaee.full.deployment.EarDeployer.prepare(EarDeployer.java:133) ... 29 more Caused by: org.xml.sax.SAXParseException: cvc-complex-type.3.1: Value '2.0' of attribute 'version' of element 'entity-mappings' is not valid with respect to the corresponding attribute use. Attribute 'version' has a fixed value of '1.0'. at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195) at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:131) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:384) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:318) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(XMLSchemaValidator.java:417) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaError(XMLSchemaValidator.java:3181) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.processOneAttribute(XMLSchemaValidator.java:2801) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.processAttributes(XMLSchemaValidator.java:2713) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:2065) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:705) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:400) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDriver.scanRootElementHook(XMLNSDocumentScannerImpl.java:626) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:3103) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:922) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205) at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522) at org.dom4j.io.SAXReader.read(SAXReader.java:465) at org.dom4j.io.SAXReader.read(SAXReader.java:343) at org.hibernate.ejb.Ejb3Configuration.addXMLEntities(Ejb3Configuration.java:716) ... 43 more {noformat}

    Hibernate JIRA | 6 years ago | David Loeffler
    org.glassfish.deployment.common.DeploymentException: invalid mapping: META-INF/course-queries.xml
  3. 0

    Hibernate Envers: Failed to Create Session Factory

    Stack Overflow | 2 years ago | AppSensei
    org.hibernate.MappingException: invalid configuration
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Struts 2 Hibernate null pointer exception while submitting the form

    Stack Overflow | 3 years ago | Eva Mariam
    org.xml.sax.SAXParseException: The content of element type "class" must match "(meta*,subselect?,cache?,synchronize*,comment?,tuplizer*,(id|composite-id),discriminator?,natural-id?,(version|timestamp)?,(property|many-to-one|one-to-one|component|dynamic-component|properties|any|map|set|list|bag|idbag|array|primitive-array)*,((join*,subclass*)|joined-subclass*|union-subclass*),loader?,sql-insert?,sql-update?,sql-delete?,filter*,resultset*,(query|sql-query)*)".

  1. mauritius 2 times, last 1 month ago
  2. rp 1 times, last 5 months ago
6 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. org.xml.sax.SAXParseException

    cvc-complex-type.3.1: Value '2.0' of attribute 'version' of element 'entity-mappings' is not valid with respect to the corresponding attribute use. Attribute 'version' has a fixed value of '1.0'.

    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException()
  2. Java RT
    SAXParserImpl$JAXPSAXParser.parse
    1. com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
    2. com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:131)
    3. com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:384)
    4. com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:318)
    5. com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(XMLSchemaValidator.java:417)
    6. com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaError(XMLSchemaValidator.java:3181)
    7. com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.processOneAttribute(XMLSchemaValidator.java:2801)
    8. com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.processAttributes(XMLSchemaValidator.java:2713)
    9. com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:2065)
    10. com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:705)
    11. com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:400)
    12. com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDriver.scanRootElementHook(XMLNSDocumentScannerImpl.java:626)
    13. com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:3103)
    14. com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:922)
    15. com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
    16. com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
    17. com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511)
    18. com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808)
    19. com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
    20. com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)
    21. com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
    22. com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
    22 frames
  3. dom4j
    SAXReader.read
    1. org.dom4j.io.SAXReader.read(SAXReader.java:465)
    2. org.dom4j.io.SAXReader.read(SAXReader.java:343)
    2 frames
  4. Hibernate EJB
    HibernatePersistence.createContainerEntityManagerFactory
    1. org.hibernate.ejb.Ejb3Configuration.addXMLEntities(Ejb3Configuration.java:716)
    2. org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:593)
    3. org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:72)
    3 frames
  5. Embedded GlassFish Web
    JPADeployer.prepare
    1. org.glassfish.persistence.jpa.PersistenceUnitLoader.loadPU(PersistenceUnitLoader.java:193)
    2. org.glassfish.persistence.jpa.PersistenceUnitLoader.<init>(PersistenceUnitLoader.java:109)
    3. org.glassfish.persistence.jpa.JPADeployer.prepare(JPADeployer.java:135)
    3 frames
  6. Kernel Classes
    ApplicationLifecycle.prepareModule
    1. com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:661)
    1 frame
  7. Deployment Related JavaEE Full Profile Classes
    EarDeployer.prepare
    1. org.glassfish.javaee.full.deployment.EarDeployer.prepareBundle(EarDeployer.java:285)
    2. org.glassfish.javaee.full.deployment.EarDeployer.access$200(EarDeployer.java:81)
    3. org.glassfish.javaee.full.deployment.EarDeployer$1.doBundle(EarDeployer.java:136)
    4. org.glassfish.javaee.full.deployment.EarDeployer$1.doBundle(EarDeployer.java:133)
    5. org.glassfish.javaee.full.deployment.EarDeployer.doOnBundles(EarDeployer.java:210)
    6. org.glassfish.javaee.full.deployment.EarDeployer.doOnAllTypedBundles(EarDeployer.java:219)
    7. org.glassfish.javaee.full.deployment.EarDeployer.doOnAllBundles(EarDeployer.java:245)
    8. org.glassfish.javaee.full.deployment.EarDeployer.prepare(EarDeployer.java:133)
    8 frames
  8. Kernel Classes
    ApplicationLifecycle.deploy
    1. com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:661)
    2. com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:312)
    3. com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:199)
    3 frames
  9. Embedded GlassFish Web
    DeployCommand.execute
    1. org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:286)
    1 frame
  10. Kernel Classes
    AdminAdapter.service
    1. com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:322)
    2. com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:337)
    3. com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:965)
    4. com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:92)
    5. com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1088)
    6. com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1077)
    7. com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:366)
    8. com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:203)
    8 frames
  11. Grizzly WS
    GrizzlyAdapter.service
    1. com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:166)
    1 frame
  12. Kernel Classes
    ContainerMapper.service
    1. com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:113)
    2. com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:245)
    2 frames
  13. Grizzly WS
    AbstractThreadPool$Worker.run
    1. com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:802)
    2. com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:705)
    3. com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:986)
    4. com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:178)
    5. com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135)
    6. com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)
    7. com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88)
    8. com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
    9. com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)
    10. com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
    11. com.sun.grizzly.ContextTask.run(ContextTask.java:69)
    12. com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:526)
    13. com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:507)
    13 frames
  14. Java RT
    Thread.run
    1. java.lang.Thread.run(Thread.java:637)
    1 frame