So the issue here is that when ReadDescriptors tries to unmarshal openejb-cmp-orm.xml here: https://github.com/apache/tomee/blob/master/container/openejb-core/src/main/java/org/apache/openejb/config/ReadDescriptors.java#L551
fails, because JaxbJavaee.unmarshalJavaee() forces a http://java.sun.com/xml/ns/javaee namespace, and so you get the error below: unexpected element (uri:"http://java.sun.com/xml/ns/javaee", local:"entity"). Expected elements are <{ http://java.sun.com/xml/ns/persistence/orm}embeddable>,<{ http://java.sun.com/xml/ns/persistence/orm}entity>,<{ http://java.sun.com/xml/ns/persistence/orm}table-generator>,<{ http://java.sun.com/xml/ns/persistence/orm}named-native-query>,<{ http://java.sun.com/xml/ns/persistence/orm}sequence-generator>,<{ http://java.sun.com/xml/ns/persistence/orm}sql-result-set-mapping>,<{ http://java.sun.com/xml/ns/persistence/orm}named-query>,<{ http://java.sun.com/xml/ns/persistence/orm}description>,<{ http://java.sun.com/xml/ns/persistence/orm}persistence-unit-metadata>,<{ http://java.sun.com/xml/ns/persistence/orm}catalog>,<{ http://java.sun.com/xml/ns/persistence/orm}schema>,<{ http://java.sun.com/xml/ns/persistence/orm}access>,<{ http://java.sun.com/xml/ns/persistence/orm}mapped-superclass>,<{ http://java.sun.com/xml/ns/persistence/orm}package> My guess is its been broken a while, and is broken in master, 7.1.x, 7.0.x, 1.7.x and maybe even earlier than that. I'll merge this PR in and we'll see what the build looks like on the CI. Thanks for the PR Otavio! Jon On Mon, Nov 19, 2018 at 12:37 PM Otávio Gonçalves de Santana < [email protected]> wrote: > Hey, sorry I missed this email. > It isn't related to Java 11. > That is an XML unmarshal error around CMP configuration. > > On Mon, Nov 19, 2018 at 10:09 AM Jean-Louis Monteiro < > [email protected]> wrote: > > > That's why I was asking for the Java version and the version of TomEE > > -- > > Jean-Louis Monteiro > > http://twitter.com/jlouismonteiro > > http://www.tomitribe.com > > > > > > On Mon, Nov 19, 2018 at 12:55 PM Thomas Andraschko < > > [email protected]> wrote: > > > > > Is it related to https://issues.apache.org/jira/browse/TOMEE-2271? > > > > > > Am Mo., 19. Nov. 2018 um 12:38 Uhr schrieb Jonathan Gallimore < > > > [email protected]>: > > > > > > > Thanks for providing that extra detail here. I did take a look at > this > > > one, > > > > and I'm surprised we haven't run into it before. I'll pick up your PR > > and > > > > review. > > > > > > > > Cheers! > > > > > > > > Jon > > > > > > > > On Mon, Nov 19, 2018 at 11:33 AM Otávio Gonçalves de Santana < > > > > [email protected]> wrote: > > > > > > > > > Sorry, a sent the first one as an accident. > > > > > > > > > > I’ve created a PR: https://github.com/apache/tomee/pull/200 > > > > > > > > > > The error class happened at this class JaxbJavaee.java, because of > > this > > > > > filter: > > > > > > > > > > final JavaeeNamespaceFilter xmlFilter = new > > > > > JavaeeNamespaceFilter(parser.getXMLReader()); > > > > > xmlFilter.setContentHandler(unmarshaller.getUnmarshallerHandler()); > > > > > // unmarshall > > > > > source = new SAXSource(xmlFilter, new InputSource(in)); > > > > > > > > > > Most precise, at this piece of code: > > > > > > > > > > super.startElement("http://java.sun.com/xml/ns/javaee", localName, > > > > qname, > > > > > atts); > > > > > > > > > > This is the code file to test: unmarshalling openejb-cmp-orm.xml > > > > > < > > > > > > > > > > > > > > > https://github.com/apache/tomee/pull/200/files#diff-78d8a62617e6ef5c7a0567ee4a62711e > > > > > > > > > > > < > > > > > > > > > > > > > > > https://github.com/apache/tomee/pull/200/files#diff-78d8a62617e6ef5c7a0567ee4a62711e > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > On Mon, Nov 19, 2018 at 8:44 AM Jonathan Gallimore < > > > > > [email protected]> wrote: > > > > > > > > > > > Hey Otavio > > > > > > > > > > > > Thanks for posting. At what point do you run into this exception > > > (your > > > > > > stacktrace shows the unmarshal, but not where its called from). > If > > > you > > > > > > have a PR, shoot a link here and I'll be happy to take a look. > > > > > > > > > > > > Jon > > > > > > > > > > > > On Mon, Nov 19, 2018 at 10:31 AM Otávio Gonçalves de Santana < > > > > > > [email protected]> wrote: > > > > > > > > > > > > > Hi all. > > > > > > > > > > > > > > We found an error when using CMP; when the container starts, it > > > > returns > > > > > > an > > > > > > > unmarshal error: > > > > > > > > > > > > > > > > > > > > > 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 > > > > > > > > > > > > > > > > > > > > > > > > > > > > com.sun.xml.bind.v2.runtime.unmarshaller.SAXConnector.startElement(SAXConnector.java:150) > > > > > > > at > > > > > > > > > > > > org.xml.sax.helpers.XMLFilterImpl.startElement(XMLFilterImpl.java:551) > > > > > > > at > > > > > > > > > > > > > > > > > > > > > > > > > > > > org.apache.openejb.jee.JaxbJavaee$JavaeeNamespaceFilter.startElement(JaxbJavaee.java:291) > > > > > > > at > > > > > > > > > > > > > > > > > > > > > > > > > > > > com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:509) > > > > > > > at > > > > > > > > > > > > > > > > > > > > > > > > > > > > com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1359) > > > > > > > at > > > > > > > > > > > > > > > > > > > > > > > > > > > > com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2784) > > > > > > > at > > > > > > > > > > > > > > > > > > > > > > > > > > > > com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:602) > > > > > > > at > > > > > > > > > > > > > > > > > > > > > > > > > > > > com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:505) > > > > > > > at > > > > > > > > > > > > > > > > > > > > > > > > > > > > com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:842) > > > > > > > at > > > > > > > > > > > > > > > > > > > > > > > > > > > > com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:771) > > > > > > > at > > > > > > > > > > > > > > > > > > > > > > > > > > > > com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141) > > > > > > > at > > > > > > > > > > > > > > > > > > > > > > > > > > > > com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213) > > > > > > > at > > > > > > > > > > > > > > > > > > > > > > > > > > > > com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:643) > > > > > > > at > > > > org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java:357) > > > > > > > at > > > > > > > > > > > > > > > > > > > > > > > > > > > > com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:258) > > > > > > > at > > > > > > > > > > > > > > > > > > > > > > > > > > > > com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:236) > > > > > > > at > > > > > > > > > > > > > > > > > > > > > > > > > > > > com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:288) > > > > > > > > > > > > > > I found the error at the JavaeeNamespaceFilter that initially I > > try > > > > to > > > > > > use > > > > > > > either Strategy or Strategy to do a bypass on this filter when > is > > > > CMP. > > > > > > > However, with a not good result. So, I created a more > > > straightforward > > > > > > > solution that creates a new method that does not use this > filter. > > > > > > > > > > > > > > > > > > > > > > > > > > > >
