weblogic中的web.xml验证由于cookie-config而导致错误 [英] web.xml validation in Weblogic throws error because of cookie-config

查看:4920
本文介绍了weblogic中的web.xml验证由于cookie-config而导致错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个应用程序的web.xml。

 <?xml version =1.0?& 
< web-app version =2.5xmlns =http://java.sun.com/xml/ns/javaeexmlns:xsi =http://www.w3.org/2001/ XMLSchema-instancexsi:schemaLocation =http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd\">
< display-name> ..< / display-name>

< description> ..< / description>



< session-config>
< cookie-config>
< name> SESSIONDEBUG_JSESSIONID< / name>
< / cookie-config>
< / session-config>
< / web-app>

部署时收到以下错误

 原因:weblogic.descriptor.DescriptorException:VALIDATION PROBLEMS WERE FOUND 
问题:cvc-complex-type.2.4a:预期的元素'session-timeout @ http:// java .sun.com / xml / ns / javaee'而不是'cookie-config @ http://java.sun.com/xml/ns/javaee'这里在元素session- config @ http://java.sun.com / xml / ns / javaee:< null>

不确定我是否完全理解错误。我看到它要我声明会话超时在那里。 c>< cookie-config> c $ c>是 jcp.org/aboutJava/communityprocess/final/jsr315/index.html\">Servlet 3.0 ,而旧版本(例如2.5)中不支持。 web.xml 已声明符合Servlet 2.5。



您有两个选项:


  1. Redeclare web.xml 符合Servlet 3.0(隐含地也需要一个Servlet 3.0兼容的目标容器例如Tomcat 7,Glassfish 3,WebLogic 12等)。


  2. 如果无法升级,请使用自定义servlet过滤器或特定于容器的配置(例如Tomcat / JBoss中的 Valve );由于我从未真正使用它,因此无法回答WebLogic的问题,请考虑请求一个新的该部分的问题)。



I have the follwing web.xml for an application.

<?xml version="1.0"?>
<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">
<display-name>..</display-name>

<description>..</description>



<session-config>
    <cookie-config>
        <name>SESSIONDEBUG_JSESSIONID</name>
    </cookie-config>
  </session-config>
</web-app>

I get the following error upon deployment

Caused By: weblogic.descriptor.DescriptorException: VALIDATION PROBLEMS WERE FOUND
problem: cvc-complex-type.2.4a: Expected element 'session-timeout@http://java.sun.com/xml/ns/javaee' instead of 'cookie-    config@http://java.sun.com/xml/ns/javaee' here in element session-    config@http://java.sun.com/xml/ns/javaee:<null>

Not sure I fully understand the error. I see that it wants me to declare session-timeout in there. I'll give that a try..

解决方案

The <cookie-config> is introduced in Servlet 3.0 and not supported in older versions such as 2.5. Your web.xml is declared conform Servlet 2.5.

You've 2 options:

  1. Redeclare web.xml conform Servlet 3.0 (which implicitly also requires a Servlet 3.0 compatible target container such as Tomcat 7, Glassfish 3, WebLogic 12, etc).

  2. If you can't upgrade, then forget it and solve it using a custom servlet filter or container-specific configuration (e.g. a Valve in Tomcat/JBoss; can't answer off top of head for WebLogic as I've never really used it, consider asking a new question for that part).

这篇关于weblogic中的web.xml验证由于cookie-config而导致错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