webLogic11g部署war包问题解决方案(转)

1、如果在JavaBean的映射文件中使用了<query id="XXX">....</query>

   可能会报异常:weblogic.application.ModuleException: :org.hibernate.HibernateException:Errors in named queries: getWaveDocByCode, getPreAllocateByCondition,

 引起原因是 webLogic 首先加载自带的jar包,然后加载项目里面的jar。

 

解决方案:将下面的一段xml放在war包里面的WEB-INF下

<?xml version="1.0" encoding="UTF-8" ?>  
<weblogic-web-app >  
    <container-descriptor>  
        <prefer-web-inf-classes>true</prefer-web-inf-classes>  
    </container-descriptor> 
</weblogic-web-app>

 

2、Caused By: java.lang.ClassCastException: weblogic.xml.jaxp.RegistryDocumentBuilderFactory cannot be cast to javax.xml.parsers.DocumentBuilderFactory
 at javax.xml.parsers.DocumentBuilderFactory.newInstance(Unknown Source)

此问题引起的原因是webLogic的jar与项目xml-apis.jar使用的jar冲突了

 

解决方案:删除掉项目里使用的xml-apis.jar就OK了。

 

 

3、共享内存设置

<?xml version="1.0" encoding="UTF-8"?>

<weblogic-web-app>
 <session-descriptor>
  <persistent-store-type>replicated_if_clustered</persistent-store-type>
  <sharing-enabled>true</sharing-enabled>
 </session-descriptor>
 <container-descriptor>
  <prefer-web-inf-classes>true</prefer-web-inf-classes>
 </container-descriptor>
 <context-root>/</context-root>
</weblogic-web-app>

 

 

转 http://hi.baidu.com/liwenqian1688/item/8982dc276b6bd34c47996203

posted @ 2013-09-25 11:55  xhqgogogo  阅读(1215)  评论(0编辑  收藏  举报