org.apache.openejb.OpenEJBException: Cannot unmarshall the openejb-cmp-orm.xml file: jar:f ile:/E:/Softwares/apache-tomee-1.5.1-plus/apache-tomee-plus-1.5.1/apps/EntityBean.jar!/MET A-INF/openejb-cmp-orm.xml: unexpected element (uri:"http://java.sun.com/xml/ns/javaee", lo cal:"entity"). Expected elements are <{http://java.sun.com/xml/ns/persistence/orm}package> ,<{http://java.sun.com/xml/ns/persistence/orm}sequence-generator>,<{http://java.sun.com/xm l/ns/persistence/orm}mapped-superclass>,<{http://java.sun.com/xml/ns/persistence/orm}named -query>,<{http://java.sun.com/xml/ns/persistence/orm}access>,<{http://java.sun.com/xml/ns/ persistence/orm}table-generator>,<{http://java.sun.com/xml/ns/persistence/orm}persistence- unit-metadata>,<{http://java.sun.com/xml/ns/persistence/orm}entity>,<{http://java.sun.com/ xml/ns/persistence/orm}embeddable>,<{http://java.sun.com/xml/ns/persistence/orm}catalog>,< {http://java.sun.com/xml/ns/persistence/orm}named-native-query>,<{http://java.sun.com/xml/ ns/persistence/orm}sql-result-set-mapping>,<{http://java.sun.com/xml/ns/persistence/orm}sc hema>,<{http://java.sun.com/xml/ns/persistence/orm}description>

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Samebug tips

,
via Stack Overflow by Blaise Doughan

Your current object model and mappings do not match the XML content. Check your JAXB annotations.

Solutions on the web

via openejb-users by Bibhuti, 1 year ago
Cannot unmarshall the openejb-cmp-orm.xml file: jar:f ile:/E:/Softwares/apache-tomee-1.5.1-plus/apache-tomee-plus-1.5.1/apps/EntityBean.jar!/MET A-INF/openejb-cmp-orm.xml: unexpected element (uri:"http://java.sun.com/xml/ns/javaee", lo cal:"entity
via openejb-users by Bibhuti, 1 year ago
Cannot unmarshall the openejb-cmp-orm.xml file: jar:f ile:/E:/Softwares/apache-tomee-1.5.1-plus/apache-tomee-plus-1.5.1/apps/EntityBean.jar!/MET A-INF/openejb-cmp-orm.xml: unexpected element (uri:"http://java.sun.com/xml/ns/javaee", lo cal:"entity
org.apache.openejb.OpenEJBException: Cannot unmarshall the openejb-cmp-orm.xml file: jar:f ile:/E:/Softwares/apache-tomee-1.5.1-plus/apache-tomee-plus-1.5.1/apps/EntityBean.jar!/MET A-INF/openejb-cmp-orm.xml: unexpected element (uri:"http://java.sun.com/xml/ns/javaee", lo cal:"entity"). Expected elements are <{http://java.sun.com/xml/ns/persistence/orm}package> ,<{http://java.sun.com/xml/ns/persistence/orm}sequence-generator>,<{http://java.sun.com/xm l/ns/persistence/orm}mapped-superclass>,<{http://java.sun.com/xml/ns/persistence/orm}named -query>,<{http://java.sun.com/xml/ns/persistence/orm}access>,<{http://java.sun.com/xml/ns/ persistence/orm}table-generator>,<{http://java.sun.com/xml/ns/persistence/orm}persistence- unit-metadata>,<{http://java.sun.com/xml/ns/persistence/orm}entity>,<{http://java.sun.com/ xml/ns/persistence/orm}embeddable>,<{http://java.sun.com/xml/ns/persistence/orm}catalog>,< {http://java.sun.com/xml/ns/persistence/orm}named-native-query>,<{http://java.sun.com/xml/ ns/persistence/orm}sql-result-set-mapping>,<{http://java.sun.com/xml/ns/persistence/orm}sc hema>,<{http://java.sun.com/xml/ns/persistence/orm}description>
at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.handleEvent(UnmarshallingContext.java:662)
at com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportError(Loader.java:258)
at com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportError(Loader.java:253)
at com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportUnexpectedChildElement(Loader.java:120)
at com.sun.xml.bind.v2.runtime.unmarshaller.Loader.childElement(Loader.java:105)
at com.sun.xml.bind.v2.runtime.unmarshaller.StructureLoader.childElement(StructureLoader.java:262)
at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext._startElement(UnmarshallingContext.java:498)
at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.startElement(UnmarshallingContext.java:480)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(UnknownSource)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(UnknownSource)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(UnknownSource)
at org.apache.xerces.parsers.XML11Configuration.parse(UnknownSource)
at org.apache.xerces.parsers.XML11Configuration.parse(UnknownSource)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java:333)
at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:218)
at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:196)
at org.apache.openejb.config.ReadDescriptors.readCmpOrm(ReadDescriptors.java:468)
at org.apache.openejb.config.ReadDescriptors.deploy(ReadDescriptors.java:95)
at org.apache.openejb.config.ConfigurationFactory$Chain.deploy(ConfigurationFactory.java:338)
at org.apache.openejb.config.ConfigurationFactory.configureApplication(ConfigurationFactory.java:827)
at org.apache.openejb.config.ConfigurationFactory.configureApplication(ConfigurationFactory.java:674)
at org.apache.openejb.config.ConfigurationFactory.getOpenEjbConfiguration(ConfigurationFactory.java:446)
at org.apache.openejb.assembler.classic.Assembler.getOpenEjbConfiguration(Assembler.java:364)
at org.apache.openejb.assembler.classic.Assembler.build(Assembler.java:343)
at org.apache.openejb.OpenEJB$Instance.(OpenEJB.java:144)
at org.apache.openejb.OpenEJB.init(OpenEJB.java:290)
at org.apache.tomee.catalina.TomcatLoader.initialize(TomcatLoader.java:233)
at org.apache.tomee.catalina.TomcatLoader.init(TomcatLoader.java:130)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:402)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:110)
at org.apache.catalina.startup.Catalina.load(Catalina.java:633)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:281)

Users with the same issue

Samebug visitor profile picture
Unknown user
Once, 4 months ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 2 years ago
8 more bugmates

Know the solutions? Share your knowledge to help other developers to debug faster.