Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 54D269F9621 for ; Sun, 2 Sep 2007 16:32:05 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 16654-10 for ; Sun, 2 Sep 2007 16:31:58 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from web63612.mail.re1.yahoo.com (web63612.mail.re1.yahoo.com [69.147.97.82]) by postgresql.org (Postfix) with SMTP id 87BBA9F9620 for ; Sun, 2 Sep 2007 16:32:01 -0300 (ADT) Received: (qmail 82106 invoked by uid 60001); 2 Sep 2007 19:32:00 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=b5LTiK4DRFay74HeOPKbk9r2QyucPffT3NeJGBfivG7I5u9pO9779Xt3qHzcbaWFiJz/8BjIqm6LsCHHJLasPqD05jpM9WvDxQvjCf0H2IoqV7SRR4uUUw7yOBNXt+T0e3HS4dXsMrywZLas1dsPCiJztg5958HwHoSCNfKanHo=; X-YMail-OSG: t_SU1ZMVM1mNBEzuwd_k9DVeRjHealf4UlJU5Kpo Received: from [81.199.186.187] by web63612.mail.re1.yahoo.com via HTTP; Sun, 02 Sep 2007 12:32:00 PDT Date: Sun, 2 Sep 2007 12:32:00 -0700 (PDT) From: Roman Isitua Subject: JNDI look up problem in sun java app server 8.1 To: pgsql-jdbc@postgresql.org MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Message-ID: <256647.81069.qm@web63612.mail.re1.yahoo.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200709/1 X-Sequence-Number: 17423 Hello everyone, I am new to JNDI and application servers. I have a sample web application that accesses data stored in postgresql that I want to deploy on the sun java application server 8.1. I believe I have followed the guidelines in sun java i.e register jdbc driver, create connection pool, jdbc resource. I have done this and i verified this by clicking the ping button and a success message was displayed. I am not sure but i think the problem is with my code: InitialContext ic = new InitialContext(); DataSource source = (DataSource)ic.lookup("java:comp/env/jdbc/books"); connection = source.getConnection(); each time i run the application i get the following exception javax.naming.NameNotFoundException: No object bound to name java:comp/env/jdbc/books at com.sun.enterprise.naming.NamingManagerImpl.lookup(NamingManagerImpl.java:751) at com.sun.enterprise.naming.java.javaURLContext.lookup(javaURLContext.java:156) at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:307) at javax.naming.InitialContext.lookup(InitialContext.java:392) at com.deitel.advjhtp1.store.TitlesBean.(TitlesBean.java:38) The name of the data source i configured in sun java is jdbc/books. I made sure that the database exists and can be accessed from a java application. I confirmed this by using the Drivermanager class. My question is where have I gone wrong? is it my code or am I missing something out in the configuration settings i made in sun java? some of the settings I made in sun java are as follows: datasource classname: org.postgresql.ds.PGSimpleDataSource resource type: javax.sql.connectionPoolDataSource Additional properties: datasourceName: jdbc/books user: postgres port:5432 databaseName: books serverName: localhost Thanks in advance. Roman ____________________________________________________________________________________ Boardwalk for $500? In 2007? Ha! Play Monopoly Here and Now (it's updated for today's economy) at Yahoo! Games. http://get.games.yahoo.com/proddesc?gamekey=monopolyherenow