( 转)weblogic92启动Unmarshaller failed和web-app@http://java.sun.com/xml/ns/javaee

 
就是在myeclipse里面新建个web project 部署到weblogic上后,启动时报错:
<Unable to load descriptor C:/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
......
 
  
意外间发现在JBoss Community网站上发现了这个问题,这个网址:https://jira.jboss.org/jira/browse/JBSEAM-2247
  
 
原来是weblogic90不支持用eclipse自动生成2.5版本的web.xml,我的如下:
 
web.xml原来配置

<?xml version="1.0" encoding="UTF-8"?>  
<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">  
      
    <welcome-file-list>  
    <welcome-file>index.html</welcome-file>  
  </welcome-file-list>  
</web-app>  
 
 
方法一:
 
换成:并且去掉version="2.5"
  
<web-app xmlns:j2ee="http://java.sun.com/xml/ns/j2ee">
 
 
方法二:
  改成sun公司的web-app_2_5.dtd标准

<?xml version="1.0" encoding="UTF-8"?> 
      <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" 
      "http://java.sun.com/dtd/web-app_2_5.dtd"> 
<web-app>
 
</web-app>

 

你可能感兴趣的:(weblogic)