com.bea.xml.XmlException: failed to load java type correspondingto e=web-app@http://java.sun.com/xml/ns/javaee
部署 web project 到weblogic上后,错误解决
常见错误Unmarshaller failed:
<Unable to load descriptorD:\bea\user_projects\domains\base_domain\.\autodeploy\demo/
WEB-INF/web.xml of module webProject. The error isweblogic.descriptor.DescriptorException: Unmarshaller failed
atweblogic.descriptor.internal.MarshallerFactory$1.createDescriptor
Caused by: com.bea.xml.XmlException: failed to load java typecorresponding to e=web-app@http://java.sun.com/xml/ns/javaee
atcom.bea.staxb.runtime.internal.UnmarshalResult.getPojoBindingType
......
问题描述:
Weblogic9.2 不支持用 MyEclipse 自动生成2.5版本的web.xml,如下:
<web-app version="2.5"
新建项目 采用 J2EE1.4
<?xml version="1.0"encoding="UTF-8"?>
<web-app version="2.4"
</web-app>
解决办法:
1.web.xml文件改成2.4版本
将下面内容,覆盖你原有的web.xml文件
<?xml version="1.0"encoding="UTF-8"?>
<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">
</web-app>
2.增加 weblogic 上下文根:
<?xml version = "1.0" encoding = "GB2312"?>
<!DOCTYPEweblogic-web-app
< weblogic-web-app>
<!--配置访问地址上下文配置-->
</weblogic-web-app>
以上两种方法感觉第一种方法实用,第二种没有试成功