变态的weblogic92

将原先813的应用移植到weblogic92上,修改了weblogc.xml文件的命名空间:

 

改为如下格式:

<weblogic-web-app xmlns="http://www.bea.com/ns/weblogic/90"
 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
  http://www.bea.com/ns/weblogic/90
  http://www.bea.com/ns/weblogic/90/weblogic-web-app.xsd">

 

web.xml的servlet版本,修改为如下格式:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.4" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee   http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">

 

启动应用,老是报如下错误:

weblogic.application.ModuleException: VALIDATION PROBLEMS WERE FOUND
  /opt/bea1/apps/ppsdomain/app/WEB-INF/weblogic.xml:33:5:33:5: problem: cvc-complex-type.2.4a: Expected elements 'verbose@http://www.bea.com/ns/weblogic/90 working-dir@http://www.bea.com/ns/weblogic/90 print-nulls@http://www.bea.com/ns/weblogic/90 backward-compatible@http://www.bea.com/ns/weblogic/90 encoding@http://www.bea.com/ns/weblogic/90 exact-mapping@http://www.bea.com/ns/weblogic/90 default-file-name@http://www.bea.com/ns/weblogic/90 rtexprvalue-jsp-param-name@http://www.bea.com/ns/weblogic/90 debug@http://www.bea.com/ns/weblogic/90' instead of 'keepgenerated@http://www.bea.com/ns/weblogic/90' here in element jsp-descriptor@http://www.bea.com/ns/weblogic/90:</opt/bea1/apps/ppsdomain/app/WEB-INF/weblogic.xml:33:5>

 

在网上找了很多类似帖子,都没能解决问题,后来仔细研究了weblogic92的配置文件说明文档及weblogic-web-app.xsd,多次修改验证,才知道问题的原因

 

weblogc.xml文件里面的各个元素必须按照顺序配置才行否则一定会出错

 

其中包括session-descriptor节点及jsp-descriptor节点,且813的配置文件格式与92的有差异,92文件如下:

 

<?xml version="1.0" encoding="UTF-8"?>
<weblogic-web-app xmlns="http://www.bea.com/ns/weblogic/90"
 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
  http://www.bea.com/ns/weblogic/90
  http://www.bea.com/ns/weblogic/90/weblogic-web-app.xsd">

 <session-descriptor>
  <timeout-secs>300</timeout-secs>
  <invalidation-interval-secs>60</invalidation-interval-secs>
  <id-length>10</id-length>
  <cookies-enabled>false</cookies-enabled>
  <cookie-name>jid</cookie-name>
  <cookie-comment>
   WebLogic Server Session Tracking Cookie
  </cookie-comment>
  <cookie-max-age-secs>-1</cookie-max-age-secs>
  <persistent-store-type>memory</persistent-store-type>
  <persistent-store-cookie-name>
   WLCOOKIE
  </persistent-store-cookie-name>
  <persistent-store-table>
   wl_servlet_sessions
  </persistent-store-table>
  <jdbc-connection-timeout-secs>120</jdbc-connection-timeout-secs>
  <url-rewriting-enabled>true</url-rewriting-enabled>
 </session-descriptor>
 <jsp-descriptor>
  <page-check-seconds>-1</page-check-seconds>
  <precompile>false</precompile>
  <precompile-continue>false</precompile-continue>
  <verbose >false</verbose >
  <working-dir>jspc/wappps</working-dir>
  <encoding>UTF-8</encoding>
 </jsp-descriptor>

 <container-descriptor>
  <servlet-reload-check-secs>-1</servlet-reload-check-secs>
 </container-descriptor>

 <virtual-directory-mapping>
  <local-path>/opt/bea1/apps/ppsdomain</local-path>
  <url-pattern>/pages/*</url-pattern>
 </virtual-directory-mapping>

 <context-root>/</context-root>
 <wl-dispatch-policy>run</wl-dispatch-policy>
</weblogic-web-app>

你可能感兴趣的:(Web,xml,jsp,weblogic,sun)