Return-Path: Delivered-To: apmail-ws-axis-user-archive@www.apache.org Received: (qmail 45646 invoked from network); 8 Dec 2005 16:13:16 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 8 Dec 2005 16:13:15 -0000 Received: (qmail 36884 invoked by uid 500); 8 Dec 2005 16:13:05 -0000 Delivered-To: apmail-ws-axis-user-archive@ws.apache.org Received: (qmail 36879 invoked by uid 500); 8 Dec 2005 16:13:04 -0000 Mailing-List: contact axis-user-help@ws.apache.org; run by ezmlm Precedence: bulk Reply-To: axis-user@ws.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-user@ws.apache.org Received: (qmail 36868 invoked by uid 99); 8 Dec 2005 16:13:04 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Dec 2005 08:13:04 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of chathurah@gmail.com designates 66.249.82.196 as permitted sender) Received: from [66.249.82.196] (HELO xproxy.gmail.com) (66.249.82.196) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Dec 2005 08:13:04 -0800 Received: by xproxy.gmail.com with SMTP id t16so421462wxc for ; Thu, 08 Dec 2005 08:12:43 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=UB6SX2OqURrm2VTn82fCO+eS0fv5gUbC2DuN+aRQSkb7oy8lcIuhUl1z1GgcytV+obMihuJOk9aorJcSVCYANkxZ7yomhCrz+uGR1txP71Dq+drTS+ENqnuzSp4h7OMaCjM2xsPFPBDspUE2uyBT4TnerzpIFUua4+WiWZB8uiI= Received: by 10.70.46.13 with SMTP id t13mr3886223wxt; Thu, 08 Dec 2005 08:12:43 -0800 (PST) Received: by 10.70.15.18 with HTTP; Thu, 8 Dec 2005 08:12:43 -0800 (PST) Message-ID: <3ce57c850512080812p5997d0e3y8c512b27787ae471@mail.gmail.com> Date: Thu, 8 Dec 2005 11:12:43 -0500 From: Chathura Herath To: axis-user@ws.apache.org Subject: Re: [axis2 v0.93] configuration context - class cast exception In-Reply-To: <439858D7.8040703@tiscalinet.it> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <439858D7.8040703@tiscalinet.it> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Think its bug, pls open a JIRA. This particular method in Line 147 has not been update after we inserted the service group context. Second method would work because it has been updated. THanks Chathura On 12/8/05, Diego wrote: > Hi everybody! > > I'm using axis2 v0.93. > > With the following code: > > public class AstrodasServerMessageReceiver extends > AbstractInOutSyncMessageReceiver { > > public void invokeBusinessLogic(MessageContext > msgContext,MessageContext newMsgContext) throws AxisFault { > try { > OperationContext operationContext =3D > msgContext.getOperationContext(); // line 41, the one that causes the > ClassCastException > ConfigurationContext configurationContext =3D > operationContext.getEngineContext(); > > ... > > > I get the following exception: > > > java.lang.ClassCastException > at > org.apache.axis2.context.OperationContext.getEngineContext(OperationConte= xt.java:147) > at > org.astrodas.ws.server.AstrodasServerMessageReceiver.invokeBusinessLogic(= AstrodasServerMessageReceiver.java:41) > at > org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.receive(Abstr= actInOutSyncMessageReceiver.java:36) > at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:15= 8) > at > org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest= (HTTPTransportUtils.java:211) > at > org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:181) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:709) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) > at > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applicat= ionFilterChain.java:252) > at > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilte= rChain.java:173) > at > org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve= .java:214) > at > org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve= .java:178) > at > org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:= 126) > at > org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:= 105) > at > org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.j= ava:107) > at > org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:14= 8) > at > org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:825= ) > at > org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processCo= nnection(Http11Protocol.java:738) > at > org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.= java:526) > at > org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowe= rWorkerThread.java:80) > at > org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.= java:684) > at java.lang.Thread.run(Thread.java:552) > > > Whereas this code executes fine: > > public class AstrodasServerMessageReceiver extends > AbstractInOutSyncMessageReceiver { > > public void invokeBusinessLogic(MessageContext > msgContext,MessageContext newMsgContext) throws AxisFault { > try { > OperationContext operationContext =3D > msgContext.getOperationContext(); > ServiceContext serviceContext =3D > operationContext.getServiceContext(); > ConfigurationContext configurationContext =3D > serviceContext.getConfigurationContext(); > > ... > > > In the API specification it is written not to use the class > ServiceContext since "it might not live up to your expectation". > > Am I doing something wrong? > > Thanks! > > Diego > -- Chathura Herath http://www.bloglines.com/blog/chathurah