----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, January 26, 2001 7:57 PM
Subject: Re: frustrated


> > Hellu there,
> >
> > I am getting a bit frustrated as I don't seem to able to connect to my =
> > Postgres database, through the data-sources.xml file in the <home =
> > orion>/config dir.
> >
> > I have seen about "all" newsgroup question about this issue but stilllll
=
> > nothing...
> >
> > Anyway, I do get the following error:
> > ---
> > Fri Jan 26 16:09:57 GMT+01:00 2001   [warn] ERR: =
> > javax.naming.NameNotFoundException: jdbc/postgresPooledDS not found
> > ---
> >
> > I retrieve the name with the following code:
> > ---
> >   try {
> >    javax.naming.InitialContext ic =3D new javax.naming.InitialContext();
> >    DataSource ds =3D (DataSource) ic.lookup("jdbc/postgresPooledDS");
> >   }
> > ---
> ...
>
> > BTW:
> > - I did put the postgres driver in  the <orion home>/lib dir =
> > (postgres.jar file). I have used this file to make a direct connection =
> > which works. The postgres.jar file is part of the J2EE_CLASSPATH =
> > variable.
> > - Where can I find good information about how to set this up ? Or can =
> > someone send this to me as there should an article one =
> > http://orionsupport.com/ but this server is unreachable ?
> Yes, the server is down for some days, the webmaster sent a mail yesterday
> about it...
>
> >
> > Please some help ??
> >
> > Regards,
> > Ed Bras
> >
> Well, you can try adding this:
>
>       <resource-ref>
>         <description>JDBC Connection</description>
>         <res-ref-name>jdbc/postgresPooledDS</res-ref-name>
>         <res-type> (postgres datasource) </res-type>
>         <res-auth>Container</res-auth>
>       </resource-ref>
>
> inside ejb/META-INF/ejb-jar.xml, inside your bean block
>
> if you're using it from a client application, you need to add the same to
> the META-INF/application-client.xml
>
> Mmm... the thing you've to guess is the postgres datasource name... and
> replace (postgres datasource) with it.
>
> In mySQL we have org.gjt.mm.mysql.Driver
>
> Well, bye!
> See ya
>

Thanks for the tips. It's a servlets that makes a connection through his
middle tier, so I suppose I indeed need to configure the ejb-jar.xml file.
Appearantly I don't even have this file/structure yet. I only have the
WEB-INF dir as I didn't say the why I should include those file(s)/dirs you
are refering to.
Can you please tell me where  to find good information about the general
setup ?, as I find it still hard to find to find correct information about
the general J2EE application setup. I have a big J2EE book of SAMS, but
still haven't read it all.

Anyway, the server www.orionsupport.com is available again so I did read the
postgres article, but still isn't of much help.
I now have the following dir structure in my own home dir, so the
application isn't deployed n the sever.xml and default-web-site.xml files.
Is that a problem ?:
$HOME/META-INF/application.xml (contains only a description for now)
$HOME/META-INF/ejb-jar.xml, contains:
---
<ejb-jar>
 <description>  Postgres connection</description>
 <enterprise-beans>
       <resource-ref>
         <description>JDBC Connection</description>
         <res-ref-name>jdbc/postgresPooledDS</res-ref-name>
         <res-type>java.sql.Datasource</res-type>
         <res-auth>Container</res-auth>
       </resource-ref>
 </enterprise-beans>
</ejb-jar>
----
$HOME/public-html/WEB-INF/web.xml (standard, nothing special)
$HOME/public-html/WEB-INF/classes/ (servlet dir).

Anyway:
- What is going wrong here ? Where does it start to look for the ejb
postgresPooledDS ? For me, the process of defining/register the datasource
and using/calling it, is unclear now, please some help.
- BTW: I have to do the same trick for MySql, I hope this is the same thing?
- I also noticed that you can set a JNDI -> URI mapping in the J2SDKEE
config dir (the "jdbc.datasources" property). Musn't I do something with
that ?

Regards,
Ed Bras



Reply via email to