Weblogic Jaxws部署-类不支持JDK1.5 [英] Weblogic Jaxws deployment - class does not support JDK1.5
问题描述
WebLogic Server版本:10.3.6.0
WebLogic Server Version: 10.3.6.0
春季版本:3.2.1.发布
Spring version: 3.2.1.RELEASE
Java JDK 1.6
Java JDK 1.6
我正在尝试将使用jaxws的Spring应用程序部署为WAR,并将其部署到Weblogic服务器中. 该应用程序可与Jetty一起很好地工作.但是,在部署(我的意思是启动已部署的应用程序)Weblogic时,会发生以下异常:
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
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.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进行了修复
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>
在初始化servlet(如果使用旧样式)中,您应该将获取上下文的方式更改为:
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;
}
可以解决
这篇关于Weblogic Jaxws部署-类不支持JDK1.5的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!