Hi Brijesh

Did you put the basic_auth.xml in your SU classpath (for example in the maven src/main/resources directory) ? Be careful, the spring classpath resource that you have defined looking for the basic_auth.xml file relatively to the caller. Try to use an absolute classpath:
classpath:/basic_auth.xml
or using regexp:
classpath:**/*/basic_auth.xml

Regards
JB

brijesh wrote:
JB,

thanks for the input , I am getting the error as follows
<loc-message>java.lang.RuntimeException:
org.springframework.context.ApplicationContextException: Failed to load
configuration classpath:basic_auth.xml</loc
<stack-trace><![CDATA[javax.jbi.management.DeploymentException:
java.lang.RuntimeException:
org.springframework.context.ApplicationContextException: Failed
        at
org.apache.servicemix.cxfbc.CxfBcConsumer.validate(CxfBcConsumer.java:519)
        at
org.apache.servicemix.common.AbstractDeployer.validate(AbstractDeployer.java:58)
        at
org.apache.servicemix.common.xbean.BaseXBeanDeployer.validate(BaseXBeanDeployer.java:55)
        at
org.apache.servicemix.common.xbean.AbstractXBeanDeployer.deploy(AbstractXBeanDeployer.java:97)
        at
org.apache.servicemix.common.BaseServiceUnitManager.doDeploy(BaseServiceUnitManager.java:88)
        at
org.apache.servicemix.common.BaseServiceUnitManager.deploy(BaseServiceUnitManager.java:69)
        at
org.apache.servicemix.jbi.framework.DeploymentService.deployServiceAssembly(DeploymentService.java:508)
        at
org.apache.servicemix.jbi.framework.DeploymentService.deploy(DeploymentService.java:206)
        at
org.apache.servicemix.jbi.framework.AdminCommandsService.deployServiceAssembly(AdminCommandsService.java:212)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at
org.apache.commons.beanutils.MethodUtils.invokeMethod(MethodUtils.java:252)
        at
org.apache.servicemix.jbi.management.BaseStandardMBean.invoke(BaseStandardMBean.java:323)
        at
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836)
        at
com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761)
        at
org.springframework.jmx.access.MBeanClientInterceptor.invokeOperation(MBeanClientInterceptor.java:371)
        at
org.springframework.jmx.access.MBeanClientInterceptor.invoke(MBeanClientInterceptor.java:302)
        at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166)
        at
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
        at $Proxy73.deployServiceAssembly(Unknown Source)
        at
org.apache.servicemix.web.controller.DeployServiceAssembly.onSubmit(DeployServiceAssembly.java:55)
        at
org.springframework.web.servlet.mvc.SimpleFormController.processFormSubmission(SimpleFormController.java:267)
        at
org.springframework.web.servlet.mvc.AbstractFormController.handleRequestInternal(AbstractFormController.java:250)
        at
org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
        at
org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
        at
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:857)
        at
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:792)
        at
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:475)
        at
org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:440)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
        at
weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
        at
weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
        at
weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
        at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
        at
weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
        at
org.apache.servicemix.web.filter.ApplicationContextFilter.doFilter(ApplicationContextFilter.java:81)
        at
weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
        at
com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:118)
        at
com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:52)
        at
weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
        at
weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
        at
weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
        at
weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3496)
        at
weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
        at weblogic.security.service.SecurityManager.runAs(Unknown Source)
        at
weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2180)
        at
weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2086)
        at
weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1406)
        at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
        at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
Caused by: java.lang.RuntimeException:
org.springframework.context.ApplicationContextException: Failed to load
configuration classpath:basic_auth.xml
        at
org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:96)
        at
org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:88)
        at
org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:64)
        at
org.apache.servicemix.cxfbc.CxfBcConsumer.getBus(CxfBcConsumer.java:576)
        at
org.apache.servicemix.cxfbc.CxfBcConsumer.retrieveWSDL(CxfBcConsumer.java:560)
        at
org.apache.servicemix.cxfbc.CxfBcConsumer.validate(CxfBcConsumer.java:397)
        ... 52 more
Caused by: org.springframework.context.ApplicationContextException: Failed
to load configuration classpath:basic_auth.xml
        at
org.apache.cxf.bus.spring.BusApplicationContext.getConfigResources(BusApplicationContext.java:151)
        at
org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:106)
        at
org.apache.cxf.bus.spring.BusApplicationContext.loadBeanDefinitions(BusApplicationContext.java:263)
        at
org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:101)
        at
org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:389)
        at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:324)
        at
org.apache.cxf.bus.spring.BusApplicationContext.<init>(BusApplicationContext.java:91)
        at
org.apache.cxf.bus.spring.SpringBusFactory.createApplicationContext(SpringBusFactory.java:110)
        at
org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:93)
        ... 57 more


Following is my xbean.
<beans xmlns="http://www.springframework.org/schema/beans";
        xmlns:cxfbc="http://servicemix.apache.org/cxfbc/1.0";
        xmlns:xsi="http://http://www.w3.org/2001/XMLSchema-instance";
        xmlns:bp="urn:awb:sapr3:external_bp"
        xmlns:invap="urn:awb:sapr3:external_ap"
        xmlns:invar="urn:awb:sapr3:external_ar"
        xmlns:invgl="urn:awb:sapr3:external_gl"
        xmlns:lstn="http://www.ekaplus.com/ListenerEvent/";
        xmlns:nte="http://www.ekaplus.com/NotifyEvent/";
        xmlns:syncnte="http://www.ekaplus.com/SyncNotifyEvent/";
        xsi:schemaLocation="http://servicemix.apache.org/cxfbc/1.0
http://servicemix.apache.org/schema/servicemix-cxfbc-3.2.2.xsd
       http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd";>

        <cxfbc:consumer wsdl="classpath:NotifyEvent.wsdl"
                targetService="nte:gatewayRouter" useJBIWrapper="false"
                useSOAPEnvelope="false" />
        <cxfbc:consumer wsdl="classpath:SyncNotifyEvent.wsdl"
                targetService="nte:gatewayRouter"
useJBIWrapper="false" busCfg="classpath:basic_auth.xml"
                useSOAPEnvelope="false" />
</beans>

basic_auth.xml as follows.

<beans xmlns="http://www.springframework.org/schema/beans";
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
        xmlns:sec="http://cxf.apache.org/configuration/security";
        xmlns:http="http://cxf.apache.org/transports/http/configuration";
        xmlns:jaxws="http://java.sun.com/xml/ns/jaxws";
        xmlns:sne="http://www.ekaplus.com/SyncNotifyEvent/";
        xsi:schemaLocation="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
          http://www.springframework.org/schema/beans
          http://www.springframework.org/schema/beans/spring-beans-2.0.xsd";>
        <http:conduit
                name="sne:SyncNotifyEventPort.http-conduit">
                <http:authorization>
                        <sec:UserName>brijesh</sec:UserName>
                        <sec:Password>abcd1234</sec:Password>
                </http:authorization>
        </http:conduit>
</beans>

wsdl as follows
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/";
        xmlns:tns="http://www.ekaplus.com/SyncNotifyEvent/";
        xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";
        xmlns:gnd="com.ekaplus.commons.document"
        xmlns:xsd="http://www.w3.org/2001/XMLSchema"; name="SyncNotifyEvent"
        targetNamespace="http://www.ekaplus.com/SyncNotifyEvent/";>
        <wsdl:types>
                <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema";
                        elementFormDefault="qualified"
                        targetNamespace="com.ekaplus.commons.document"
                        xmlns:ns1="com.ekaplus.commons.document">
                        <xs:element name="GenericDocument">
                                <xs:complexType>
                                        <xs:sequence>
                                                <xs:element 
maxOccurs="unbounded"
                                                        ref="ns1:PropertyData" 
/>
                                        </xs:sequence>
                                        <xs:attribute name="description" 
use="required"
                                                type="xs:string" />
                                        <xs:attribute name="name" use="required"
                                                type="xs:string" />
                                        <xs:attribute name="document_Id" 
use="required"
                                                type="xs:string" />
                                        <xs:attribute name="created_date" 
use="required"
                                                type="xs:string" />
                                </xs:complexType>
                        </xs:element>
                        <xs:element name="PropertyData">
                                <xs:complexType>
                                        <xs:sequence>
                                                <xs:element minOccurs="0" 
maxOccurs="unbounded"
                                                        ref="ns1:PropertyData" 
/>
                                        </xs:sequence>
                                        <xs:attribute name="pkey" type="xs:string" 
/>
                                        <xs:attribute name="pvalue" 
type="xs:string" />
                                </xs:complexType>
                        </xs:element>
                </xs:schema>

                <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema";
                        
targetNamespace="http://www.ekaplus.com/SyncNotifyEvent/";>
                        <xsd:element name="notifyEventResponse">
                                <xsd:complexType>
                                        <xsd:sequence>

                                                <xsd:element name="out" 
type="xsd:string"></xsd:element>
                                        </xsd:sequence>
                                </xsd:complexType>
                        </xsd:element>
                </xsd:schema>
        </wsdl:types>
        <wsdl:message name="notifyEventRequest">
                <wsdl:part element="gnd:GenericDocument" name="param_in" />
        </wsdl:message>
        <wsdl:message name="notifyEventResponse">
                <wsdl:part name="parameters" element="gnd:GenericDocument">
                </wsdl:part>
        </wsdl:message>

        <wsdl:portType name="SyncNotifyEventPortType">
                <wsdl:operation name="notifyEvent">
                        <wsdl:input message="tns:notifyEventRequest" />

                        <wsdl:output 
message="tns:notifyEventResponse"></wsdl:output>
                </wsdl:operation>
        </wsdl:portType>
        <wsdl:binding name="SyncNotifyEventBinding"
                type="tns:SyncNotifyEventPortType">
                <soap:binding style="document"
                        transport="http://schemas.xmlsoap.org/soap/http"; />
                <wsdl:operation name="notifyEvent">
                        <soap:operation
                                
soapAction="http://www.ekaplus.com/NotifyEvent/notifyEvent"; />
                        <wsdl:input>
                                <soap:body use="literal" />
                        </wsdl:input>
                        <wsdl:output>
                                <soap:body use="literal" />
                        </wsdl:output>
                </wsdl:operation>
        </wsdl:binding>
        <wsdl:service name="SyncNotifyEventService">
                <wsdl:port binding="tns:SyncNotifyEventBinding"
                        name="SyncNotifyEventPort">
                        <soap:address
                                
location="http://localhost:8098/SyncNotifyEventService"; />
                </wsdl:port>
        </wsdl:service>
</wsdl:definitions>







Jean-Baptiste Onofré wrote:
Hi Brijesh,

you need to define the busCfg on the CXF-BC component.

For example, you can use a xbean like this:

<cxfbc:consumer .... busCfg="basicAuth.xml"/>

where basicAuth.xml contains:

<?xml version="1.0" encoding="utf-8"?>
<beans xmlns="http://www.springframework.org/schema/beans";
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xmlns:sec="http://cxf.apache.org/configuration/security";
xmlns:http="http://cxf.apache.org/transports/http/configuration";
xmlns:jaxws="http://java.sun.com/xml/ns/jaxws";
xsi:schemaLocation="
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 http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
">
<http:conduit name="http-conduit">
<http:authorization>
<sec:UserName>user</sec:UserName>
<sec:Password>password</sec:Password>
</http:authorization>
</http:conduit>
</beans>

Regards
JB

brijesh wrote:
hello , I need to set http authentication for servicemix cxf-bc consumer. can anybody guide me on this?


Regards
Brijesh N K


Reply via email to