Return-Path: Delivered-To: apmail-synapse-dev-archive@www.apache.org Received: (qmail 7658 invoked from network); 26 Mar 2009 07:42:45 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 26 Mar 2009 07:42:45 -0000 Received: (qmail 17573 invoked by uid 500); 26 Mar 2009 07:42:45 -0000 Delivered-To: apmail-synapse-dev-archive@synapse.apache.org Received: (qmail 17486 invoked by uid 500); 26 Mar 2009 07:42:45 -0000 Mailing-List: contact dev-help@synapse.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@synapse.apache.org Delivered-To: mailing list dev@synapse.apache.org Received: (qmail 17478 invoked by uid 99); 26 Mar 2009 07:42:45 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Mar 2009 07:42:45 +0000 X-ASF-Spam-Status: No, hits=2.6 required=10.0 tests=DNS_FROM_OPENWHOIS,SPF_HELO_PASS,SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Mar 2009 07:42:37 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1LmkEC-0007VH-At for dev@synapse.apache.org; Thu, 26 Mar 2009 00:42:16 -0700 Message-ID: <22717175.post@talk.nabble.com> Date: Thu, 26 Mar 2009 00:42:16 -0700 (PDT) From: kimhorn To: dev@synapse.apache.org Subject: Class Mediator Exception after task schedule MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: kim.horn@icsglobal.net X-Virus-Checked: Checked by ClamAV on apache.org Why is this happening; Tasks are so weird. http://www.nabble.com/file/p22717175/log.txt log.txt org.apache.synapse.SynapseException: Error occured in the mediation of the class mediator. Log is attached. The class works perfectly when called in other scripts. Script is: ---------- CLASS is --------- public class CreateBasicAuthMediator implements Mediator { private static final Log log = LogFactory.getLog(CreateBasicAuthMediator.class); private String reqUsername = null; private String reqPassword = null; public int getTraceState() { return 0; } public void setTraceState(int traceState) { traceState = 0; } public String getType() { return this.getClass().getName(); } public boolean mediate(MessageContext synCtx) { log.debug("CreateBasicAuthMediator: Create Auth Header Started..."); reqUsername = (String) synCtx.getProperty("Username"); reqPassword = (String) synCtx.getProperty("Password"); if (reqUsername == null) { log.debug("CreateBasicAuthMediator: ERROR: No UserName..."); throw new SynapseException("Username property MUST be provided!"); } if (reqPassword == null) { log.debug("CreateBasicAuthMediator: ERROR: No Password..."); throw new SynapseException("Password property MUST be provided!"); } log.debug("CreateBasicAuthMediator: Creating Auth String..."); String sAuth = reqUsername + ":" + reqPassword; log.debug("CreateBasicAuthMediator: Done String..."); // Extract authentication headers org.apache.axis2.context.MessageContext mc = ((Axis2MessageContext) synCtx).getAxis2MessageContext(); Map map = (Map) mc.getProperty(org.apache.axis2.context.MessageContext.TRANSPORT_HEADERS); log.debug("CreateBasicAuthMediator: Got Map..."); // Set the authentication headers map.put("Authorization", "Basic " + (String) Base64.encode(sAuth.getBytes())); log.debug("CreateBasicAuthMediator: Auth Created succeeded!"); return true; } } -- View this message in context: http://www.nabble.com/Class-Mediator-Exception-after-task-schedule-tp22717175p22717175.html Sent from the Synapse - Dev mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org For additional commands, e-mail: dev-help@synapse.apache.org