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

问题描述 投票:1回答:1

WebLogic Server版本:10.3.6.0

春季版: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

.

Mavel pom.hml

<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 jax-ws
1个回答
0
投票

通过更改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;
            }

这解决了它

© www.soinside.com 2019 - 2024. All rights reserved.