For Programmers: Free Programming Magazines  


Home > Archive > Java Beans > May 2006 > [HELP] Netbeans EJB with 2 Databases problem









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author [HELP] Netbeans EJB with 2 Databases problem
julien

2006-05-25, 8:10 am

Hi,

I'm a french student and i have an EJB Project.

I have a little problem.

I have two EJB entity linked to 2 postgresql database.

I explain my problem. In the file sun-ejb-jar.xml, you must specify the
JNDI name (CMP resource). But I have 2 resource name :
"etud_einstrumentation" and "etud_journal" for my 2 EJB. So i can just
specify one. Theferore, when i deploy my EJB, i can access to only one
(only the ejb specified in JNDI name works).

If I specify "etud_einstrumentation" in the field, the EJB linked to
the database etud_einstrumentation works and the other say :

NestedException: org.postgresql.util.PSQLException: ERROR: relation
"etud_journal" does not exist



If I specify "etud_journal" in the field, the EJB linked to the
database etud_journalworks and the other say :

NestedException: org.postgresql.util.PSQLException: ERROR: relation
"etud_einstrumentation " does not exist



You have an idea to specify the two JNDI resource ?

Tks

Frank Langelage

2006-05-25, 8:10 am

julien wrote:
> Hi,
>
> I'm a french student and i have an EJB Project.
>
> I have a little problem.
>
> I have two EJB entity linked to 2 postgresql database.
>
> I explain my problem. In the file sun-ejb-jar.xml, you must specify the
> JNDI name (CMP resource). But I have 2 resource name :
> "etud_einstrumentation" and "etud_journal" for my 2 EJB. So i can just
> specify one. Theferore, when i deploy my EJB, i can access to only one
> (only the ejb specified in JNDI name works).
>


You'll have to build two ejb.jar file, one for database one with the
entity accessing this database and one for database two with the other
entity.
Then you put both together in one ear file and deploy this.
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com