com.bea.xml.XmlException: failed to load java type corresponding to e=web-app@ht

在myeclipse里部署Weblogic项目(web project)时候的问题

 

配置:Weblogic9.2  MyEclipse 7.0

 

第一:浏览器浏览时,报以下错误

 

Error 404--Not Found

From RFC 2068 Hypertext Transfer Protocol -- HTTP/1.1:

10.4.5 404 Not Found

The server has not found anything matching the Request-URI. No indication is given of whether the condition is temporary or permanent.

If the server does not wish to make this information available to the client, the status code 403 (Forbidden) can be used instead. The 410 (Gone) status code SHOULD be used if the server knows, through some internally configurable mechanism, that an old resource is permanently unavailable and has no forwarding address.

 

第二:仔细查看,在重新部署的时候,发现一个问题所在的错误:

<2009-4-1 下午09时57分03秒 CST> <Error> <J2EE> <BEA-160197> <Unable to load descriptor C:\Program Files\bea\user_projects\domains\base_domain\.\autodeploy\webProject/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

......

 

实际上,在网上搜了好多,没有一个确切的办法,后面,也是无意中,发现一个外国的网站

https://jira.jboss.org/jira/browse/JBSEAM-2247,感觉看懂一点,我觉得就是web.xml文件配置错误,后面我在Weblogic附带例子中找了一个web.xml,修改原先的文件(新建web project自动生成),重新部署,在浏览器中浏览,O了。

 

附:

自动生成的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.jsp</welcome-file>
  </welcome-file-list>
</web-app>

我修改后的简单的web.xml

 <?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:j2ee="http://java.sun.com/xml/ns/j2ee">
 
  <welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
  </welcome-file-list>

</web-app>

 

或者

<?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">
  <welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
  </welcome-file-list>
</web-app>

 

就上面的web.xml文件我又重新尝试了一下,为什么会出现版本不符合的问题,也许是weblogic不支持这个版本,所以我也重新新建一个web project,后来出现一个选择版本的问题,默认选择J2EE 1.4,而我们经常选择前面一个,Jave EE 5.0(因为选择1.4的有个警告,而5.0没有警告),这个时候我尝试用J2EE 1.4,发现自动生成的web.xml已经是上面的了,这告诉我们有的时候还是注意一下版本问题,适当的时候还是需要用一下老的版本,新版本需要支持的。
 

这还是告诉我们不要偷懒了,有的时候,不是什么都可以用自动生成的。我也是写这个告诉那些刚学myeclipse和Weblogic的,希望发现这个错误的时候,看看我的博客,能够帮助你尽快解决问题。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值