Return-Path: Delivered-To: apmail-ws-axis-user-archive@www.apache.org Received: (qmail 73009 invoked from network); 11 Sep 2006 17:05:50 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 11 Sep 2006 17:05:50 -0000 Received: (qmail 83237 invoked by uid 500); 11 Sep 2006 17:05:36 -0000 Delivered-To: apmail-ws-axis-user-archive@ws.apache.org Received: (qmail 83184 invoked by uid 500); 11 Sep 2006 17:05:36 -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 83119 invoked by uid 99); 11 Sep 2006 17:05:36 -0000 Received: from idunn.apache.osuosl.org (HELO idunn.apache.osuosl.org) (140.211.166.84) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 11 Sep 2006 10:05:36 -0700 Authentication-Results: idunn.apache.osuosl.org smtp.mail=Knoll_Frank@web.de; spf=permerror X-ASF-Spam-Status: No, hits=0.0 required=5.0 tests= Received-SPF: error (idunn.apache.osuosl.org: domain web.de from 217.72.192.243 cause and error) Received: from ([217.72.192.243:35394] helo=fmmailgate05.web.de) by idunn.apache.osuosl.org (ecelerity 2.1 r(10620)) with ESMTP id 6B/00-25916-86795054 for ; Mon, 11 Sep 2006 10:05:45 -0700 Reveived: from web.de by fmmailgate05.web.de (Postfix) with SMTP id 5199B20B0E5; Mon, 11 Sep 2006 19:05:30 +0200 (CEST) Received: from [134.2.217.59] by freemailng1601.web.de with HTTP; Mon, 11 Sep 2006 19:05:30 +0200 Date: Mon, 11 Sep 2006 19:05:30 +0200 Message-Id: <1303457759@web.de> MIME-Version: 1.0 From: Frank Knoll To: axis-dev@ws.apache.org, axis-user@ws.apache.org Subject: how can two WebServices share the same data? Organization: http://freemail.web.de/ Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: quoted-printable X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Dear Axis-Users and -Developers, I have installed Axis 1.4 over Tomcat 5.5.17 over Java 1.5 and have one qu= estion and one problem: My question is: I have two WebServices deployed in the same container whic= h want to share the same data (e.g. one instance of my class FileResourceH= ome). I figured out that this data can be stored in a property (e.g. "Text= Grid.FileResourceHome") of the ServletContext which I can access out of an= y WebService deployed in the same container, right or wrong=3F Here is is the code I am using so far for this scenario: import org.apache.axis.MessageContext; import org.apache.axis.transport.http.HTTPConstants; import javax.servlet.http.HttpServlet; import javax.servlet.ServletContext; ... private static final String fileResourceHomeName =3D "TextGrid.FileResourceH= ome"; public static FileResourceHome getInstance() { MessageContext messageContext =3D MessageContext.getCurrentContext(); HttpServlet httpServlet =3D (HttpServlet)messageContext.getProperty(HTTPCo= nstants.MC=5FHTTP=5FSERVLET); ServletContext servletContext =3D httpServlet.getServletContext(); FileResourceHome fileResourceHome =3D (FileResourceHome)servletContext.get= Attribute(fileResourceHomeName); if(fileResourceHome =3D=3D null) { fileResourceHome =3D new FileResourceHome(); servletContext.setAttribute(fileResourceHomeName, fileResourceHome); } =09 return fileResourceHome; } My problem is: This code does compile, but doesn't execute, because the li= ne MessageContext messageContext =3D MessageContext.getCurrentContext(); from above results in a java.lang.reflect.InvocationTargetException. I don= 't understand this, because the class MessageContext is in the file axis.j= ar which is stored in the webapps/axis/WEB-INF/lib directory of my tomcat-= installation. What did I do wrong=3F Can someone help me, please=3F Cheers Frank =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F Viren-Scan f=FCr Ihren PC! Jetzt f=FCr jeden. Sofort, online und kostenlos. Gleich testen! http://www.pc-sicherheit.web.de/freescan/=3Fmc=3D022222 --------------------------------------------------------------------- To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org For additional commands, e-mail: axis-user-help@ws.apache.org