Uploaded image for project: 'TomEE'
  1. TomEE
  2. TOMEE-4286

Namespace error when processing web-fragment.xml

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 10.0.0-M1, 9.1.2
    • None
    • None

    Description

      Using a web-fragment.xml in a jar file as follows:

       

      <web-fragment version="5.0" xmlns="http://jakarta.ee/xml/ns/jakartaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jakarta.ee/xml/ns/jakartaee http://jakarta.ee/xml/ns/jakartaee/web-fragment_5_0.xsd">
          <servlet>
              <servlet-name>simpleServlet</servlet-name>
              <servlet-class>org.apache.openejb.arquillian.tests.webfragment.WebFragmentTest$SimpleServlet</servlet-class>
          </servlet>
          <servlet-mapping>
              <servlet-name>simpleServlet</servlet-name>
              <url-pattern>/simpleServlet</url-pattern>
          </servlet-mapping>
      </web-fragment>

       

      Will result in the following exception being thrown:

       

      WARNING: can't read UrlSource{url=jar:file:/home/jgallimore/dev/tomee/arquillian/arquillian-tomee-tests/arquillian-tomee-webprofile-tests/target/arquillian-embedded-working-dir/0/wftest/WEB-INF/lib/webfragment.jar!/META-INF/web-fragment.xml}
      jakarta.xml.bind.UnmarshalException: unexpected element (uri:"http://jakarta.ee/xml/ns/jakartaee", local:"web-fragment"). Expected elements are <{http://java.sun.com/xml/ns/javaee}handler-chains>,<{http://java.sun.com/xml/ns/javaee}web-fragment>
          at org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.UnmarshallingContext.handleEvent(UnmarshallingContext.java:693)
          at org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.Loader.reportError(Loader.java:230)
          at org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.Loader.reportError(Loader.java:225)
          at org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.Loader.reportUnexpectedChildElement(Loader.java:92)
          at org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.UnmarshallingContext$DefaultRootLoader.childElement(UnmarshallingContext.java:1102)
          at org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.UnmarshallingContext._startElement(UnmarshallingContext.java:527)
          at org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.UnmarshallingContext.startElement(UnmarshallingContext.java:509)
          at org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.SAXConnector.startElement(SAXConnector.java:137)
          at java.xml/org.xml.sax.helpers.XMLFilterImpl.startElement(XMLFilterImpl.java:539)
          at org.apache.openejb.jee.JaxbJavaee$NoSourceFilter.startElement(JaxbJavaee.java:363)
          at java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:518)
          at java.xml/com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:374)
          at java.xml/com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDriver.scanRootElementHook(XMLNSDocumentScannerImpl.java:613)
          at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:3079)
          at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:836)
          at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:605)
          at java.xml/com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:112)
          at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:542)
          at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:889)
          at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:825)
          at java.xml/com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
          at java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1224)
          at java.xml/com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:637)
          at java.xml/org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java:345)
          at org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:218)
          at org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:189)
          at jakarta.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:128)
          at jakarta.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:111)
          at org.apache.openejb.jee.JaxbJavaee.unmarshal(JaxbJavaee.java:201)
          at org.apache.openejb.config.ReadDescriptors.mergeWebFragments(ReadDescriptors.java:619)
          at org.apache.openejb.config.ReadDescriptors.readWebApp(ReadDescriptors.java:592)
          at org.apache.openejb.config.ReadDescriptors.deploy(ReadDescriptors.java:128)
          at org.apache.openejb.config.ConfigurationFactory$Chain.deploy(ConfigurationFactory.java:420)
          at org.apache.openejb.config.ConfigurationFactory.configureApplication(ConfigurationFactory.java:1033)
          at org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal(TomcatWebAppBuilder.java:1318)
          at org.apache.tomee.catalina.TomcatWebAppBuilder.configureStart(TomcatWebAppBuilder.java:1162)
          at org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:134)
          at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:114)
          at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:4766)
          at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:171)
          at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:683)
          at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:658)
          at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:712)
          at org.apache.tomee.catalina.TomcatWebAppBuilder.deployWar(TomcatWebAppBuilder.java:687)
          at org.apache.tomee.catalina.TomcatWebAppBuilder.deployWebApps(TomcatWebAppBuilder.java:616)
          at org.apache.tomee.catalina.deployment.TomcatWebappDeployer.deploy(TomcatWebappDeployer.java:47)
          at org.apache.tomee.embedded.Container.deploy(Container.java:876)
          at org.apache.tomee.embedded.Container.deploy(Container.java:862)
          at org.apache.openejb.arquillian.embedded.EmbeddedTomEEContainer.deploy(EmbeddedTomEEContainer.java:173)
          at org.jboss.arquillian.container.impl.client.container.ContainerDeployController$3.call(ContainerDeployController.java:151)
          at org.jboss.arquillian.container.impl.client.container.ContainerDeployController$3.call(ContainerDeployController.java:118)
          at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.executeOperation(ContainerDeployController.java:239)
          at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.deploy(ContainerDeployController.java:118)
          at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
          at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.base/java.lang.reflect.Method.invoke(Method.java:568)
          at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:86)
          at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:103)
          at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:90)
          at org.jboss.arquillian.container.impl.client.ContainerDeploymentContextHandler.createDeploymentContext(ContainerDeploymentContextHandler.java:71)
          at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
          at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.base/java.lang.reflect.Method.invoke(Method.java:568)
          at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:86)
          at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:95)
          at org.jboss.arquillian.container.impl.client.ContainerDeploymentContextHandler.createContainerContext(ContainerDeploymentContextHandler.java:54)
          at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
          at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.base/java.lang.reflect.Method.invoke(Method.java:568)
          at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:86)
          at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:95)
          at org.jboss.arquillian.container.impl.client.container.DeploymentExceptionHandler.verifyExpectedExceptionDuringDeploy(DeploymentExceptionHandler.java:47)
          at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
          at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.base/java.lang.reflect.Method.invoke(Method.java:568)
          at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:86)
          at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:95)
          at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:133)
          at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:105)
          at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:62)
          at org.jboss.arquillian.container.impl.client.container.ContainerDeployController$1.perform(ContainerDeployController.java:92)
          at org.jboss.arquillian.container.impl.client.container.ContainerDeployController$1.perform(ContainerDeployController.java:77)
          at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.forEachDeployment(ContainerDeployController.java:232)
          at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.forEachManagedDeployment(ContainerDeployController.java:212)
          at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.deployManaged(ContainerDeployController.java:77)
          at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
          at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.base/java.lang.reflect.Method.invoke(Method.java:568)
          at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:86)
          at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:103)
          at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:90)
          at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:133)
          at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:105)
          at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:62)
          at org.jboss.arquillian.container.test.impl.client.ContainerEventController.execute(ContainerEventController.java:96)
          at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
          at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.base/java.lang.reflect.Method.invoke(Method.java:568)
          at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:86)
          at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:103)
          at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:90)
          at org.jboss.arquillian.test.impl.TestContextHandler.createClassContext(TestContextHandler.java:83)
          at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
          at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.base/java.lang.reflect.Method.invoke(Method.java:568)
          at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:86)
          at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:95)
          at org.jboss.arquillian.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:69)
          at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
          at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.base/java.lang.reflect.Method.invoke(Method.java:568)
          at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:86)
          at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:95)
          at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:133)
          at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:105)
          at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.beforeClass(EventTestRunnerAdaptor.java:89)
          at org.jboss.arquillian.junit.Arquillian$2.evaluate(Arquillian.java:163)
          at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:350)
          at org.jboss.arquillian.junit.Arquillian.access$200(Arquillian.java:54)
          at org.jboss.arquillian.junit.Arquillian$3.evaluate(Arquillian.java:177)
          at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
          at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
          at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:115)
          at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
          at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:69)
          at com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(IdeaTestRunner.java:38)
          at com.intellij.rt.execution.junit.TestsRepeater.repeat(TestsRepeater.java:11)
          at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:35)
          at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:232)
          at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:55)

      Attachments

        Activity

          People

            jgallimore Jonathan Gallimore
            jgallimore Jonathan Gallimore
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: