Custom Interceptor

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Custom Interceptor

yanherrera
Hi,

 I have writed a cxf InIntercepter which extends AbstractPhaseInterceptor class, and export in cxfInInterceptor.jar. And put this jar file into C:\apache-servicemix-3.3.1\lib
=======================================
public class CxfBCConsumerLogCollecter extends AbstractWSS4JInterceptor<Message> {

    public CxfBCConsumerLogCollecter() {
                super(Phase.RECEIVE);
    }

    public void handleMessage(Message message) {
        //business code
    }
}


This is the xbean SU
=======================================

<cxfbc:inInterceptors>
    <ref bean="platinoInterceptor"/>
    <ref bean="saajin"/>
   </cxfbc:inInterceptors>
   <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.cxf.binding.soap.saaj.SAAJInInterceptor" id="saajin"/>           
 
  <bean id="platinoInterceptor" class="org.apache.servicemix.cxfbc.interceptors.PlatinoInterceptor">
     <property name="properties">
       <map>
         <entry key="action" value="UsernameToken Signature"/>
         <entry key="passwordCallbackClass"   value="es.gobcan.platino.service.authentication.login.PlatinoCallbackHandler"/>
         <entry key="actor" value="http://www.gobiernodecanarias.org/Platino/Authentication/1.0"/>
         <entry key="signaturePropFile" value="server_sign.properties"></entry>
       </map>
     </property>
  </bean>


After build this maven project, I deployed in servicemix, and in servicemix console there is error log like this :
=======================================

 Class that bean class [es.gobcan.platino.interceptors.PlatinoInterceptor] depends on not found
Offending resource: file [/opt/jboss/servicemix-3.3.2/data/smx/service-assemblies/es.gobcan.prueba-sa/version_1/sus/servicemix-cxf-bc/es.gobcan.prueba-su/xbean.xml]
Bean 'platinoInterceptor'; nested exception is java.lang.NoClassDefFoundError: org/apache/cxf/ws/security/wss4j/AbstractWSS4JInterceptor
14:06:47,769 | INFO  | Timer-2    | temXmlApplicationContext | ort.AbstractApplicationContext  815 | Closing org.apache.xbean.spring.context.FileSystemXmlApplicationContext@71e001c8: display name [org.apache.xbean.spring.context.FileSystemXmlApplicationContext@71e001c8]; startup date [Wed Nov 03 14:06:47 WET 2010]; root of context hierarchy
14:06:47,772 | ERROR | Timer-2    | temXmlApplicationContext | ort.AbstractApplicationContext  822 | Exception thrown from ApplicationListener handling ContextClosedEvent
java.lang.IllegalStateException: ApplicationEventMulticaster not initialized - call 'refresh' before multicasting events via the context: org.apache.xbean.spring.context.FileSystemXmlApplicationContext@71e001c8: display name [org.apache.xbean.spring.context.FileSystemXmlApplicationContext@71e001c8]; startup date [Wed Nov 03 14:06:47 WET 2010]; root of context hierarchy
        at org.springframework.context.support.AbstractApplicationContext.getApplicationEventMulticaster(AbstractApplicationContext.java:287)
        at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:274)
        at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:819)
        at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:794)
        at org.springframework.context.support.AbstractApplicationContext.destroy(AbstractApplicationContext.java:782)
        at org.apache.servicemix.common.xbean.AbstractXBeanDeployer.deploy(AbstractXBeanDeployer.java:106)
        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:520)
        at org.apache.servicemix.jbi.framework.AutoDeploymentService.updateServiceAssembly(AutoDeploymentService.java:349)
        at org.apache.servicemix.jbi.framework.AutoDeploymentService.updateArchive(AutoDeploymentService.java:255)
        at org.apache.servicemix.jbi.framework.AutoDeploymentService.monitorDirectory(AutoDeploymentService.java:658)
        at org.apache.servicemix.jbi.framework.AutoDeploymentService.access$800(AutoDeploymentService.java:63)
        at org.apache.servicemix.jbi.framework.AutoDeploymentService$1.run(AutoDeploymentService.java:622)
        at java.util.TimerThread.mainLoop(Timer.java:512)
        at java.util.TimerThread.run(Timer.java:462)
14:06:47,774 | ERROR | Timer-2    | CxfBcComponent           | on.xbean.AbstractXBeanDeployer  108 | java.lang.IllegalStateException: BeanFactory not initialized or already closed - call 'refresh'before accessing beans via the ApplicationContext
14:06:47,860 | ERROR | Timer-2    | AutoDeploymentService    | ramework.AutoDeploymentService  363 | Failed to update Service Assembly: es.gobcan.prueba-sa
java.lang.Exception: <?xml version="1.0" encoding="UTF-8"?>

=======================================

why java.lang.NoClassDefFoundError, what can I do for the package cxfInInterceptor.jar? Have to add the AbstractWSS4JInterceptor class in the lib folder?