javax.xml.bind.UnmarshalException: unexpected element (uri:" ", local:"role"). Expected elements are <{ }Service>,<{ }Resource>,<{ }JndiProvider>,<{ }Connector>,<{ }Container>

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 nabble.com by Unknown author, 1 year ago
unexpected element (uri:" ", local:"role"). Expected elements are <{ }Service>,<{ }Resource>,<{ }JndiProvider>,<{ }Connector>,<{ }Container>
via Stack Overflow by leeyuiwah
, 1 year ago
unexpected element (uri:"", local:"entry"). Expected elements are (none)
via Stack Overflow by SANN3
, 2 years ago
unexpected element (uri:"http://schemas.microsoft.com/sharepoint/soap/directory/", local:"Users"). Expected elements are (none)
via java.net by Unknown author, 2 years ago
unexpected element (uri:"http://www.oksima.biz/software/data/articles", local:"articles"). Expected elements are <{}articles>
via Stack Overflow by Jerry
, 2 years ago
unexpected element (uri:"", local:"html"). Expected elements are <{}ABC>,<{}xyz>
via Stack Overflow by user1200125
, 2 years ago
unexpected element (uri:"http://esb.pkobp/adapter/calypso/tradekast/transaction", local:"caltradetran_ReplicateTransactionDataNotification"). Expected elements are (none)
javax.xml.bind.UnmarshalException: unexpected element (uri:" ", local:"role"). Expected elements are <{ }Service>,<{ }Resource>,<{ }JndiProvider>,<{ }Connector>,<{ }Container>
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.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:509)
at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:182)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:357)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2787)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:606)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:118)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:848)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777)
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 org.apache.openejb.config.sys.JaxbOpenejb.unmarshal(JaxbOpenejb.java:324)
at org.apache.openejb.config.sys.JaxbOpenejb.unmarshal(JaxbOpenejb.java:332)
at org.apache.openejb.config.ReadDescriptors.readResourcesXml(ReadDescriptors.java:255)
at org.apache.tomee.catalina.TomcatWebAppBuilder.checkHost(TomcatWebAppBuilder.java:2054)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1371)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1543)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1553)
at java.lang.Thread.run(Thread.java:745)

Users with the same issue

Once, 4 months ago
6 times, 11 months ago
15 times, 1 year ago
9 times, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 6 months ago

Write tip

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