修改web.xml導致應用在WEBLOGIC上不能發布,即使發布成功,也不能啟動
Posted on 2011-03-18 19:06 winderain 閱讀(2529) 評論(0) 編輯 收藏 所屬分類: JAVA 、WEB同事在Weblogic上發布應用,碰到如下錯誤:
1
java.lang.IllegalArgumentException: "tializeContext" is defined as injection target in descriptor file for class "com.ufida.hap.cxf.CXFServiceImpl",
2
but either field "tializeContext" or method "setTializeContext" cannot be found within the class.
3
at weblogic.j2ee.dd.xml.validator.injectiontarget.BaseValidator.error(BaseValidator.java:132)
4
at weblogic.j2ee.dd.xml.validator.injectiontarget.BaseValidator.checkUndefinedMethodField(BaseValidator.java:82)
5
at weblogic.j2ee.dd.xml.validator.AbstractAnnotationValidator.validate(AbstractAnnotationValidator.java:39)
6
at weblogic.j2ee.dd.xml.validator.AnnotationValidatorVisitor.visitInjectionTargetBean(AnnotationValidatorVisitor.java:48)
7
at weblogic.j2ee.dd.xml.validator.AnnotationValidatorVisitor.visit(AnnotationValidatorVisitor.java:25)
8
at weblogic.descriptor.internal.AbstractDescriptorBean.accept(AbstractDescriptorBean.java:1125)
9
at weblogic.descriptor.internal.AbstractDescriptorBean.accept(AbstractDescriptorBean.java:1129)
10
at weblogic.descriptor.internal.AbstractDescriptorBean.accept(AbstractDescriptorBean.java:1129)
11
at weblogic.j2ee.dd.xml.BaseJ2eeAnnotationProcessor.validate(BaseJ2eeAnnotationProcessor.java:144)
12
at weblogic.j2ee.dd.xml.BaseJ2eeAnnotationProcessor.validate(BaseJ2eeAnnotationProcessor.java:132)
13
at weblogic.servlet.internal.WebAnnotationProcessorImpl.processJ2eeAnnotations(WebAnnotationProcessorImpl.java:213)
14
at weblogic.servlet.internal.WebAnnotationProcessorImpl.processAnnotations(WebAnnotationProcessorImpl.java:105)
15
at weblogic.servlet.internal.WebAppServletContext.processAnnotations(WebAppServletContext.java:1359)
16
at weblogic.servlet.internal.WebAppServletContext.<init>(WebAppServletContext.java:440)
17
at weblogic.servlet.internal.WebAppServletContext.<init>(WebAppServletContext.java:484)
18
at weblogic.servlet.internal.HttpServer.loadWebApp(HttpServer.java:418)
19
at weblogic.servlet.internal.WebAppModule.registerWebApp(WebAppModule.java:976)
20
at weblogic.servlet.internal.WebAppModule.prepare(WebAppModule.java:381)
21
at weblogic.application.internal.flow.ScopedModuleDriver.prepare(ScopedModuleDriver.java:176)
22

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

查了很長時間,也不知所以然,看錯誤信息,是Spring注入錯誤,但是該CXFServiceImpl沒有問題啊,而且在tomcat下是沒有問題的,可以正常使用。
找了很久,對比了spring的配置文件,均沒有發現異常;最后同事說另外一個同事修改過web.xml;和可以運行的應用的web.xml對比,發現不能運行的web.xml中多了一些命名空間,刪除web-app后面的內容后,一切正常了!
總結:在weblogic上會校驗這些內容,而這些內容估計和spring的某些東西沖突。如果在weblogic下發布,刪除了吧
不能運行的web.xml具體如下
1
<?xml version="1.0" encoding="UTF-8"?>
2
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
3
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">

2

3

4
