Return-Path: Delivered-To: apmail-geronimo-user-archive@www.apache.org Received: (qmail 92164 invoked from network); 22 May 2006 08:13:26 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 22 May 2006 08:13:26 -0000 Received: (qmail 86571 invoked by uid 500); 22 May 2006 08:13:23 -0000 Delivered-To: apmail-geronimo-user-archive@geronimo.apache.org Received: (qmail 86400 invoked by uid 500); 22 May 2006 08:13:22 -0000 Mailing-List: contact user-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: user@geronimo.apache.org List-Id: Delivered-To: mailing list user@geronimo.apache.org Received: (qmail 86389 invoked by uid 99); 22 May 2006 08:13:22 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 May 2006 01:13:22 -0700 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=DNS_FROM_RFC_ABUSE X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [61.95.162.76] (HELO Kecgate02.infosys.com) (61.95.162.76) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 May 2006 01:13:21 -0700 Received: from indhubbhs04.ad.infosys.com ([192.168.200.84]) by Kecgate02.infosys.com with InterScan Messaging Security Suite; Mon, 22 May 2006 13:41:19 +0530 Received: from BLRKECMSG04.ad.infosys.com ([172.25.213.134]) by indhubbhs04.ad.infosys.com with Microsoft SMTPSVC(6.0.3790.1830); Mon, 22 May 2006 13:40:44 +0530 Received: from BLRKECMSG01.ad.infosys.com ([172.25.213.131]) by BLRKECMSG04.ad.infosys.com with Microsoft SMTPSVC(6.0.3790.1830); Mon, 22 May 2006 13:40:44 +0530 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: Unable get datasource reference in bean... Date: Mon, 22 May 2006 13:40:44 +0530 Message-ID: <4690875E336998438DF43A78B8E38CF2E4F5A0@BLRKECMSG01.ad.infosys.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Unable get datasource reference in bean... Thread-Index: AcZ9WOUSmTN2NNlBSMGRoiiw6NtimAAAoLKQAAbn0JA= From: "Santosh Koti" To: X-OriginalArrivalTime: 22 May 2006 08:10:44.0332 (UTC) FILETIME=[395882C0:01C67D77] X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Here is a sample from my app (openejb-jar.xml) Try smething like this. I am bit busy rt nw, give a try=20 Else post back to the forum , me or some1 may help u. -----------Begin---------- org.tranql.ejbqlcompiler.OracleEJBQLCompilerFac tory org.tranql.sql.oracle.OracleDBSyntaxFactory AccountsInfoEJB ejb/AccountsInfoEJB =20 ejb/AccountDetails =20 AccountDetails ejb/CustomerEJB Customer =20 =20 testbank testbank =20 ------------End----------- Thanks, Santosh. "Don't talk about yourself; it will be done when you leave. " =20 -----Original Message----- From: Varanasi, Ishwara [mailto:Ishwara.Varanasi@fmr.com]=20 Sent: Monday, May 22, 2006 10:24 AM To: user@geronimo.apache.org Subject: RE: Unable get datasource reference in bean... Hi Santosh, Thanks for your help. My current openejb-jar looks like this: TimeServer ejb/TimeServer Could you please tell me how/where to add resource ref? (thank you very much for your time) Regards, Ishwara Bhat V -----Original Message----- From: Santosh Koti [mailto:Santosh_Koti@infosys.com]=20 Sent: Monday, May 22, 2006 10:01 AM To: user@geronimo.apache.org Subject: RE: Unable get datasource reference in bean... Have a resource reference in ur openejb-jar.xml for ur JNDI lookup. That should help u. Thanks, Santosh. "Don't talk about yourself; it will be done when you leave. " -----Original Message----- From: Varanasi, Ishwara [mailto:Ishwara.Varanasi@fmr.com] Sent: Monday, May 22, 2006 9:54 AM To: user@geronimo.apache.org Subject: Unable get datasource reference in bean... Hi, I am facing a problem with accessing DataSource. I am able to get reference to a declared database pool in JSP and Servlet. But unable to do so in a session bean or class accessed by a session bean. I am getting a NameNotFoundException... any idea why this is happening? The code: InitialContext ctx =3D new InitialContext(); DataSource ds =3D (DataSource) ctx.lookup("java:comp/env/REQUEST"); Connection con =3D ds.getConnection(); Web.xml: REQUEST javax.sql.DataSource Container Shareable Geronimo-web.xml: REQUEST REQUEST Output and stack trace of exception goes here: Getting ref in Servlet: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D 09:46:39,342 INFO [TimeServerServlet] 2. Getting ds ref in Servlet... 09:46:44,764 INFO [TimeServerServlet] Got connection: org.tranql.connector.jdbc.ConnectionHandle@81bb3b 09:46:44,764 INFO [DateTimeFunctions] Date : Mon May 22 09:46:44 IST 2006 09:46:44,764 INFO [DateTimeFunctions] Formatted Date: 22/05/2006 09:46:44.764 In ejbCreate() Error in bean: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D 09:46:44,780 INFO [TimeServerBean] 1. Getting ds ref in Bean... 09:46:44,780 ERROR [TimeServerBean] Exception #1: javax.naming.NameNotFoundException: env/REQUEST javax.naming.NameNotFoundException: env/REQUEST at org.apache.geronimo.naming.enc.AbstractReadOnlyContext.lookup(AbstractRe adOnlyContext.jav a:81) at org.apache.geronimo.naming.java.RootContext.lookup(RootContext.java:51) at javax.naming.InitialContext.lookup(InitialContext.java:347) at com.nis.timeserver.ejb.TimeServerBean.getTime(TimeServerBean.java:72) at com.nis.timeserver.ejb.TimeServerBean$$FastClassByCGLIB$$3926a5ec.invoke () at org.openejb.dispatch.AbstractMethodOperation.invoke(AbstractMethodOperat ion.java:90) at org.openejb.slsb.BusinessMethod.execute(BusinessMethod.java:67) at org.openejb.dispatch.DispatchInterceptor.invoke(DispatchInterceptor.java :72) at org.apache.geronimo.naming.java.ComponentContextInterceptor.invoke(Compo nentContextInterc eptor.java:56) at org.openejb.ConnectionTrackingInterceptor.invoke(ConnectionTrackingInter ceptor.java:81) at org.openejb.transaction.ContainerPolicy$TxRequired.invoke(ContainerPolic y.java:119) at org.openejb.transaction.TransactionContextInterceptor.invoke(Transaction ContextIntercepto r.java:80) at org.openejb.slsb.StatelessInstanceInterceptor.invoke(StatelessInstanceIn terceptor.java:98 ) at org.openejb.transaction.ContainerPolicy$TxRequired.invoke(ContainerPolic y.java:140) at org.openejb.transaction.TransactionContextInterceptor.invoke(Transaction ContextIntercepto r.java:80) at org.openejb.SystemExceptionInterceptor.invoke(SystemExceptionInterceptor .java:82) at org.openejb.GenericEJBContainer.invoke(GenericEJBContainer.java:238) at org.openejb.proxy.EJBMethodInterceptor.intercept(EJBMethodInterceptor.ja va:129) at org.openejb.proxy.SessionEJBObject$$EnhancerByCGLIB$$39d68ea2.getTime() at com.nis.timeserver.web.servlet.TimeServerServlet.doGet(TimeServerServlet .java:88) at javax.servlet.http.HttpServlet.service(HttpServlet.java:595) at javax.servlet.http.HttpServlet.service(HttpServlet.java:688) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica tionFilterChain.j ava:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt erChain.java:173) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv e.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValv e.java:178) at org.apache.geronimo.tomcat.GeronimoStandardContext$SystemMethodValve.inv oke(GeronimoStand ardContext.java:272) at org.apache.geronimo.tomcat.valve.TransactionContextValve.invoke(Transact ionContextValve.j ava:53) at org.apache.geronimo.tomcat.valve.ComponentContextValve.invoke(ComponentC ontextValve.java: 47) at org.apache.geronimo.tomcat.valve.InstanceContextValve.invoke(InstanceCon textValve.java:60 ) 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. java:107) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:526 ) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:1 48) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:85 6) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processC onnection(Http11P rotocol.java:744) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint .java:527) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollow erWorkerThread.ja va:80) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool .java:684) at java.lang.Thread.run(Thread.java:534) Thanks and Regards, Ishwara Bhat V **************** CAUTION - Disclaimer ***************** This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS******** End of Disclaimer ********INFOSYS***