Weblogic Jaxws 部署 - class 不支持 JDK1.5

Weblogic Jaxws deployment - class does not support JDK1.5

WebLogic 服务器版本:10.3.6.0

Spring版本:3.2.1.RELEASE

Java JDK 1.6

我正在尝试将 Spring 应用程序部署为 WAR,它使用 jaxws 到 Weblogic 服务器中。 该应用程序适用于 Jetty。但是在部署时(我的意思是开始部署的应用程序)Weblogic 发生以下异常:

Caused By: java.lang.UnsupportedOperationException: This class does not support JDK1.5
        at weblogic.xml.jaxp.RegistryTransformerFactory.setFeature(RegistryTransformerFactory.java:317)
        at com.sun.xml.ws.util.xml.XmlUtil.newTransformerFactory(XmlUtil.java:392)
        at com.sun.xml.ws.util.xml.XmlUtil.newTransformerFactory(XmlUtil.java:400)
        at com.sun.xml.ws.util.xml.XmlUtil.<clinit>(XmlUtil.java:233)
        at org.jvnet.jax_ws_commons.spring.SpringService.getObject(SpringService.java:36

.

maven pom.xml

<dependency>
    <groupId>com.sun.xml.ws</groupId>
    <artifactId>jaxws-rt</artifactId>
    <version>2.2.10</version>
    </dependency>
<dependency>
<groupId>org.jvnet.jax-ws-commons.spring</groupId>
    <artifactId>jaxws-spring</artifactId>
    <version>1.9</version>
</dependency>

Weblogic.xml

<weblogic-web-app>
<context-root>/MyApp</context-root>
  <container-descriptor>
    <prefer-web-inf-classes>true</prefer-web-inf-classes>
    <show-archived-real-path-enabled>true</show-archived-real-path-enabled>  
  </container-descriptor>
</weblogic-web-app>

正在通过更改 weblogic.xml

修复
 <container-descriptor>
    <prefer-web-inf-classes>false</prefer-web-inf-classes>
    <show-archived-real-path-enabled>true</show-archived-real-path-enabled>
    <prefer-application-packages>
        <package-name>com.sun.xml.ws.server.*</package-name>
    </prefer-application-packages>
  </container-descriptor>

并且在 init servlet 中(如果您使用旧样式)您应该将获取上下文的方式更改为:

            private static WebApplicationContext context;

            @Override
            public void contextInitialized(ServletContextEvent sce) {

                ServletContext sc = sce.getServletContext(); 
                this.context = WebApplicationContextUtils.getWebApplicationContext(sc);  

                ...
            }

            public static WebApplicationContext getApplicationContext(){
                return context;
            }

那就解决了