You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Juan Vaccarezza (JIRA)" <ji...@apache.org> on 2006/11/23 20:35:02 UTC

[jira] Commented: (AXIS2-1767) JMS Transport incorrectly manage AxisFaults thrown from the endpoint

    [ http://issues.apache.org/jira/browse/AXIS2-1767?page=comments#action_12452311 ] 
            
Juan Vaccarezza commented on AXIS2-1767:
----------------------------------------

This code snippet seems to fix the bug:

org.apache.axis2.transport.jms.JMSMessageReceiver.Worker:

         public void run() {
            MessageContext msgCtx = createMessageContext(message);

            AxisEngine engine = new AxisEngine(msgCtx.getConfigurationContext());
            try {
                log.debug("Delegating JMS message for processing to the Axis engine");
                if (msgCtx.getEnvelope().getBody().hasFault()) {
                    log.debug("Fault received, processing it...");
                    engine.receiveFault(msgCtx);
                } else {
                    try {
                        log.debug("Helhty (no fault) message received, processing it...");
                        engine.receive(msgCtx);
                    } catch (AxisFault e) {
                        log.warn("Exception trying to receive the healthy (no fault) message", e);
                        if (msgCtx.isServerSide()) {
                            log.info("(Server Side) The exception will be sent to the client...");
                            MessageContext faultContext = engine.createFaultMessageContext(msgCtx, e);
                            engine.sendFault(faultContext);
                        }
                    }
                }
            } catch (AxisFault af) {
                log.fatal("JMS Worker [" + Thread.currentThread().getName() + "] Encountered an Axis Fault : " + af.getMessage(), af);
            }
        }

Just replace the run() method by this one, and that would be it.

Please, somebody check this out,  and let me know your thoughts... it worked fine for me


> JMS Transport incorrectly manage AxisFaults thrown from the endpoint
> --------------------------------------------------------------------
>
>                 Key: AXIS2-1767
>                 URL: http://issues.apache.org/jira/browse/AXIS2-1767
>             Project: Apache Axis 2.0 (Axis2)
>          Issue Type: Bug
>    Affects Versions: 1.1
>            Reporter: Juan Vaccarezza
>
> Steps:
> *Create a wsdl document with a fault declaratrion
> *Generate java code for both client and service from the wsdl file
> *Fill a generated skeleton method with a code sinppet that just throws the declared exception.
> *Configure AXIS to use JMS transport (uncomment it in axis2.xml)
> *In the generated tests, point the generated stub to a correct jms address
> *Deploy the service
> *Start axis
> *Run tests
> Bug:
> The exception will be shown in the axis server console.
> The JMSReceiver ignores the fault just logs it and no action is taken, no response is returned to the client.
> The junit test will get sutcked for 30 secs (the default jms transport timeout) and then fail because no response has been sent from the server.
> The same scenario works as expected using the HTTP transport.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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