geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gianny Damour <gianny.dam...@optusnet.com.au>
Subject Re: Help with CMP Entity Bean
Date Sat, 18 Mar 2006 23:24:01 GMT
Olivier Voutat wrote:

> Well,
>
> I'm trying to create a simple application with a Cmp Entity Bean but 
> I'm missing how I should do the Database connection tags. My database 
> pool is already deployed and working. Here are my ejb-jar.xml and 
> openejb-jar.xml :
>
> <?xml version="1.0" encoding="UTF-8"?>
> <ejb-jar id="ejb-jar_ID" version="2.1" 
> xmlns="http://java.sun.com/xml/ns/j2ee 
> <http://java.sun.com/xml/ns/j2ee>" 
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
> xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee 
> <http://java.sun.com/xml/ns/j2ee> 
> http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd">
>     <display-name>ProdutoCmp</display-name>
>     <enterprise-beans>

<...>

> <?xml version="1.0" encoding="UTF-8"?>
> <openejb-jar xmlns=" http://www.openejb.org/xml/ns/openejb-jar-2.0" 
> xmlns:nam="http://geronimo.apache.org/xml/ns/naming-1.0" xmlns:pkgen=" 
> http://www.openejb.org/xml/ns/pkgen-2.0" 
> xmlns:sec="http://geronimo.apache.org/xml/ns/security-1.1" xmlns:sys=" 
> http://geronimo.apache.org/xml/ns/deployment-1.0" 
> configId="ProdutoCmp/ProdutoCmp">
>     <cmp-connection-factory>
>         <resource-link>ProdutoCmp</resource-link>
>     </cmp-connection-factory>

If the database pool is already deployed, i.e. not deployed at the same 
time than your EJB module within an EAR, then you cannot use the 
resource-link tag. This tag allows you to point to a 
connectiondefinition-instance defined in the same EAR module than your 
EJB moduler (this is more or less like the ejb-link mechanism).

In your case, you need to use a 
http://geronimo.apache.org/xml/ns/naming-1.0:objectNameGroup (have a 
look to geronimo-naming-1.0.xsd for more details). I think that you want 
something like this:
    <cmp-connection-factory>
        <application><the name of the EAR module defining the RAR - null 
if the RAR was deployed as a standalone module></application>
        <module><name of the RAR module></module>
        <name><name of the connectiondefinition-instance>.</name>
    </cmp-connection-factory>

Thanks,
Gianny


Mime
View raw message