9 Replies Latest reply on May 20, 2011 4:27 AM by ffang

    cxfbc consumer secure

    fsalceda

      Using Fuse ESB 4.3. Trying to configure my WSS4j Interceptor in a cxfbc consumer bean.xml:

       

      When I install de bundle:

       

       

      19:01:21,220 | INFO  | Thread-38        | ultOsgiApplicationContextCreator | ultOsgiApplicationContextCreator   67 | 76 - org.springframework.osgi.extender - 1.2.0 | Discovered configurations in bundle

      19:01:21,236 | INFO  | tenderThread-109 | OsgiBundleXmlApplicationContext  | pport.AbstractApplicationContext  456 | 65 - org.springframework.context - 3.0.3.RELEASE | Refreshing OsgiBundleXmlApplicationContext(bundle=PielStreetDirectory-Secure-Consumer-1.0.0, config=osgibundle:/META-INF/spring/*.xml): startup date ; root of context hierarchy

      19:01:21,236 | INFO  | tenderThread-109 | OsgiBundleXmlApplicationContext  | ractOsgiBundleApplicationContext  359 | 65 - org.springframework.context - 3.0.3.RELEASE | Unpublishing application context OSGi service for bundle PielStreetDirectory-Secure-Consumer-1.0.0 (PielStreetDirectory-Secure-Consumer-1.0.0)

      19:01:21,236 | INFO  | tenderThread-109 | XmlBeanDefinitionReader          | tory.xml.XmlBeanDefinitionReader  315 | 63 - org.springframework.beans - 3.0.3.RELEASE | Loading XML bean definitions from URL bundleentry://365.fwk927449563/META-INF/spring/beans.xml

      19:01:21,308 | INFO  | tenderThread-109 | XmlBeanDefinitionReader          | tory.xml.XmlBeanDefinitionReader  315 | 63 - org.springframework.beans - 3.0.3.RELEASE | Loading XML bean definitions from OSGi resource[classpath:META-INF/cxf/cxf.xml|bnd.id=365|bnd.sym=PielStreetDirectory-Secure-Consumer-1.0.0]

      19:01:21,348 | INFO  | tenderThread-109 | XmlBeanDefinitionReader          | tory.xml.XmlBeanDefinitionReader  315 | 63 - org.springframework.beans - 3.0.3.RELEASE | Loading XML bean definitions from OSGi resource[classpath:META-INF/cxf/cxf-extension-soap.xml|bnd.id=365|bnd.sym=PielStreetDirectory-Secure-Consumer-1.0.0]

      19:01:21,372 | INFO  | tenderThread-109 | XmlBeanDefinitionReader          | tory.xml.XmlBeanDefinitionReader  315 | 63 - org.springframework.beans - 3.0.3.RELEASE | Loading XML bean definitions from OSGi resource[classpath:META-INF/cxf/cxf-extension-http.xml|bnd.id=365|bnd.sym=PielStreetDirectory-Secure-Consumer-1.0.0]

      19:01:21,396 | INFO  | tenderThread-109 | XmlBeanDefinitionReader          | tory.xml.XmlBeanDefinitionReader  315 | 63 - org.springframework.beans - 3.0.3.RELEASE | Loading XML bean definitions from OSGi resource[classpath:META-INF/cxf/osgi/cxf-extension-osgi.xml|bnd.id=365|bnd.sym=PielStreetDirectory-Secure-Consumer-1.0.0]

      19:01:21,452 | INFO  | tenderThread-109 | WaiterApplicationContextExecutor | WaiterApplicationContextExecutor  252 | 76 - org.springframework.osgi.extender - 1.2.0 | No outstanding OSGi service dependencies, completing initialization for OsgiBundleXmlApplicationContext(bundle=PielStreetDirectory-Secure-Consumer-1.0.0, config=osgibundle:/META-INF/spring/*.xml)

      19:01:21,468 | INFO  | tenderThread-110 | DefaultListableBeanFactory       | pport.DefaultListableBeanFactory  549 | 63 - org.springframework.beans - 3.0.3.RELEASE | Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@203f85c7: defining beans ; root of factory hierarchy

      19:01:21,500 | INFO  | tenderThread-110 | OsgiServiceProxyFactoryBean      | al.aop.ServiceDynamicInterceptor  470 | 75 - org.springframework.osgi.core - 1.2.0 | Looking for mandatory OSGi service dependency for bean matching filter (objectClass=org.apache.cxf.transport.http_osgi.OsgiDestinationRegistryIntf)

      19:01:21,504 | INFO  | tenderThread-110 | OsgiServiceProxyFactoryBean      | al.aop.ServiceDynamicInterceptor  476 | 75 - org.springframework.osgi.core - 1.2.0 | Found mandatory OSGi service for bean

      19:01:21,596 | ERROR | tenderThread-110 | tServiceReferenceRecipe$Listener | tServiceReferenceRecipe$Listener  556 | 7 - org.apache.aries.blueprint - 0.2.0.incubating | Error calling listener method public void org.apache.servicemix.common.osgi.EndpointTracker.register(org.apache.servicemix.common.osgi.EndpointWrapper,java.util.Map) throws java.lang.Exception

      java.lang.reflect.InvocationTargetException

           at sun.reflect.GeneratedMethodAccessor37.invoke(Unknown Source)

           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)[:1.6.0_20]

           at java.lang.reflect.Method.invoke(Method.java:597)[:1.6.0_20]

           at org.apache.aries.blueprint.utils.ReflectionUtils.invoke(ReflectionUtils.java:221)[7:org.apache.aries.blueprint:0.2.0.incubating]

           at org.apache.aries.blueprint.container.AbstractServiceReferenceRecipe$Listener.invokeMethods(AbstractServiceReferenceRecipe.java:553)[7:org.apache.aries.blueprint:0.2.0.incubating]

           at org.apache.aries.blueprint.container.AbstractServiceReferenceRecipe$Listener.bind(AbstractServiceReferenceRecipe.java:518)[7:org.apache.aries.blueprint:0.2.0.incubating]

           at org.apache.aries.blueprint.container.AbstractServiceReferenceRecipe.bind(AbstractServiceReferenceRecipe.java:415)[7:org.apache.aries.blueprint:0.2.0.incubating]

           at org.apache.aries.blueprint.container.ReferenceListRecipe.track(ReferenceListRecipe.java:135)[7:org.apache.aries.blueprint:0.2.0.incubating]

           at org.apache.aries.blueprint.container.AbstractServiceReferenceRecipe.serviceAdded(AbstractServiceReferenceRecipe.java:365)[7:org.apache.aries.blueprint:0.2.0.incubating]

           at org.apache.aries.blueprint.container.AbstractServiceReferenceRecipe.serviceChanged(AbstractServiceReferenceRecipe.java:349)[7:org.apache.aries.blueprint:0.2.0.incubating]

           at org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:104)[osgi-3.6.0.v20100517.jar:]

           at org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent(BundleContextImpl.java:933)[osgi-3.6.0.v20100517.jar:]

           at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:227)[osgi-3.6.0.v20100517.jar:]

           at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:149)[osgi-3.6.0.v20100517.jar:]

           at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:756)[osgi-3.6.0.v20100517.jar:]

           at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:711)[osgi-3.6.0.v20100517.jar:]

           at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.register(ServiceRegistrationImpl.java:130)[osgi-3.6.0.v20100517.jar:]

           at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:206)[osgi-3.6.0.v20100517.jar:]

           at org.eclipse.osgi.framework.internal.core.BundleContextImpl.registerService(BundleContextImpl.java:507)[osgi-3.6.0.v20100517.jar:]

           at org.eclipse.osgi.framework.internal.core.BundleContextImpl.registerService(BundleContextImpl.java:525)[osgi-3.6.0.v20100517.jar:]

           at org.apache.servicemix.common.osgi.EndpointExporter.deploy(EndpointExporter.java:121)[94:servicemix-common:2010.02.0.fuse-02-00]

           at org.apache.servicemix.common.osgi.EndpointExporter.afterPropertiesSet(EndpointExporter.java:174)[94:servicemix-common:2010.02.0.fuse-02-00]

           at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1469)[63:org.springframework.beans:3.0.3.RELEASE]

           at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1409)[63:org.springframework.beans:3.0.3.RELEASE]

           at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)[63:org.springframework.beans:3.0.3.RELEASE]

           at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)[63:org.springframework.beans:3.0.3.RELEASE]

           at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)[63:org.springframework.beans:3.0.3.RELEASE]

           at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)[63:org.springframework.beans:3.0.3.RELEASE]

           at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)[63:org.springframework.beans:3.0.3.RELEASE]

           at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)[63:org.springframework.beans:3.0.3.RELEASE]

           at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:574)[63:org.springframework.beans:3.0.3.RELEASE]

           at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)[65:org.springframework.context:3.0.3.RELEASE]

           at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.access$1600(AbstractDelegatedExecutionApplicationContext.java:69)[75:org.springframework.osgi.core:1.2.0]

           at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:355)[75:org.springframework.osgi.core:1.2.0]

           at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)[75:org.springframework.osgi.core:1.2.0]

           at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:320)[75:org.springframework.osgi.core:1.2.0]

           at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:136)[76:org.springframework.osgi.extender:1.2.0]

           at java.lang.Thread.run(Thread.java:619)[:1.6.0_20]

      Caused by: javax.jbi.management.DeploymentException: java.io.IOException: Protocol mismatch for port 9091: engine's protocol is http, the url protocol is https

           at org.apache.servicemix.cxfbc.CxfBcConsumer.validate(CxfBcConsumer.java:561)

           at org.apache.servicemix.common.osgi.EndpointTracker$OsgiServiceUnit.(ServerImpl.java:60)

           at org.apache.servicemix.cxfbc.CxfBcConsumer.validate(CxfBcConsumer.java:556)

           ... 40 more

      19:01:21,644 | INFO  | tenderThread-110 | EndpointExporter                 | mix.common.osgi.EndpointExporter  125 | 94 - servicemix-common - 2010.02.0.fuse-02-00 | Waiting for all endpoints to be deployed before registering service assembly

      19:01:21,644 | INFO  | tenderThread-110 | OsgiBundleXmlApplicationContext  | ractOsgiBundleApplicationContext  327 | 65 - org.springframework.context - 3.0.3.RELEASE | Publishing application context as OSGi service with properties {org.springframework.context.service.name=PielStreetDirectory-Secure-Consumer-1.0.0, Bundle-SymbolicName=PielStreetDirectory-Secure-Consumer-1.0.0, Bundle-Version=1.0.0}

      19:01:21,644 | INFO  | tenderThread-110 | ContextLoaderListener            | BundleApplicationContextListener   45 | 76 - org.springframework.osgi.extender - 1.2.0 | Application context successfully refreshed (OsgiBundleXmlApplicationContext(bundle=PielStreetDirectory-Secure-Consumer-1.0.0, config=osgibundle:/META-INF/spring/*.xml))

       

       

       

      Any help would be very appreciated.

       

      Thx.

       

      Edited by: fsalceda on May 5, 2011 6:58 PM

        • 1. Re: cxfbc consumer secure
          ffang

          Hi,

           

          Firstly, you need remove

           

           

          And do you intend to use https transport? If so, you need configure the port(9091 for your case) with keyManagers/TrustManagers, etc.

           

          You may need take a look at , the cxfbc:consumer part, and also the imported file[2] which specify https for the providedBus.

          https://svn.apache.org/repos/asf/servicemix/components/trunk/bindings/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/ws/security/xbean-https.xml

           

          https://svn.apache.org/repos/asf/servicemix/components/trunk/bindings/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/ws/security/provider/CherryServer.xml

           

          Freeman

          • 2. Re: cxfbc consumer secure
            fsalceda

            Yes I would like to set https transport (SSL) and  ws-security with UsernameToken Timestamp Sign and Encrypt ina cxf consumer endpoint to route incoming message to another endpoint. If it will not be possible  with servicemix-cxf-bc consumer, is there any other way to do that?

            • 3. Re: cxfbc consumer secure
              ffang

              Hi,

               

              Yeah, it's possible.

              You just need read my previous answer.

               

              Freeman

              • 4. Re: cxfbc consumer secure
                fsalceda

                Thx a lot, I made "mutual authentication" work in my cxfbc consumer with those examples you meant! Now, I also want to use WS-Security...

                 

                https://svn.apache.org/repos/asf/servicemix/components/trunk/bindings/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/ws/security/xbean.xml

                 

                Is this example[1] the right way to do that??

                • 5. Re: cxfbc consumer secure
                  ffang

                  Hi,

                   

                  Yeah, more specifically the cxf bc consumer configuration part, it use WSS4J interceptor and SAAJ interceptor, which handle the ws-security stuff.

                   

                  This example use action like "Timestamp Signature Encrypt", if you want to use UsernameToken action, you can take it as an template and change it accordingly.

                   

                  Freeman

                  • 6. Re: cxfbc consumer secure
                    fsalceda

                    Exception when I try to install my cxfbc-consumer ws-security example. I reduced (removing security stuff) the xbean.xml file to:

                     

                    -


                    <?xml version="1.0" encoding="UTF-8"?>

                     

                    <beans xmlns="http://www.springframework.org/schema/beans"

                    xmlns:cxfbc="http://servicemix.apache.org/cxfbc/1.0"

                    xmlns:streetdirectory="http://streetdirectory.piel.andago.com"

                    xmlns:cxf="http://cxf.apache.org/core" xmlns:policy="http://cxf.apache.org/policy"

                    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soap="http://cxf.apache.org/bindings/soap"

                    xmlns:ctx="http://www.springframework.org/schema/context" xmlns:osgix="http://www.springframework.org/schema/osgi-compendium"

                    xmlns:util="http://www.springframework.org/schema/util"

                    xsi:schemaLocation="http://www.springframework.org/schema/beans

                    http://www.springframework.org/schema/beans/spring-beans-2.0.xsd

                    http://servicemix.apache.org/cxfbc/1.0

                    http://servicemix.apache.org/cxfbc/1.0/servicemix-cxf-bc.xsd

                    http://www.springframework.org/schema/osgi-compendium

                    http://www.springframework.org/schema/osgi-compendium/spring-osgi-compendium.xsd 

                    http://www.springframework.org/schema/context

                    http://www.springframework.org/schema/context/spring-context-3.0.xsd

                    http://www.springframework.org/schema/util

                    http://www.springframework.org/schema/util/spring-util.xsd

                    http://cxf.apache.org/core

                    http://cxf.apache.org/schemas/core.xsd

                    http://cxf.apache.org/policy

                    http://cxf.apache.org/schemas/policy.xsd

                    http://cxf.apache.org/bindings/soap

                    http://cxf.apache.org/schemas/configuration/soap.xsd

                    http://cxf.apache.org/configuration/security

                    http://cxf.apache.org/schemas/configuration/security.xsd

                    http://cxf.apache.org/transports/http/configuration

                    http://cxf.apache.org/schemas/configuration/http-conf.xsd">

                     

                    <import resource="classpath:META-INF/cxf/cxf.xml" />

                    <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />

                    <import resource="classpath:META-INF/cxf/cxf-extension-http.xml" />

                    <import resource="classpath:META-INF/cxf/cxf-extension-http-jetty.xml" />

                     

                    <cxfbc:consumer wsdl="classpath:wsdl/PielStreetDirectory.wsdl"

                    targetService="streetdirectory:Router" targetEndpoint="RouterEndpoint"

                    locationURI="https://piel2-devel:9091/PielStreetDirectoryServicePort"

                    useJBIWrapper="false" useSOAPEnvelope="true">

                    <cxfbc:inInterceptors>

                    <bean class="org.apache.cxf.interceptor.LoggingInInterceptor" />

                    </cxfbc:inInterceptors>

                     

                    <cxfbc:outInterceptors>

                    <bean class="org.apache.cxf.interceptor.LoggingOutInterceptor" />

                    </cxfbc:outInterceptors>

                     

                     

                     

                    <cxfbc:inFaultInterceptors>

                    <bean class="org.apache.cxf.interceptor.LoggingInInterceptor" />

                    </cxfbc:inFaultInterceptors>

                     

                     

                     

                    <cxfbc:outFaultInterceptors>

                    <bean class="org.apache.cxf.interceptor.LoggingOutInterceptor" />

                    </cxfbc:outFaultInterceptors>

                    </cxfbc:consumer>

                     

                    <bean class="org.apache.servicemix.common.osgi.EndpointExporter" />

                     

                    </beans>

                     

                     

                     

                     

                     

                    -


                     

                    And I got the same exception fault:

                     

                    -


                    13:08:07,411 | INFO  | Thread-33        | ultOsgiApplicationContextCreator | ultOsgiApplicationContextCreator   67 | 76 - org.springframework.osgi.extender - 1.2.0 | Discovered configurations in bundle http://PielStreetDirectory-Secure2-Consumer-1.0.0 (PielStreetDirectory-Secure2-Consumer-1.0.0)

                    13:08:07,411 | INFO  | xtenderThread-46 | OsgiBundleXmlApplicationContext  | pport.AbstractApplicationContext  456 | 65 - org.springframework.context - 3.0.3.RELEASE | Refreshing OsgiBundleXmlApplicationContext(bundle=PielStreetDirectory-Secure2-Consumer-1.0.0, config=osgibundle:/META-INF/spring/*.xml): startup date Tue May 17 13:08:07 CEST 2011; root of context hierarchy

                    13:08:07,411 | INFO  | xtenderThread-46 | OsgiBundleXmlApplicationContext  | ractOsgiBundleApplicationContext  359 | 65 - org.springframework.context - 3.0.3.RELEASE | Unpublishing application context OSGi service for bundle PielStreetDirectory-Secure2-Consumer-1.0.0 (PielStreetDirectory-Secure2-Consumer-1.0.0)

                    13:08:07,411 | INFO  | xtenderThread-46 | XmlBeanDefinitionReader          | tory.xml.XmlBeanDefinitionReader  315 | 63 - org.springframework.beans - 3.0.3.RELEASE | Loading XML bean definitions from URL bundleentry://198.fwk2022356744/META-INF/spring/beans.xml

                    13:08:07,423 | ERROR | xtenderThread-46 | ContextLoaderListener            | BundleApplicationContextListener   50 | 76 - org.springframework.osgi.extender - 1.2.0 | Application context refresh failed (OsgiBundleXmlApplicationContext(bundle=PielStreetDirectory-Secure2-Consumer-1.0.0, config=osgibundle:/META-INF/spring/*.xml))

                    org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 48 in XML document from URL bundleentry://198.fwk2022356744/META-INF/spring/beans.xml is invalid; nested exception is org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'cxfbc:inFaultInterceptors'. One of '{"http://servicemix.apache.org/cxfbc/1.0":properties, "http://servicemix.apache.org/cxfbc/1.0":providedBus, "http://servicemix.apache.org/cxfbc/1.0":serviceUnit, WC}' is expected.

                    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:396)63:org.springframework.beans:3.0.3.RELEASE

                    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)63:org.springframework.beans:3.0.3.RELEASE

                    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)63:org.springframework.beans:3.0.3.RELEASE

                    at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)63:org.springframework.beans:3.0.3.RELEASE

                    at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)63:org.springframework.beans:3.0.3.RELEASE

                    at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)63:org.springframework.beans:3.0.3.RELEASE

                    at org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext.loadBeanDefinitions(OsgiBundleXmlApplicationContext.java:176)75:org.springframework.osgi.core:1.2.0

                    at org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext.loadBeanDefinitions(OsgiBundleXmlApplicationContext.java:142)75:org.springframework.osgi.core:1.2.0

                    at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)65:org.springframework.context:3.0.3.RELEASE

                    at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:467)65:org.springframework.context:3.0.3.RELEASE

                    at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.access$800(AbstractDelegatedExecutionApplicationContext.java:69)75:org.springframework.osgi.core:1.2.0

                    at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$3.run(AbstractDelegatedExecutionApplicationContext.java:269)75:org.springframework.osgi.core:1.2.0

                    at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)75:org.springframework.osgi.core:1.2.0

                    at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.startRefresh(AbstractDelegatedExecutionApplicationContext.java:247)75:org.springframework.osgi.core:1.2.0

                    at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.stageOne(DependencyWaiterApplicationContextExecutor.java:222)76:org.springframework.osgi.extender:1.2.0

                    at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.refresh(DependencyWaiterApplicationContextExecutor.java:175)76:org.springframework.osgi.extender:1.2.0

                    at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.refresh(AbstractDelegatedExecutionApplicationContext.java:175)75:org.springframework.osgi.core:1.2.0

                    at org.springframework.osgi.extender.internal.activator.ContextLoaderListener$2.run(ContextLoaderListener.java:718)76:org.springframework.osgi.extender:1.2.0

                    at java.lang.Thread.run(Thread.java:619):1.6.0_20

                    Caused by: org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'cxfbc:inFaultInterceptors'. One of '{"http://servicemix.apache.org/cxfbc/1.0":properties, "http://servicemix.apache.org/cxfbc/1.0":providedBus, "http://servicemix.apache.org/cxfbc/1.0":serviceUnit, WC}' is expected.

                    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:233)[:]

                    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:169)[:]

                    at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:420)[:]

                    at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:354)[:]

                    at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(XMLSchemaValidator.java:455)[:]

                    at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaError(XMLSchemaValidator.java:3220)[:]

                    at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:1844)[:]

                    at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:743)[:]

                    at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:414)[:]

                    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2769)[:]

                    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:662)[:]

                    at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:154)[:]

                    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:525)[:]

                    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:853)[:]

                    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:782)[:]

                    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:157)[:]

                    at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:273)[:]

                    at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:322)[:]

                    at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:75)63:org.springframework.beans:3.0.3.RELEASE

                    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:388)63:org.springframework.beans:3.0.3.RELEASE

                    ... 18 more

                    -


                    Perhaps I'm using any wrong schema?

                     

                    I think I'd used cxbc:intercerptors and It worked...

                     

                    Thx for help!

                     

                     

                     

                    • 7. Re: cxfbc consumer secure
                      ffang

                      Hi,

                       

                      The element under cxfbc consumer should be alphabetic order, it's required from high version spring(3.x IIRC).

                       

                      Freeman

                      • 8. Re: cxfbc consumer secure
                        fsalceda

                        Thx! Yeah it was, alphabetical order worked!!

                         

                        When I add UsernameToken to the WS-Security (Timestamp Signature Encrypt) example, I get the following exception:

                         

                        -


                        java.lang.RuntimeException: CryptoFactory: Cannot load properties: com/andago/piel/cxfbc/ws/security/alice.properties

                        at org.apache.ws.security.components.crypto.CryptoFactory.getProperties(CryptoFactory.java:264)128:org.apache.ws.security.wss4j:1.5.9

                        at org.apache.ws.security.components.crypto.CryptoFactory.getInstance(CryptoFactory.java:173)128:org.apache.ws.security.wss4j:1.5.9

                        at org.apache.cxf.ws.security.wss4j.AbstractWSS4JInterceptor.loadSignatureCrypto(AbstractWSS4JInterceptor.java:178)141:org.apache.cxf.bundle:2.2.11.fuse-00-00

                        at org.apache.ws.security.handler.WSHandler.decodeSignatureParameter2(WSHandler.java:1060)128:org.apache.ws.security.wss4j:1.5.9

                        at org.apache.ws.security.handler.WSHandler.doReceiverAction(WSHandler.java:273)128:org.apache.ws.security.wss4j:1.5.9

                        at org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.handleMessage(WSS4JInInterceptor.java:201)141:org.apache.cxf.bundle:2.2.11.fuse-00-00

                        at org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.handleMessage(WSS4JInInterceptor.java:78)141:org.apache.cxf.bundle:2.2.11.fuse-00-00

                        at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:243)141:org.apache.cxf.bundle:2.2.11.fuse-00-00

                        at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:111)141:org.apache.cxf.bundle:2.2.11.fuse-00-00

                        at org.apache.servicemix.cxfbc.CxfBcConsumer$JbiChainInitiationObserver.onMessage(CxfBcConsumer.java:734)143:servicemix-cxf-bc:2010.02.0.fuse-02-00

                        at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(JettyHTTPDestination.java:311)141:org.apache.cxf.bundle:2.2.11.fuse-00-00

                        at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:275)141:org.apache.cxf.bundle:2.2.11.fuse-00-00

                        at org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:70)141:org.apache.cxf.bundle:2.2.11.fuse-00-00

                        at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)104:org.apache.servicemix.bundles.jetty-bundle:6.1.26.1-fuse

                        at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)104:org.apache.servicemix.bundles.jetty-bundle:6.1.26.1-fuse

                        at org.mortbay.jetty.handler.HandlerList.handle(HandlerList.java:49)104:org.apache.servicemix.bundles.jetty-bundle:6.1.26.1-fuse

                        at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)104:org.apache.servicemix.bundles.jetty-bundle:6.1.26.1-fuse

                        at org.mortbay.jetty.Server.handle(Server.java:326)104:org.apache.servicemix.bundles.jetty-bundle:6.1.26.1-fuse

                        at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)104:org.apache.servicemix.bundles.jetty-bundle:6.1.26.1-fuse

                        at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:945)104:org.apache.servicemix.bundles.jetty-bundle:6.1.26.1-fuse

                        at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:843)104:org.apache.servicemix.bundles.jetty-bundle:6.1.26.1-fuse

                        at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)104:org.apache.servicemix.bundles.jetty-bundle:6.1.26.1-fuse

                        at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)104:org.apache.servicemix.bundles.jetty-bundle:6.1.26.1-fuse

                        at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)104:org.apache.servicemix.bundles.jetty-bundle:6.1.26.1-fuse

                        at org.mortbay.jetty.security.SslSocketConnector$SslConnection.run(SslSocketConnector.java:713)104:org.apache.servicemix.bundles.jetty-bundle:6.1.26.1-fuse

                        at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)104:org.apache.servicemix.bundles.jetty-bundle:6.1.26.1-fuse

                        Caused by: java.lang.NullPointerException

                        at org.apache.ws.security.components.crypto.CryptoFactory.getProperties(CryptoFactory.java:259)128:org.apache.ws.security.wss4j:1.5.9

                        ... 25 more

                        18:22:59,097 | INFO  | @qtp-674585977-0 | LoggingOutInterceptor            | ngOutInterceptor$LoggingCallback  215 |  -  -  | Outbound Message

                         

                        -


                        I found out that it could be because of http://fusesource.com/issues/browse/ESB-1245;jsessionid=32D3032E22A96AE71199FA47D2726CF4?page=com.atlassian.jira.plugin.system.issuetabpanels%3Aall-tabpanel (although Im using 4.3.0-fuse-03-00)

                        and the solution is to deploy the properties file in another bundle and import it from the original.

                         

                        Could I set the signature and encrypt properties instead of setting the signaturePropFile? Per example:

                         

                        <entry key="org.apache.ws.security.crypto.provider"

                        value="org.apache.ws.security.components.crypto.Merlin" />

                        <entry key="org.apache.ws.security.crypto.merlin.keystore.type"

                        value="jks" />

                        ....

                        ....

                         

                        Instead of

                         

                        <entry key="org.apache.ws.security.crypto.provider"

                        value="org.apache.ws.security.components.crypto.Merlin" />

                         

                        Or how could I set he properties in a file outside the bundle (not in classpath), in fuse/etc folder or other location.

                         

                         

                         

                        • 9. Re: cxfbc consumer secure
                          ffang

                          Hi,

                           

                          Using fragment bundle as described in ESB-1245[1] is general solution for now, put the properties file into etc folder doesn't work.

                           

                          http://fusesource.com/issues/browse/ESB-1245

                           

                          Freeman