Weblogic Jaxws deployment - class does not support JDK1.5

耗尽温柔 提交于 2021-01-28 11:06:56

问题


WebLogic Server Version: 10.3.6.0

Spring version: 3.2.1.RELEASE

Java JDK 1.6

I am trying to deploy a Spring application as WAR that uses jaxws into a Weblogic server. The application works well with Jetty. However when deploying(I mean starting deployed app) Weblogic following exception occurs:

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>

回答1:


It is being fixed by changing 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>

And in init servlet (if you use the old style) you should change the way you acquire the context as:

            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;
            }

That fixes it



来源:https://stackoverflow.com/questions/49235670/weblogic-jaxws-deployment-class-does-not-support-jdk1-5

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!