axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Abdelrahman Almahmoud <fire_storm5...@hotmail.com>
Subject RE: Deploying a handler
Date Fri, 14 Jun 2013 21:24:56 GMT
I am getting the following error when starting axis2
[ERROR] The sample04.aar service, which is not valid, caused Did not find the desired phase
'TestPhase' while deploying handler 'InFlowLogHandler'.org.apache.axis2.phaseresolver.PhaseException:
Did not find the desired phase 'TestPhase' while deploying handler 'InFlowLogHandler'.   
    at org.apache.axis2.phaseresolver.PhaseHolder.addHandler(PhaseHolder.java:75)        at
org.apache.axis2.phaseresolver.PhaseResolver.engageModuleToFlow(PhaseResolver.java:68)   
    at org.apache.axis2.phaseresolver.PhaseResolver.engageModuleToOperation(PhaseResolver.java:104)
       at org.apache.axis2.phaseresolver.PhaseResolver.engageModuleToOperation(PhaseResolver.java:110)
       at org.apache.axis2.description.AxisOperation.onEngage(AxisOperation.java:152)    
   at org.apache.axis2.description.AxisDescription.engageModule(AxisDescription.java:475)
       at org.apache.axis2.description.AxisService.onEngage(AxisService.java:752)        at
org.apache.axis2.description.AxisDescription.engageModule(AxisDescription.java:475)      
 at org.apache.axis2.description.AxisDescription.engageModule(AxisDescription.java:438)  
     at org.apache.axis2.deployment.DeploymentEngine.fillServiceGroup(DeploymentEngine.java:616)
       at org.apache.axis2.deployment.DeploymentEngine.addServiceGroup(DeploymentEngine.java:563)
       at org.apache.axis2.deployment.ServiceDeployer.deploy(ServiceDeployer.java:87)    
   at org.apache.axis2.deployment.repository.util.DeploymentFileData.deploy(DeploymentFileData.java:136)
       at org.apache.axis2.deployment.DeploymentEngine.doDeploy(DeploymentEngine.java:661)
       at org.apache.axis2.deployment.repository.util.WSInfoList.update(WSInfoList.java:144)
       at org.apache.axis2.deployment.RepositoryListener.update(RepositoryListener.java:337)
       at org.apache.axis2.deployment.RepositoryListener.checkServices(RepositoryListener.java:241)
       at org.apache.axis2.deployment.DeploymentEngine.loadServices(DeploymentEngine.java:131)
       at org.apache.axis2.deployment.WarBasedAxisConfigurator.loadServices(WarBasedAxisConfigurator.java:284)
       at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContext(ConfigurationContextFactory.java:95)
       at org.apache.axis2.transport.http.AxisServlet.initConfigContext(AxisServlet.java:567)
       at org.apache.axis2.transport.http.AxisServlet.init(AxisServlet.java:452)        at
org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1280)        at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1193)        at
org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1088)        at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5123)
       at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5407)
       at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
       at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)        at
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
        at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:977)
        at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1655)    
   at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
       at java.util.concurrent.FutureTask.run(FutureTask.java:166)        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
       at java.lang.Thread.run(Thread.java:722)[INFO] org.apache.axis2.deployment.DeploymentException:
Did not find the desired phase 'TestPhase' while deploying handler 'InFlowLogHandler'.

