Failed to load java type corresponding to e=web-app@

Working with various versions of Weblogic application server, you might have encountered the error partially described in the title. The error would not appear during the build but during deployment. A more complete stack trace of this error is presented below:

  2. com.bea.xml.XmlException: failed to load java type corresponding to e=web-app@
  3. at com.bea.staxb.runtime.internal.UnmarshalResult.getPojoBindingType(
  4. at com.bea.staxb.runtime.internal.UnmarshalResult.determineTypeForGlobalElement(
  5. at com.bea.staxb.runtime.internal.UnmarshalResult.determineTypeForGlobalElement(
  6. at com.bea.staxb.runtime.internal.UnmarshalResult.determineRootType(
  7. at com.bea.staxb.runtime.internal.UnmarshalResult.unmarshalDocument(
  8. at com.bea.staxb.runtime.internal.UnmarshallerImpl.unmarshal(
  9. at weblogic.descriptor.internal.MarshallerFactory$1.createDescriptor(
  10. at weblogic.descriptor.DescriptorManager.createDescriptor(
  11. at weblogic.descriptor.DescriptorManager.createDescriptor(
  12. at weblogic.application.descriptor.AbstractDescriptorLoader2.getDescriptorBeanFromReader(
  13. at weblogic.application.descriptor.AbstractDescriptorLoader2.createDescriptorBean(
  14. at weblogic.application.descriptor.AbstractDescriptorLoader2.loadDescriptorBeanWithoutPlan(
  15. at weblogic.application.descriptor.AbstractDescriptorLoader2.loadDescriptorBean(
  16. at weblogic.servlet.internal.WebAppDescriptor.getWebAppBean(
  17. at weblogic.servlet.internal.WebAppModule.loadDescriptor(
  18. at weblogic.servlet.internal.WebAppModule.prepare(
  19. at weblogic.application.internal.flow.ScopedModuleDriver.prepare(
  20. at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(

This was very strange at first. It seemed that the DTD currently mentioned in the web.xml file corresponding to a web module was not correct. The problem was that the project had worked before, with the same Weblogic version.

Trying to remove the DTD definition and actually make the web.xml compliant with the latest standards (xml schema, qualify the elements with the adequate namespaces) did not fix the problem. I would not have gone with such a solution anyway, as the project works for at least one year in the current configuration.


Eventually I found the issue: The build was done pointing to the wrong Weblogic version (used the weblogic.jar from 10.3 instead of 9.2) No code changes were actually necessary to fix the problem just a rebuild while pointing to the right library repository.

No issue was signaled during the build and I am sure that I could have deployed it on weblogic 10 without any issues, however on Weblogic 9 did not work.

As soon as the build was correctly executed, the problem disappeared. So if you experience the same behavior, first ensure your build runs with the adequate parameters and most important Weblogic libraries and only afterwards start applying code changes.