views:

128

answers:

1

I'm in the process of migrating a webservice application that worked perfectly on Weblogic 9 into Weblogic 10gR3. The small difficulty is that my application uses JAX-WS and on Weblogic 9 I had to include JAX-WS libraries in my WAR. But on WLS 10, those libraries are already integrated. To avoid conflicts, I put my WAR inside an EAR with the following weblogic-application.xml:

<?xml version="1.0" encoding="UTF-8"?>
<weblogic-application>
  <application-param>
    <param-name>webapp.encoding.default</param-name>
    <param-value>UTF-8</param-value>
  </application-param>
  <prefer-application-packages>
    <package-name>com.sun.xml.*</package-name>
    <package-name>javax.xml.bind.*</package-name>
    <package-name>javax.jws.*</package-name>
  </prefer-application-packages>
</weblogic-application>

Thanks to that, I don't have ClassCastExceptions anymore, but I have another exception:

javax.xml.soap.SOAPException: Unable to create SAAJ meta-factoryProvider com.sun.xml.internal.messaging.saaj.soap.SAAJMetaFactoryImpl not found
at javax.xml.soap.SAAJMetaFactory.getInstance(SAAJMetaFactory.java:85)
at javax.xml.soap.MessageFactory.newInstance(MessageFactory.java:148)
at com.sun.xml.ws.api.SOAPVersion.<init>(SOAPVersion.java:178)
at com.sun.xml.ws.api.SOAPVersion.<clinit>(SOAPVersion.java:83)
at com.sun.xml.ws.api.BindingID.<clinit>(BindingID.java:318)
at org.jvnet.jax_ws_commons.spring.SpringService.getObject(SpringService.java:294)
at org.jvnet.jax_ws_commons.spring.SpringService.getObject(SpringService.java:45)
at org.springframework.beans.factory.support.AbstractBeanFactory.getObjectFromFactoryBean(AbstractBeanFactory.java:1236)
at org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1207)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:262)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:261)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:109)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1099)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:861)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:421)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:156)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:287)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:244)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:187)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
at weblogic.servlet.internal.EventsManager$FireContextListenerAction.run(EventsManager.java:465)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(Unknown Source)
at weblogic.servlet.internal.EventsManager.notifyContextCreatedEvent(EventsManager.java:175)
at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1784)
at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:2999)
at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1371)

What's weird is that this SAAJMetaFactoryImpl class it says it cannot find is part of JDK 1.6.0_17 that is used by WLS10 on MACOSX 10.6 where it is installed.

Any idea what might cause this conflict?

A: 

From the docs, when you specify prefer-application-packages for com.sun.xml.* , those package are loaded from the application, not the system classloader.

ktaylorjohn