Return-Path: Delivered-To: apmail-ws-axis-user-archive@www.apache.org Received: (qmail 92197 invoked from network); 20 Sep 2006 21:29:00 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 20 Sep 2006 21:29:00 -0000 Received: (qmail 8245 invoked by uid 500); 20 Sep 2006 21:28:52 -0000 Delivered-To: apmail-ws-axis-user-archive@ws.apache.org Received: (qmail 8220 invoked by uid 500); 20 Sep 2006 21:28:52 -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 8209 invoked by uid 99); 20 Sep 2006 21:28:52 -0000 Received: from idunn.apache.osuosl.org (HELO idunn.apache.osuosl.org) (140.211.166.84) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Sep 2006 14:28:52 -0700 X-ASF-Spam-Status: No, hits=0.0 required=5.0 tests= Received: from [213.163.128.203] ([213.163.128.203:65119] helo=mta1.glocalnet.net) by idunn.apache.osuosl.org (ecelerity 2.1.1.8 r(12930)) with ESMTP id 54/DE-01963-D82B1154 for ; Wed, 20 Sep 2006 14:28:47 -0700 Received: from [127.0.0.1] (213.64.159.247) by mta1.glocalnet.net (7.3.104) (authenticated as joepoe@glocalnet.net) id 44E3B1D300A53779 for axis-user@ws.apache.org; Wed, 20 Sep 2006 23:28:31 +0200 Message-ID: <4511B29E.7070200@NotSoHotMail.com> Date: Wed, 20 Sep 2006 23:29:02 +0200 From: Johan Lundberg User-Agent: Thunderbird 1.5.0.7 (Windows/20060909) MIME-Version: 1.0 To: axis-user@ws.apache.org Subject: Re: Tomcat + Axis2 + MySQL References: In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hi It is kind of funny find out that someone else has exactly the same problem, at the same time as I have . I have been trying to find a solution to this during all day and all night. My code is almost identical to yours but I get a nullpointer exception at line: Context envContext = (Context)initContext.lookup("java:/comp/env"); This piece of code is packed in my aar-file and deployed to axis2 in tomcat. However I am not using Axis2 1.0 but a later nightly build. I have searched the whole wide Internet for a solution to this but nothing turned out as a solution. Is the initialContext.lookUp("java:/comp/env") in my aar-file isolated from the tomcat or axis2? Pr�t�r, did you get this to work? /johan Sanjesh Pathak wrote: > > Looks ok to me. > > Sanjesh > > Real-Time Web Service Monitoring for Axis, Axis2 > > SoapKnox Inc > > http://www.soapknox.com > > Ph: 832 279 3745 > > ------------------------------------------------------------------------ > > *From:* Pr�t�r G�bor [mailto:protar.gabor@gmail.com] > *Sent:* Wednesday, September 20, 2006 7:41 AM > *To:* axis-user@ws.apache.org > *Subject:* Tomcat + Axis2 + MySQL > > Hello! > > I wrote a similar mail yesterday, but now I found something. > > I am using Tomcat v5.5.17, Axis 2 v1.0, MySQL v5.0.24, MySQL > Connector/J v5.0.3 > > This is how I configured MySQL under Tomcat: > > 1.: put context information to server.xml: folder>/conf/server.xml > > > debug="5" reloadable="true" crossContext="true"> > > > maxActive="100" maxIdle="30" maxWait="100000" > > username="wsuser" password="pass" driverClassName="com.mysql.jdbc.Driver" > > url="jdbc:mysql://localhost:3306/ws?autoReconnect=true"/> > > > > 2.: create resource link to the web.xml file at folder>/webapps/axis2/web-inf/web.xml > > > > DB Connection > > jdbc/TestDB > > javax.sql.DataSource > > Container > > > > This resource works well in a test servlet, but I don�t how to use it > axis2 webservice. > > My question is: how can I reference this resource from java code? > > Context initContext = new InitialContext(); > > Context envContext = (Context)initContext.lookup("java:/comp/env"); > > DataSource ds = (DataSource)envContext.lookup("jdbc/TestDB"); > > Connection conn = ds.getConnection(); > > Is it correct? > > Thanks, > > G�bor > --------------------------------------------------------------------- To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org For additional commands, e-mail: axis-user-help@ws.apache.org