title: cxf soap client webservices deployed in weblogic 12c
body: <p>i have some problem with apache CXF client in version 3.0.3 deployed to weblogic server in version 12.2.1.2.2. Sometime after deploy get error </p>
  
  <pre><code> java.lang.RuntimeException: Invalid schema document passed to AbstractDataBinding.addSchemaDocument, not in W3C schema namespace: schema
      at org.apache.cxf.databinding.AbstractDataBinding.addSchemaDocument(AbstractDataBinding.java:110) ~[cxf-core-3.0.3.jar:3.0.3]
      at org.apache.cxf.databinding.AbstractDataBinding.addSchemaDocument(AbstractDataBinding.java:96) ~[cxf-core-3.0.3.jar:3.0.3]
      at org.apache.cxf.jaxb.JAXBDataBinding.initialize(JAXBDataBinding.java:386) ~[cxf-rt-databinding-jaxb-3.0.3.jar:3.0.3]
      at org.apache.cxf.service.factory.AbstractServiceFactoryBean.initializeDataBindings(AbstractServiceFactoryBean.java:86) ~[cxf-core-3.0.3.jar:3.0.3]
      at org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean.buildServiceFromClass(ReflectionServiceFactoryBean.java:467) ~[cxf-rt-wsdl-3.0.3.jar:3.0.3]
      at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.buildServiceFromClass(JaxWsServiceFactoryBean.java:704) ~[cxf-rt-frontend-jaxws-3.0.3.jar:3.0.3]
      at org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:527) ~[cxf-rt-wsdl-3.0.3.jar:3.0.3]
      at org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:261) ~[cxf-rt-wsdl-3.0.3.jar:3.0.3]
      at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:215) ~[cxf-rt-frontend-jaxws-3.0.3.jar:3.0.3]
      at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:102) ~[cxf-rt-frontend-simple-3.0.3.jar:3.0.3]
      at org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.java:91) ~[cxf-rt-frontend-simple-3.0.3.jar:3.0.3]
      at org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBean.java:157) ~[cxf-rt-frontend-simple-3.0.3.jar:3.0.3]
      at org.apache.cxf.jaxws.JaxWsProxyFactoryBean.create(JaxWsProxyFactoryBean.java:142) ~[cxf-rt-frontend-jaxws-3.0.3.jar:3.0.3]
      at sk.posam.risng.infrastructure.wsclient.WsClientFactory.create(WsClientFactory.java:38) [risng-infrastructure-client-1.0.7-SNAPSHOT.jar:1.0.7-SNAPSHOT]
      at sk.posam.risng.infrastructure.wsclient.WsClientFactory.create(WsClientFactory.java:59) [risng-infrastructure-client-1.0.7-SNAPSHOT.jar:1.0.7-SNAPSHOT]
      at sk.posam.risng.mur.reporty.config.WsClient.elurRozpocet(WsClient.java:103) [_wl_cls_gen.jar:na]
      at sk.posam.risng.mur.reporty.config.WsClient$$EnhancerBySpringCGLIB$$44f8f781.CGLIB$elurRozpocet$13(&lt;generated&gt;) [_wl_cls_gen.jar:na]
      at sk.posam.risng.mur.reporty.config.WsClient$$EnhancerBySpringCGLIB$$44f8f781$$FastClassBySpringCGLIB$$d1d3cd0c.invoke(&lt;generated&gt;) [_wl_cls_gen.jar:na]
      at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228) [spring-core-4.3.8.RELEASE.jar:4.3.8.RELEASE]
      at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:358) [spring-context-4.3.8.RELEASE.jar:4.3.8.RELEASE]
      at sk.posam.risng.mur.reporty.config.WsClient$$EnhancerBySpringCGLIB$$44f8f781.elurRozpocet(&lt;generated&gt;) [_wl_cls_gen.jar:na]
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_131]
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_131]
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_131]
      at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_131]
      at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162) [spring-beans-4.3.8.RELEASE.jar:4.3.8.RELEASE]
      at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588) [spring-beans-4.3.8.RELEASE.jar:4.3.8.RELEASE]
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1173) [spring-beans-4.3.8.RELEASE.jar:4.3.8.RELEASE]
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1067) [spring-beans-4.3.8.RELEASE.jar:4.3.8.RELEASE]
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513) [spring-beans-4.3.8.RELEASE.jar:4.3.8.RELEASE]
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483) [spring-beans-4.3.8.RELEASE.jar:4.3.8.RELEASE]
      at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) [spring-beans-4.3.8.RELEASE.jar:4.3.8.RELEASE]
      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) [spring-beans-4.3.8.RELEASE.jar:4.3.8.RELEASE]
      at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) [spring-beans-4.3.8.RELEASE.jar:4.3.8.RELEASE]
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) [spring-beans-4.3.8.RELEASE.jar:4.3.8.RELEASE]
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:761) [spring-beans-4.3.8.RELEASE.jar:4.3.8.RELEASE]
      at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:866) [spring-context-4.3.8.RELEASE.jar:4.3.8.RELEASE]
      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:542) [spring-context-4.3.8.RELEASE.jar:4.3.8.RELEASE]
      at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:443) [spring-web-4.3.8.RELEASE.jar:4.3.8.RELEASE]
      at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:325) [spring-web-4.3.8.RELEASE.jar:4.3.8.RELEASE]
      at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107) [spring-web-4.3.8.RELEASE.jar:4.3.8.RELEASE]
      at weblogic.servlet.internal.EventsManager$FireContextListenerAction.run(EventsManager.java:705) [com.oracle.weblogic.servlet.jar:12.2.1.2]
      at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:326) [com.oracle.weblogic.security.subject.jar:12.2.1.2]
      at weblogic.security.service.SecurityManager.runAsForUserCode(SecurityManager.java:197) [com.oracle.weblogic.security.subject.jar:12.2.1.2]
      at weblogic.servlet.provider.WlsSecurityProvider.runAsForUserCode(WlsSecurityProvider.java:203) [com.oracle.weblogic.servlet.jar:12.2.1.2]
      at weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:71) [com.oracle.weblogic.servlet.jar:12.2.1.2]
      at weblogic.servlet.internal.EventsManager.executeContextListener(EventsManager.java:251) [com.oracle.weblogic.servlet.jar:12.2.1.2]
      at weblogic.servlet.internal.EventsManager.notifyContextCreatedEvent(EventsManager.java:204) [com.oracle.weblogic.servlet.jar:12.2.1.2]
      at weblogic.servlet.internal.EventsManager.notifyContextCreatedEvent(EventsManager.java:189) [com.oracle.weblogic.servlet.jar:12.2.1.2]
      at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1911) [com.oracle.weblogic.servlet.jar:12.2.1.2]
      at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:3091) [com.oracle.weblogic.servlet.jar:12.2.1.2]
      at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1823) [com.oracle.weblogic.servlet.jar:12.2.1.2]
      at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:882) [com.oracle.weblogic.servlet.jar:12.2.1.2]
      at weblogic.application.internal.ExtensibleModuleWrapper$StartStateChange.next(ExtensibleModuleWrapper.java:360) [com.oracle.weblogic.application.jar:12.2.1.2]
      at weblogic.application.internal.ExtensibleModuleWrapper$StartStateChange.next(ExtensibleModuleWrapper.java:356) [com.oracle.weblogic.application.jar:12.2.1.2]
      at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:45) [com.oracle.weblogic.application.jar:12.2.1.2]
      at weblogic.application.internal.ExtensibleModuleWrapper.start(ExtensibleModuleWrapper.java:138) [com.oracle.weblogic.application.jar:12.2.1.2]
      at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:124) [com.oracle.weblogic.application.jar:12.2.1.2]
      at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:233) [com.oracle.weblogic.application.jar:12.2.1.2]
      at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:228) [com.oracle.weblogic.application.jar:12.2.1.2]
      at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:45) [com.oracle.weblogic.application.jar:12.2.1.2]
      at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:78) [com.oracle.weblogic.application.jar:12.2.1.2]
      at weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:52) [com.oracle.weblogic.application.jar:12.2.1.2]
      at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:750) [com.oracle.weblogic.application.jar:12.2.1.2]
      at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:45) [com.oracle.weblogic.application.jar:12.2.1.2]
      at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:260) [com.oracle.weblogic.application.jar:12.2.1.2]
      at weblogic.application.internal.SingleModuleDeployment.activate(SingleModuleDeployment.java:52) [com.oracle.weblogic.application.jar:12.2.1.2]
      at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:165) [com.oracle.weblogic.application.jar:12.2.1.2]
      at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:90) [com.oracle.weblogic.deploy.jar:12.2.1.2]
      at weblogic.deploy.internal.targetserver.operations.AbstractOperation.activate(AbstractOperation.java:627) [com.oracle.weblogic.deploy.jar:12.2.1.2]
      at weblogic.deploy.internal.targetserver.operations.ActivateOperation.activateDeployment(ActivateOperation.java:171) [com.oracle.weblogic.deploy.jar:12.2.1.2]
      at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doCommit(ActivateOperation.java:121) [com.oracle.weblogic.deploy.jar:12.2.1.2]
      at weblogic.deploy.internal.targetserver.operations.AbstractOperation.commit(AbstractOperation.java:347) [com.oracle.weblogic.deploy.jar:12.2.1.2]
      at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentCommit(DeploymentManager.java:901) [com.oracle.weblogic.deploy.jar:12.2.1.2]
      at weblogic.deploy.internal.targetserver.DeploymentManager.activateDeploymentList(DeploymentManager.java:1456) [com.oracle.weblogic.deploy.jar:12.2.1.2]
      at weblogic.deploy.internal.targetserver.DeploymentManager.handleCommit(DeploymentManager.java:456) [com.oracle.weblogic.deploy.jar:12.2.1.2]
      at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.commit(DeploymentServiceDispatcher.java:181) [com.oracle.weblogic.deploy.jar:12.2.1.2]
      at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doCommitCallback(DeploymentReceiverCallbackDeliverer.java:217) [com.oracle.weblogic.deploy.service.jar:12.2.1.2]
      at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$100(DeploymentReceiverCallbackDeliverer.java:14) [com.oracle.weblogic.deploy.service.jar:12.2.1.2]
      at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$2.run(DeploymentReceiverCallbackDeliverer.java:69) [com.oracle.weblogic.deploy.service.jar:12.2.1.2]
      at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:666) [com.bea.core.weblogic.workmanager.jar:12.2.1.2]
      at weblogic.invocation.ComponentInvocationContextManager._runAs(ComponentInvocationContextManager.java:348) [com.bea.core.utils.full.jar:12.2.1.2]
      at weblogic.invocation.ComponentInvocationContextManager.runAs(ComponentInvocationContextManager.java:333) [com.bea.core.utils.full.jar:12.2.1.2]
      at weblogic.work.LivePartitionUtility.doRunWorkUnderContext(LivePartitionUtility.java:54) [com.oracle.weblogic.work.jar:12.2.1.2]
      at weblogic.work.PartitionUtility.runWorkUnderContext(PartitionUtility.java:41) [com.bea.core.weblogic.workmanager.jar:12.2.1.2]
      at weblogic.work.SelfTuningWorkManagerImpl.runWorkUnderContext(SelfTuningWorkManagerImpl.java:640) [com.bea.core.weblogic.workmanager.jar:12.2.1.2]
      at weblogic.work.ExecuteThread.execute(ExecuteThread.java:406) [com.bea.core.weblogic.workmanager.jar:12.2.1.2]
      at weblogic.work.ExecuteThread.run(ExecuteThread.java:346) [com.bea.core.weblogic.workmanager.jar:12.2.1.2]
  </code></pre>
  
  <p>but after restart server with new artefakt everything is all right. Application runing CXF client successfuly inicialized and app can call some webservice. Apache CXF is added in artefact throught maven dependencies and builded war contains in lib folder. This <a href="http://cxf.547215.n5.nabble.com/Deployment-of-CXF-webservice-to-Weblogic-10-1-3-3-breaks-with-exception-Invalid-schema-document-passe-td4802521.html#none" rel="nofollow noreferrer">link</a> solves similar problem, but in my case doesn't work. My weblogic.xml </p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;weblogic-web-app
          xmlns="http://www.bea.com/ns/weblogic/90"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="
          http://www.bea.com/ns/weblogic/90
          http://www.bea.com/ns/weblogic/90/weblogic-web-app.xsd"&gt;
  
      &lt;context-root&gt;/ws&lt;/context-root&gt;
      &lt;container-descriptor&gt;
          &lt;prefer-web-inf-classes&gt;true&lt;/prefer-web-inf-classes&gt;
          &lt;show-archived-real-path-enabled&gt;true&lt;/show-archived-real-path-enabled&gt;
      &lt;/container-descriptor&gt;
  &lt;/weblogic-web-app&gt;
  </code></pre>
  
  <p>There is configured property prefer-web-inf-classes.</p>
  
  <p>This is creation my cxf webservice client</p>
  
  <pre><code>public &lt;T&gt; T create(Class&lt;T&gt; serviceClass, String url, long connectionTimeout, long receiveTimeout) {
      try {
          LOGGER.debug("creating ws service client on url {}", url);
          Bus bus = BusFactory.getDefaultBus();
          JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
          factory.setServiceClass(serviceClass);
          factory.setAddress(url);
          factory.setBus(bus);
          T runtimeService = (T) factory.create();
          Client client = ClientProxy.getClient(runtimeService);
          HTTPConduit conduit = (HTTPConduit) client.getConduit();
          HTTPClientPolicy policy = new HTTPClientPolicy();
          policy.setConnectionTimeout(connectionTimeout);
          policy.setReceiveTimeout(receiveTimeout);
          conduit.setClient(policy);
          client.getOutInterceptors().add(new CorrelationIdOutInterceptor());
          client.getInInterceptors().add(new NullToEmptyListClientInInterceptor());
          return runtimeService;
      } catch (Exception e) {
          LOGGER.error("Unable to reach webservice " + url, e);
          return null;
      }
  }
  </code></pre>
  
  <p>Thanks for your help.</p>