---
title: "The error is weblogic.descriptor.DescriptorException: Unmarshaller failed"
author: "jsx112"
date: "2012-09-13T11:58:40Z"
tags: []
categories: ["企业架构"]
slug: "the-error-is-weblogic-descriptor-descriptorexception-unmarshaller-failed"
draft: false
lastmod: "2012-09-13T11:59:25Z"
id: 1677654
url: "https://jsx112.iteye.com/blog/1677654"
---

部署 web project 到weblogic92(换成10.3就不会出问题了)上后，错误解决

常见错误Unmarshaller failed：  
&lt;Unable to load descriptor D:\\bea\\user\_projects\\domains\\base\_domain\\.\\autodeploy\\demo/  
WEB-INF/web.xml of module webProject. The error is weblogic.descriptor.DescriptorException: Unmarshaller failed

 at weblogic.descriptor.internal.MarshallerFactory$1.createDescriptor

Caused by: com.bea.xml.XmlException: failed to load java type corresponding to e=web-app@http://java.sun.com/xml/ns/javaee

 at com.bea.staxb.runtime.internal.UnmarshalResult.getPojoBindingType

......

问题描述：

[Weblogic](/t/weblogic/)9.2 不支持用 MyEclipse 自动生成2.5版本的web.xml，如下：

&lt;web-app version="2.5" 

                      xmlns="http://java.sun.com/xml/ns/javaee" 

                      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 

                      xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 

                      http://java.sun.com/xml/ns/javaee/web-app\_2\_5.xsd"&gt;

新建项目 采用 J2EE1.4

&lt;?xml version="1.0" encoding="UTF-8"?&gt;  
&lt;web-app version="2.4"  
xmlns="http://java.sun.com/xml/ns/j2ee"  
                    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  
                   xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee  
                   http://java.sun.com/xml/ns/j2ee/web-app\_2\_4.xsd"&gt;  
&lt;/web-app&gt;

**解决办法：**

1.web.xml文件改成2.4版本

将下面内容，覆盖你原有的web.xml文件

 &lt;?xml version="1.0" encoding="UTF-8"?&gt;  
&lt;web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"  
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee  
http://java.sun.com/xml/ns/j2ee/web-app\_2\_4.xsd"&gt;

&lt;/web-app&gt;

2.增加 weblogic 上下文根：

   解决方法是：在项目的WEB-INF/下面增加一个 weblogic.xml文件  里面写上：

    

&lt;? xml  version = "1.0"  encoding = "GB2312" ?&gt;    

&lt;! DOCTYPE  weblogic-web-app   

   PUBLIC  "-//BEA Systems, Inc.//DTD Web Application 8.1//EN"  

   "http://www.bea.com/servers/wls810/dtd/weblogic810-web-jar.dtd" &gt;    

  

&lt; weblogic-web-app &gt;    

&lt;!--配置访问地址上下文配置--&gt;    

      &lt; context-root &gt; /webLogicDemo/ &lt;/ context-root &gt;    

&lt;/ weblogic-web-app &gt;   

以上两种方法感觉第一种方法实用，第二种没有试成功