axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michele Mazzucco <Michele.Mazzu...@ncl.ac.uk>
Subject Re: [Axis2] NullPointerException in OutInAxisOperation
Date Thu, 22 Jun 2006 14:52:22 GMT
Deepal,

I've investigated in more detail what happens:

1 - separatate client:
 a - options ANON_ROBUST_OUT_ONLY_OP + mepClient.execute(false): the
message is not received
 b - options ANON_ROBUST_OUT_ONLY_OP + mepClient.execute(true): the
message is received, but on the client side I get an AxisFault on
mepClient.execute(true),
Incoming message input stream is null
	at
org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:64)
	at
org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:349)
	at
org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:279)
 c - options ANON_OUT_ONLY_OP + mecClient.execute(true): the message is
 received and there are no error messages on the client side (I guess
this is because the message has not been sent as 'robust')
 d - options ANON_OUT_ONLY_OP + mecClient.execute(true): the message is
  not received

2 - embedded into the handler it causes the problem I mentioned on my
first email *only* if the ANON_ROBUST_OUT_ONLY_OP semantic is used (as
shown below). I tried ANON_OUT_ONLY_OP + blocking execution and it seems
to work properly.

Michele


Deepal Jayasinghe wrote:
> can u pls check whether
> 
> BootstrapHelper.register(factory, omNs);
> 
> work alone ? I mean as a client
> 
> 
> 
> Michele Mazzucco wrote:
> 
>> Hi Deepal,
>>
>> I don't know how can this happen.
>> My handler extends AbstractDispatcher and replaces
>> RequestURIBasedDispatcher and it's globally engaged. Please find
>> attached axis2.xml and module.xml.
>> In the default public constructor I have:
>>
>> public NodeDispatcher() {
>> 		
>> 	this.factory = (SOAP12Factory) OMAbstractFactory.getSOAP12Factory();
>> 		this.omNs = factory.createOMNamespace(SOAPConstants.URI,
>> SOAPConstants.NODE_PREFIX);
>> 		
>> 		
>> //Registers the node to the manager
>> 	try {
>> 		if (! registered) {
>> 	// Sends a message to another service running on another tomcat server
>> (it works)
>> 			BootstrapHelper.register(factory, omNs);
>> 			registered = true;
>> 		}
>> 	} catch (AxisFault e) {
>> 		if (log.isEnabledFor(Level.FATAL)) {
>> 			log.fatal("Unable to register the node: " + e.getLocalizedMessage());
>> 		}
>> 	}
>> 		
>> }
>>
>> and Bootstrap.register is:
>>
>> static final void register(SOAP12Factory factory,  OMNamespace omNs)
>> throws AxisFault {
>> 		
>> 		Options options = new Options();
>> 		options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
>> 		
>> 		ServiceClient sender = new ServiceClient();
>> 		EndpointReference managerEPR = new
>> EndpointReference(System.getProperty("qosp.manager.epr"));
>> 		
>> 		OperationClient mepClient =
>> sender.createClient(ServiceClient.ANON_ROBUST_OUT_ONLY_OP);	
>> 		mepClient.setOptions(options);
>> 		
>> 		SOAPEnvelope env = createRegistrationEnvelope(factory, omNs);		
>> 		MessageContext ctx = new MessageContext();
>> 		ctx.setEnvelope(env);
>> 		
>> 		ctx.setWSAAction(ActionConstants.ADD_NODE_ACTION);
>> 		ctx.setTo(managerEPR);			
>> 		
>> 		mepClient.addMessageContext(ctx);
>> 		mepClient.execute(false);
>> 		mepClient.complete(ctx);
>> 		
>> 		if (NodeDispatcher.log.isInfoEnabled()) {
>> 			NodeDispatcher.log.info("Node [" + NodeDispatcher.getNodeName() + "]
>> registered.");
>> 		}
>> 	}
>>
>> The exception is thrown after the handler is created.
>>
>>
>> Hope this helps,
>> Michele
>>
>> Deepal Jayasinghe wrote:
>>  
>>
>>> Hi Michele;
>>> hmm , how can that happen ? when you deploy a handler in server side how
>>> does OutInAxisOperation throw an exception , can you please explain the
>>> problem a bit .
>>>
>>> Michele Mazzucco wrote:
>>>
>>>    
>>>
>>>> Hi all,
>>>>
>>>> I don't know if this is an Axis2 (snapshot of June 7th) or a Tomcat
>>>> problem (I can't see this log into the tomcat log files), however when I
>>>> deploy a custom handler I can see in the console a NullPointerException
>>>> at OutInAxisOperation:433
>>>>
>>>> I tried to set $AXIS2_HOME/WEB-INF/classes/log4j.properties
>>>>
>>>> log4j.logger.org.apache.axis2.enterprise=INFO
>>>> and
>>>> log4j.rootCategory=INFO, CONSOLE, LOGFILE,
>>>> however I can't see the the exception in axis2.log.
>>>>
>>>>
>>>> Michele
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
>>>> For additional commands, e-mail: axis-user-help@ws.apache.org
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>      
>>>>
>>> ------------------------------------------------------------------------
>>>
>>> <axisconfig name="AxisJava2.0">
>>>    <!-- ================================================= -->
>>>    <!-- Parameters -->
>>>    <!-- ================================================= -->
>>>    <parameter name="hotdeployment" locked="false">true</parameter>
>>>    <parameter name="hotupdate" locked="false">true</parameter>
>>>    <parameter name="enableMTOM" locked="false">true</parameter>
>>>
>>>    <!--During a fault, stacktrace can be sent with the fault message. The
following flag will control -->
>>>    <!--that behaviour.-->
>>>    <parameter name="sendStacktraceDetailsWithFaults" locked="false">true</parameter>
>>>
>>>    <!--If there aren't any information available to find out the fault reason,
we set the message of the expcetion-->
>>>    <!--as the faultreason/Reason. But when a fault is thrown from a service
or some where, it will be -->
>>>    <!--wrapped by different levels. Due to this the initial exception message
can be lost. If this flag-->
>>>    <!--is set then, Axis2 tries to get the first exception and set its message
as the faultreason/Reason.-->
>>>    <parameter name="DrillDownToRootCauseForFaultReason" locked="false">false</parameter>
>>>
>>>    <parameter name="userName" locked="false">admin</parameter>
>>>    <parameter name="password" locked="false">admin</parameter>
>>>
>>>    <!--<parameter name="contextPath" locked="false">axis2</parameter>-->
>>>    <!--<parameter name="servicePath" locked="false">services</parameter>-->
>>>    <!--Set the flag to true if you want to enable transport level session
mangment-->
>>>    <parameter name="manageTransportSession" locked="false">false</parameter>
>>>
>>>    <!-- If you have a frontend host which exposes this webservice using a
different public URL  -->
>>>    <!-- use this parameter to override autodetected url -->
>>>    <!--<parameter name="httpFrontendHostUrl" locked="false">https://someotherhost/context</parameter>-->
>>>
>>>
>>>    <!--    The way of adding listener to the system-->
>>>    <!--    <listener class="org.apache.axis2.ObserverIMPL">-->
>>>    <!--        <parameter name="RSS_URL" locked="false">http://127.0.0.1/rss</parameter>-->
>>>    <!--    </listener>-->
>>>
>>>    <!-- ================================================= -->
>>>    <!-- Message Receivers -->
>>>    <!-- ================================================= -->
>>>    <!--This is the Deafult Message Receiver for the system , if you want to
have MessageReceivers for -->
>>>    <!--all the other MEP implement it and add the correct entry to here ,
so that you can refer from-->
>>>    <!--any operation -->
>>>    <!--Note : You can ovride this for particular service by adding the same
element with your requirement-->
>>>    <messageReceivers>
>>>        <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-only"
>>>                         class="org.apache.axis2.receivers.RawXMLINOnlyMessageReceiver"/>
>>>        <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out"
>>>                         class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
>>>    </messageReceivers>
>>>    <!-- ================================================= -->
>>>    <!-- Transport Ins -->
>>>    <!-- ================================================= -->
>>>    <transportReceiver name="http"
>>>                       class="org.apache.axis2.transport.http.SimpleHTTPServer">
>>>        <parameter name="port" locked="false">6060</parameter>
>>>        <!--If you want to give your own host address for EPR generation-->
>>>        <!--uncommet following paramter , and set as you required.-->
>>>        <!--<parameter name="hostname" locked="false">http://myApp.com/ws</parameter>-->
>>>    </transportReceiver>
>>>
>>>    <!--Uncomment if you want to have SMTP transport support-->
>>>    <!--<transportReceiver name="mail" class="org.apache.axis2.transport.mail.SimpleMailListener">-->
>>>    <!--<parameter name="transport.mail.pop3.host" locked="false">127.0.0.1</parameter>-->
>>>    <!--<parameter name="transport.mail.pop3.user" locked="false">axis2</parameter>-->
>>>    <!--<parameter name="transport.mail.pop3.password" locked="false">axis2</parameter>-->
>>>    <!--<parameter name="transport.mail.pop3.port" locked="false">110</parameter>-->
>>>    <!--<parameter name="transport.mail.replyToAddress" locked="false">axis2@127.0.0.1</parameter>-->
>>>    <!--</transportReceiver>-->
>>>
>>>    <transportReceiver name="tcp"
>>>                       class="org.apache.axis2.transport.tcp.TCPServer">
>>>        <parameter name="port" locked="false">6060</parameter>
>>>        <!--If you want to give your own host address for EPR generation-->
>>>        <!--uncommet following paramter , and set as you required.-->
>>>        <!--<parameter name="hostname" locked="false">tcp://myApp.com/ws</parameter>-->
>>>    </transportReceiver>
>>>
>>>    <!--Uncomment this if you want JMS transport support-->
>>>    <!--<transportReceiver name="jms" class="org.apache.axis2.transport.jms.SimpleJMSListener">-->
>>>    <!--<parameter name="transport.jms.Destination" locked="false">dynamicQueues/FOO</parameter>-->
>>>    <!--<parameter name="java.naming.factory.initial" locked="false">-->
>>>    <!--org.activemq.jndi.ActiveMQInitialContextFactory</parameter>-->
>>>    <!--<parameter name="java.naming.provider.url" locked="false">tcp://localhost:61616</parameter>-->
>>>    <!--</transportReceiver>-->
>>>
>>>    <!-- ================================================= -->
>>>    <!-- Transport Outs -->
>>>    <!-- ================================================= -->
>>>
>>>    <transportSender name="tcp"
>>>                     class="org.apache.axis2.transport.tcp.TCPTransportSender"/>
>>>    <transportSender name="local"
>>>                     class="org.apache.axis2.transport.local.LocalTransportSender"/>
>>>    <transportSender name="jms"
>>>                     class="org.apache.axis2.transport.jms.JMSSender"/>
>>>    <transportSender name="http"
>>>                     class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
>>>        <parameter name="PROTOCOL" locked="false">HTTP/1.1</parameter>
>>>        <parameter name="Transfer-Encoding" locked="false">chunked</parameter>
>>>    </transportSender>
>>>    <transportSender name="https"
>>>                     class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
>>>        <parameter name="PROTOCOL" locked="false">HTTP/1.1</parameter>
>>>        <parameter name="Transfer-Encoding" locked="false">chunked</parameter>
>>>    </transportSender>
>>>
>>>    <!-- Uncomment this one with the appropriate papameters to enable the SMTP
transport Receiver
>>>   <transportSender name="mailto" class="org.apache.axis2.transport.mail.MailTransportSender">
>>>       <parameter name="transport.mail.smtp.host" locked="false">127.0.0.1</parameter>
>>>       <parameter name="transport.mail.smtp.user" locked="false">axis2</parameter>
>>>       <parameter name="transport.mail.smtp.password" locked="false">axis2</parameter>
>>>       <parameter name="transport.mail.smtp.port" locked="false">25</parameter>
>>>   </transportSender>
>>>   -->
>>>
>>>    <!-- ================================================= -->
>>>    <!-- Global Modules  -->
>>>    <!-- ================================================= -->
>>>    <!-- Comment this to disable Addressing -->
>>>    <module ref="addressing"/>
>>> 	
>>> 	<!-- QOSP computational node module -->
>>> 	<module ref="nodeInterceptor"/>
>>>
>>>
>>>    <!--Configuring module , providing parameters for modules whether they
refer or not-->
>>>    <!--<moduleConfig name="addressing">-->
>>>    <!--<parameter name="addressingPara" locked="false">N/A</parameter>-->
>>>    <!--</moduleConfig>-->
>>>
>>>    <!-- ================================================= -->
>>>    <!-- Phases  -->
>>>    <!-- ================================================= -->
>>>    <phaseOrder type="inflow">
>>> 		<phase name="nodeInterceptorPhase" />
>>>        <!--  System pre defined phases       -->
>>>        <phase name="Transport">
>>> 		<!--
>>>            <handler name="RequestURIBasedDispatcher"
>>>                     class="org.apache.axis2.engine.RequestURIBasedDispatcher">
>>>                <order phase="Dispatch"/>
>>>            </handler>
>>> 			-->
>>>            <handler name="SOAPActionBasedDispatcher"
>>>                     class="org.apache.axis2.engine.SOAPActionBasedDispatcher">
>>>                <order phase="Dispatch"/>
>>>            </handler>
>>>        </phase>
>>>        <phase name="Security"/>
>>>        <phase name="PreDispatch"/>
>>>        <phase name="Dispatch" class="org.apache.axis2.engine.DispatchPhase">
>>>            <handler name="AddressingBasedDispatcher"
>>>                     class="org.apache.axis2.engine.AddressingBasedDispatcher">
>>>                <order phase="Dispatch"/>
>>>            </handler>
>>>
>>>            <handler name="SOAPMessageBodyBasedDispatcher"
>>>                     class="org.apache.axis2.engine.SOAPMessageBodyBasedDispatcher">
>>>                <order phase="Dispatch"/>
>>>            </handler>
>>>            <handler name="InstanceDispatcher"
>>>                     class="org.apache.axis2.engine.InstanceDispatcher">
>>>                <order phase="PostDispatch"/>
>>>            </handler>
>>>        </phase>
>>>        <!--  System pre defined phases       -->
>>>        <!--   After Postdispatch phase module author or or service author
can add any phase he want      -->
>>>        <phase name="OperationInPhase"/>
>>>    </phaseOrder>
>>> 	
>>>    <phaseOrder type="outflow">
>>> 		<phase name="nodeInterceptorPhase" />
>>>        <!--      user can add his own phases to this area  -->
>>>        <phase name="OperationOutPhase"/>
>>>        <!--system predefined phase-->
>>>        <!--these phase will run irrespective of the service-->
>>>        <phase name="PolicyDetermination"/>
>>>        <phase name="MessageOut"/>
>>>    </phaseOrder>
>>> 	
>>>    <phaseOrder type="INfaultflow">
>>> 		<phase name="nodeInterceptorPhase" />
>>>        <phase name="PreDispatch"/>
>>>        <phase name="Dispatch" class="org.apache.axis2.engine.DispatchPhase">
>>> 			<!--
>>>            <handler name="RequestURIBasedDispatcher"
>>>                     class="org.apache.axis2.engine.RequestURIBasedDispatcher">
>>>                <order phase="Dispatch"/>
>>>            </handler>
>>> 			-->
>>>            <handler name="SOAPActionBasedDispatcher"
>>>                     class="org.apache.axis2.engine.SOAPActionBasedDispatcher">
>>>                <order phase="Dispatch"/>
>>>            </handler>
>>>
>>>            <handler name="AddressingBasedDispatcher"
>>>                     class="org.apache.axis2.engine.AddressingBasedDispatcher">
>>>                <order phase="Dispatch"/>
>>>            </handler>
>>>
>>>            <handler name="SOAPMessageBodyBasedDispatcher"
>>>                     class="org.apache.axis2.engine.SOAPMessageBodyBasedDispatcher">
>>>                <order phase="Dispatch"/>
>>>            </handler>
>>>            <handler name="InstanceDispatcher"
>>>                     class="org.apache.axis2.engine.InstanceDispatcher">
>>>                <order phase="PostDispatch"/>
>>>            </handler>
>>>        </phase>
>>>        <!--      user can add his own phases to this area  -->
>>>        <phase name="OperationInFaultPhase"/>
>>>    </phaseOrder>
>>> 	
>>>    <phaseOrder type="Outfaultflow">
>>> 		<phase name="nodeInterceptorPhase" />
>>>        <!--      user can add his own phases to this area  -->
>>>        <phase name="OperationOutFaultPhase"/>
>>>        <phase name="PolicyDetermination"/>
>>>        <phase name="MessageOut"/>
>>>    </phaseOrder>
>>> </axisconfig>
>>>
>>>    
>>>
>>> ------------------------------------------------------------------------
>>>
>>> <?xml version="1.0" encoding="UTF-8"?>
>>>
>>>
>>> <module name="nodeInterceptor" class="ncl.qosp.modules.node.NodeModule">
>>>   <inflow>
>>>        <handler name="InFlowNodeHandler" class="ncl.qosp.modules.node.NodeDispatcher">
>>>        <order phase="nodeInterceptorPhase" />
>>>        </handler>
>>>   </inflow>
>>>
>>>   <outflow>
>>>        <handler name="OutFlowNodeHandler" class="ncl.qosp.modules.node.NodeDispatcher">
>>>        <order phase="nodeInterceptorPhase"/>					 
>>>        </handler>
>>>   </outflow>
>>>
>>>   <Outfaultflow>
>>>        <handler name="FaultOutFlowNodeHandler" class="ncl.qosp.modules.node.NodeDispatcher">
>>>        <order phase="nodeInterceptorPhase"/>
>>>        </handler>
>>>   </Outfaultflow>
>>>
>>>   <INfaultflow>
>>>        <handler name="FaultInFlowNodeHandler" class="ncl.qosp.modules.node.NodeDispatcher">
>>>        <order phase="nodeInterceptorPhase"/>
>>>        </handler>
>>>   </INfaultflow>
>>> </module>
>>>
>>>    
>>>
>>> ------------------------------------------------------------------------
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
>>> For additional commands, e-mail: axis-user-help@ws.apache.org
>>>
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Mime
View raw message