it seems that it cant find the phase or something but I am not sure how to fix this
Date: Wed, 12 Jun 2013 08:49:39 -0400
From: deepalk@gmail.com
To: java-dev@axis.apache.org
Subject: Re: Deploying a handler


  
    
  
  
    If you want the module for only one
      service then you just need to engage it from the service. (no
      modifications are needed for axis2.xml)

      

      Deepal

    
    
      
      Sorry to revive this old topic but I still have a
        question
        

        
        In the following guide:
        http://axis.apache.org/axis2/java/core/docs/modules.html#MyService_with_a_Logging_Module
        
          Step 4: Modify the "axis2.xml"
          Doesn't this enable the module on all services? 
          I am trying to engage this module to only one service, I
            modified the service.xml for the service I want to use this
            module. Do I still need to do step 4?
          

          
          Thanks,
          

          
            Date: Sun, 2 Jun 2013 10:00:17 -0400

            From: deepalk@gmail.com

            To: java-dev@axis.apache.org

            Subject: Re: Deploying a handler

            

            From the message context you
              can get the OMElement for the message and from that you
              can get any element. If you want you can write Xpath query
              also.

              

              Deepal

            
            
              
              Thanks for the help, this was very useful
                

                
                Now I have a different question related to this.
                  When trying to get an element from the message
                  context, is there an easy way to do that? or do I have
                  to parse the message manually?
                

                
                Thanks

                  

                  
                    Date: Wed, 29 May 2013
                    09:37:14 -0400

                    From: deepalk@gmail.com

                    To: java-dev@axis.apache.org

                    Subject: Re: Deploying a handler

                    

                    Why don't you read
                      one of the articles I sent you?

                      

                      Deepal

                    
                    
                      
                        
                          
                            
                              
                                
                                  
                                    
                                      Deepal jayasinghe,

                                          

                                        
                                      Can I know what is the
                                        benefit you will get if we will
                                        go through the modules.

                                        

                                      
                                    I saw the steps, it tells to
                                      follow the bellow steps

                                      

                                    
                                    
                                      MyService with
                                          a Logging Module
                                        
                                          Step1 :
                                              LoggingModule Class
                                          Step2 :
                                              LogHandler
                                          Step3 :
                                              module.xml
                                          Step4:
                                              Modify the "axis2.xml"
                                          Step5 :
                                              Modify the "services.xml
                                          Step6 :
                                              Packaging
                                          Step7 :
                                              Deploy the Module in Axis2
                                        
                                      
                                    
                                    Actually I don't have the knowledge
                                    of the module, for that reason I am
                                    asking this.

                                    

                                  
                                  From my understanding,

                                  

                                
                                If you want to log only soap message
                                what is going out and coming in, use a
                                simple handler which is the subclass of
                                AbstractHandler

                                

                              
                              get the soap message from the
                              messageContext. And configure the same
                              class in axis2.xml and deploy.

                              

                            
                            If you can clarify me what is the
                            disadvantage here, for that reason we will
                            go through the module, I will be great
                            thankful to you.

                            

                          
                          Thanks,

                        
                        Satya

                      
                      

                        

                        On Wed, May 29, 2013
                          at 12:16 PM, Abdelrahman Almahmoud <fire_storm5002@hotmail.com>
                          wrote:

                          
                            
                              Thanks for your time, the
                                comments are very helpful
                                

                                
                                Just to clarify, you suggested that
                                  changing the Axis2.xml is not needed
                                  when writing modules but the first
                                  guide is doing that
                                If possible, I would like the
                                  module to activate on a single service

                                  

                                  
                                  So far this is what I have,
                                  

                                  
                                  the SimpleModule.java  which I
                                    assume is mostly default
                                  

                                  
                                  
                                    package abd;
                                    

                                    
                                    import
                                      org.apache.axis2.AxisFault;
                                    import
                                      org.apache.axis2.context.ConfigurationContext;
                                    import
                                      org.apache.axis2.description.AxisDescription;
                                    import
                                      org.apache.axis2.description.AxisModule;
                                    import
                                      org.apache.axis2.modules.Module;
                                    import
                                      org.apache.neethi.Assertion;
                                    import
                                      org.apache.neethi.Policy;
                                    

                                    
                                    public class SimpleModule
                                      implements Module{
                                    

                                    
                                        public void
                                      init(ConfigurationContext
                                      configContext, AxisModule module)
                                      throws AxisFault {
                                        }
                                    

                                    
                                        public void
                                      engageNotify(AxisDescription
                                      axisDescription) throws AxisFault
                                      {
                                        }
                                    

                                    
                                        public void
                                      shutdown(ConfigurationContext
                                      configurationContext) throws
                                      AxisFault {
                                        }
                                        
                                        public String[]
                                      getPolicyNamespaces() {
                                            return null;    
                                        }
                                    

                                    
                                        public void
                                      applyPolicy(Policy policy,
                                      AxisDescription axisDescription)
                                      throws AxisFault {
                                        }
                                               
                                        public boolean
                                      canSupportAssertion(Assertion
                                      assertion) {
                                            return true;
                                        }
                                    }
                                    

                                    
                                    

                                    
                                    The SimpleHandler.java which I
                                      pasted before and the module.xml 
                                    

                                    
                                    
                                      <module
                                        name="SimpleModule"
                                        class="abd.SimpleModule">
                                          <InFlow>
                                              <handler
                                        name="InFlowLogHandler"
                                        class="abd.SimpleHandler">
                                                  <order
                                        phase="TestPhase"/>
                                              </handler>
                                          </InFlow>
                                      

                                      
                                          <OutFlow>
                                              <handler
                                        name="OutFlowLogHandler"
                                        class="abd.SimpleHandler">
                                                  <order
                                        phase="TestPhase"/>
                                              </handler>
                                          </OutFlow>
                                      

                                      
                                          <OutFaultFlow>
                                              <handler
                                        name="FaultOutFlowLogHandler"
                                        class="abd.SimpleHandler">
                                                  <order
                                        phase="TestPhase"/>
                                              </handler>
                                          </OutFaultFlow>
                                      

                                      
                                          <InFaultFlow>
                                              <handler
                                        name="FaultInFlowLogHandler"
                                        class="abd.SimpleHandler">
                                                  <order
                                        phase="TestPhase"/>
                                              </handler>
                                          </InFaultFlow>
                                      </module>
                                    
                                    

                                    
                                    The contents of the bin folder
                                      are 
                                    

                                    
                                    abd                >  .class
                                      files
                                    META-INF    > module.xml
                                    

                                    
                                     

                                      
                                        Date: Tue, 28 May 2013
                                        14:41:40 -0400
                                        

                                          From: deepalk@gmail.com

                                          To: java-dev@axis.apache.org

                                          Subject: Re: Deploying a
                                          handler

                                          

                                          What is confusing ?

                                            

                                            You can add handlers either
                                            using modules or by editing
                                            axis2.xml, however we do not
                                            recommend changes to
                                            axis2.xml. That is why we
                                            introduced the concepts of
                                            modules, where user can
                                            deploy customs handlers
                                            without changing any global
                                            configurations.

                                            

                                            Deepal

                                          
                                          
                                            
                                              This is confusing now
                                                so, I
                                                  will test the previous
                                                  method tomorrow just
                                                  for testing, but I
                                                  will give the modules
                                                  a more detailed look
                                                  for the final
                                                  deployment 
                                              

                                                

                                                
                                                  Date: Tue, 28 May
                                                  2013 11:24:27 -0400

                                                  From: deepalk@gmail.com

                                                  To: java-dev@axis.apache.org

                                                  Subject: Re: Deploying
                                                  a handler

                                                  

                                                  NOPE, you do not
                                                    need to modify
                                                    axis2.xml.

                                                    

                                                    Deepal

                                                  
                                                  
                                                    yes
                                                      it will work and
                                                      you need to modify
                                                      the axis2.xml as
                                                      well

                                                    
                                                    

                                                      

                                                      On Tue, May
                                                        28, 2013 at 6:36
                                                        PM, Deepal
                                                        jayasinghe <deepalk@gmail.com>
                                                        wrote:

                                                        
                                                          
                                                          The way
                                                          you deploy
                                                          handlers in
                                                          Axis2 is using
                                                          the concept
                                                          call Module.
                                                          Please follow
                                                          following
                                                          tutorial to
                                                          get a good
                                                          understanding
                                                          how to do
                                                          that.

                                                          http://axis.apache.org/axis2/java/core/docs/modules.html

                                                          http://www.packtpub.com/article/apache-axis2-web-services-writing-module

                                                          

                                                          Deepal

                                                          
                                                          
                                                          
                                                          
                                                          Hello,


                                                          

                                                          
                                                          I wrote
                                                          my own simple
                                                          handler which
                                                          I want to
                                                          deploy. This
                                                          handler is the
                                                          first to work
                                                          on inflowing
                                                          SOAP messages
                                                          and as such I
                                                          modified the
                                                          configuration
                                                          to have it in
                                                          the inflow
                                                          section.
                                                          My
                                                          question is,
                                                          how do I build
                                                          and deploy
                                                          this handler? 
                                                          

                                                          
                                                          Thanks
                                                          
                                                          
                                                          

                                                          
                                                          
                                                          
                                                        
                                                      
                                                      

                                                    
                                                  
                                                  

                                                
                                              
                                            
                                          
                                          

                                        
                                      
                                    
                                  
                                
                              
                            
                          
                        
                        

                      
                    
                    

                  
                
              
            
            

          
        
      
    
    
 		 	   		  
Mime
View raw message