gpt4 book ai didi

java - Weblogic Spring WS部署类强制转换异常

转载 作者:太空宇宙 更新时间:2023-11-04 13:56:09 24 4
gpt4 key购买 nike

我正在使用 WebLogic Server:12.1.1.0、Spring 3.2.11.RELEASE 和 Camel 2.13.4。

我的weblogic.xml是:

 <?xml version="1.0" encoding="ISO-8859-1"?>
<weblogic-web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.bea.com/ns/weblogic/weblogic-web-app.xsd"
xmlns="http://www.bea.com/ns/weblogic/weblogic-web-app">
<container-descriptor>
<prefer-web-inf-classes>true</prefer-web-inf-classes>
</container-descriptor>
</weblogic-web-app>

部署时我得到以下堆栈跟踪:

[HTTP:101216]Servlet: "spring-ws" failed to preload on startup in Web application: "camelweblogic.war".
org.springframework.beans.factory.BeanCreationException: Invocation of init method failed;
nested exception is java.lang.ClassCastException: weblogic.xml.stax.XMLStreamInputFactory cannot be cast to javax.xml.stream.XMLInputFactory
at org.springframework.ws.support.DefaultStrategiesHelper.instantiateBean(DefaultStrategiesHelper.java:188)
at org.springframework.ws.support.DefaultStrategiesHelper.getDefaultStrategies(DefaultStrategiesHelper.java:134)
at org.springframework.ws.server.MessageDispatcher.initEndpointAdapters(MessageDispatcher.java:426)
at org.springframework.ws.server.MessageDispatcher.setApplicationContext(MessageDispatcher.java:156)

相关问题是:

最佳答案

正确的 weblogic.xml 是:

<?xml version="1.0" encoding="ISO-8859-1"?>
<weblogic-web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.bea.com/ns/weblogic/weblogic-web-app.xsd"
xmlns="http://www.bea.com/ns/weblogic/weblogic-web-app">
<container-descriptor>
<prefer-web-inf-classes>false</prefer-web-inf-classes>

<prefer-application-resources>

<resource-name>META-INF/services/com.sun.xml.ws.spi.db.BindingContextFactory
</resource-name>

<resource-name>META-INF/services/javax.xml.bind.JAXBContext
</resource-name>
</prefer-application-resources>
</container-descriptor>
</weblogic-web-app>

在所有 Camel 依赖项中排除 slf4j 和 jaxb-impl。例如:

    <dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-spring-ws</artifactId>
<version>2.13.4</version>
<exclusions>
<exclusion>
<artifactId>slf4j-api</artifactId>
<groupId>org.slf4j</groupId>
</exclusion>
<exclusion>
<artifactId>jaxb-impl</artifactId>
<groupId>com.sun.xml.bind</groupId>
</exclusion>
</exclusions>
</dependency>

关于java - Weblogic Spring WS部署类强制转换异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29796096/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com