web-app_2_5.xsd 在 Weblogic 中验证 web.xml 时显示错误
我已经使用 Spring 3.0 使用 Tomcat Server 和 Tomcat 完成了一个动态 Web 项目。效果很好。当我在 Weblogic Server 中部署相同的内容时;它向我抛出一个错误:
VALIDATION PROBLEMS WERE FOUND problem: cvc-enumeration-valid: string value '2.5' is not a valid enumeration value for web-app-versionType in namespace http://java.sun.com/xml/ns/j2ee: at weblogic.descriptor.internal.MarshallerFactory$1.evaluateResults(MarshallerFactory.java:245) at weblogic.descriptor.internal.MarshallerFactory$1.evaluateResults(MarshallerFactory.java:231) at weblogic.descriptor.internal.MarshallerFactory$1.createDescriptor(MarshallerFactory.java:155) at weblogic.descriptor.BasicDescriptorManager.createDescriptor(BasicDescriptorManager.java:323) --- weblogic.application.ModuleException: VALIDATION PROBLEMS WERE FOUND
Web.xml 的起始行:
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" 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_5.xsd">
但在 Tomcat 中也同样有效。
I have done a Dynamic Web project with Spring 3.0 using Tomcat Server & it works fine. When i deployed the same in Weblogic Server; it throws me an error:
VALIDATION PROBLEMS WERE FOUND problem: cvc-enumeration-valid: string value '2.5' is not a valid enumeration value for web-app-versionType in namespace http://java.sun.com/xml/ns/j2ee: at weblogic.descriptor.internal.MarshallerFactory$1.evaluateResults(MarshallerFactory.java:245) at weblogic.descriptor.internal.MarshallerFactory$1.evaluateResults(MarshallerFactory.java:231) at weblogic.descriptor.internal.MarshallerFactory$1.createDescriptor(MarshallerFactory.java:155) at weblogic.descriptor.BasicDescriptorManager.createDescriptor(BasicDescriptorManager.java:323) --- weblogic.application.ModuleException: VALIDATION PROBLEMS WERE FOUND
Starting lines of web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" 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_5.xsd">
But the same works in Tomcat.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您显然正在使用的 Weblogic 9.2 是一个 J2EE 1.4 应用程序服务器。 Servlet 2.5 是 JavaEE 5 API,因此不受支持。您的服务器最高只能达到 Servlet 2.4。
Weblogic 9.2, which you are apparently using, is a J2EE 1.4 appserver. Servlet 2.5 is a JavaEE 5 API, and is therefore not supported. Your server only goes as high as Servlet 2.4.
你有显示名称标签吗?在我的例子中,我有标签显示名称,这导致了悲伤,我还将命名空间从 _http://java.sun.com/xml/ns/j2ee 更改为 _http:// java.sun.com/xml/ns/javaee
例如:
Do you have display-name tag, in my case I had the tag display-name which was causing the grief, also I changed the namespace from _http://java.sun.com/xml/ns/j2ee to _http://java.sun.com/xml/ns/javaee
eg: