You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@geronimo.apache.org by ivanrc <ir...@indra.es> on 2007/10/24 10:19:03 UTC

EJB CMP + Database Pools config

Hi,

 I want to deploy EJB CMP. The EJB is deployed well, but I obtain by logs
this lines about dababase pool that I want to use:

10:06:58,154 WARN  [ResourceRefBuilder] Failed to build reference to
resource reference [jdbc/gsePool] defined in plan file, reason -
corresponding entry in deployment descriptor missing.

In openejb-jar.xml,  this is the Entity tag´s resource-ref: 

<resource-ref>
        <ref-name>jdbc/gsePool</ref-name>
        <resource-link>gsePool</resource-link>
</resource-ref>

I can connect remotedly to EJB but I don´t obtain elements from DB.

Could anyone help me?.Thanks




OPENEJB-JAR.XML

<?xml version="1.0" encoding="UTF-8"?>
<openejb-jar
		xmlns="http://www.openejb.org/xml/ns/openejb-jar-2.1"
		xmlns:nam="http://geronimo.apache.org/xml/ns/naming-1.1"
		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.2">
	
	<sys:environment>
		<sys:moduleId>
			<sys:groupId>default</sys:groupId>
			<sys:artifactId>EstadoAlarmaBean</sys:artifactId>
			<sys:version>1.31</sys:version>
			<sys:type>jar</sys:type>
		</sys:moduleId>
	</sys:environment>
   <enterprise-beans>
	<entity>
		<ejb-name>EstadoAlarmaBean</ejb-name>
		<jndi-name>EstadoAlarma</jndi-name>
        <table-name>CRC_GSE_ALAR_ESTADO_ALARMA</table-name>
		<cmp-field-mapping>
			<cmp-field-name>estadoAlarma</cmp-field-name>
			<table-column>ESTADO_ALARMA_TP</table-column>
		</cmp-field-mapping>
		<cmp-field-mapping>
			<cmp-field-name>estadoAlarmaGIA</cmp-field-name>
			<table-column>ESTADO_ALARMA_GIA_NU</table-column>
		</cmp-field-mapping>
		<resource-ref>
            <ref-name>jdbc/gsePool</ref-name>
            <resource-link>gsePool</resource-link>
        </resource-ref>
	</entity>
  </enterprise-beans>
</openejb-jar>

EJB-JAR-XML

<?xml version="1.0" encoding="UTF-8"?>
<ejb-jar xmlns="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/ejb-jar_2_1.xsd" version="2.1">
 
   <enterprise-beans>
      <entity>
            <display-name></display-name>
            <ejb-name>EstadoAlarmaBean</ejb-name>
           
<home>com.indra.gse.server.ejb.estadoalarma.EstadoAlarmaHome</home>
           
<remote>com.indra.gse.server.ejb.estadoalarma.EstadoAlarma</remote>
           
<local-home>com.indra.gse.server.ejb.estadoalarma.EstadoAlarmaLocalHome</local-home>
           
<local>com.indra.gse.server.ejb.estadoalarma.EstadoAlarmaLocal</local>
           
<ejb-class>com.indra.gse.server.ejb.estadoalarma.EstadoAlarmaBean</ejb-class>
            <persistence-type>Container</persistence-type>
            <prim-key-class>java.lang.String</prim-key-class>
            <reentrant>False</reentrant>
            <cmp-version>2.x</cmp-version>
            <abstract-schema-name>EstadoAlarmaBean</abstract-schema-name>
            <cmp-field>
                <field-name>estadoAlarma</field-name>
            </cmp-field>
            <cmp-field>
                <field-name>estadoAlarmaGIA</field-name>
            </cmp-field>
            <primkey-field>estadoAlarma</primkey-field>
            <query>
                <query-method>
                    <method-name>findAll</method-name>
                    <method-params/>
                </query-method>
                <ejb-ql>SELECT OBJECT(o) FROM EstadoAlarmaBean as o ORDER BY
o.estadoAlarma</ejb-ql>
            </query>
        </entity>
   </enterprise-beans>
</ejb-jar>



-- 
View this message in context: http://www.nabble.com/EJB-CMP-%2B-Database-Pools-config-tf4682861s134.html#a13381206
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.


Re: EJB CMP + Database Pools config

Posted by David Jencks <da...@yahoo.com>.
2nd try... apparently first try was rejected as spam???
On Oct 24, 2007, at 5:27 AM, Viet Nguyen wrote:

>
>
> On 10/24/07, ivanrc <ir...@indra.es> wrote:
> Hi,
>
> I want to deploy EJB CMP. The EJB is deployed well, but I obtain by  
> logs
> this lines about dababase pool that I want to use:
>
> 10:06:58,154 WARN  [ResourceRefBuilder] Failed to build reference to
> resource reference [jdbc/gsePool] defined in plan file, reason -
> corresponding entry in deployment descriptor missing.
>
> In openejb-jar.xml,  this is the Entity tag´s resource-ref:
>
> <resource-ref>
>         <ref-name>jdbc/gsePool</ref-name>
>         <resource-link>gsePool</resource-link>
> </resource-ref>
>
> I can connect remotedly to EJB but I don´t obtain elements from DB.
>
> Could anyone help me?.Thanks
>
>
>
>
> OPENEJB-JAR.XML
>
> <?xml version="1.0" encoding="UTF-8"?>
> <openejb-jar
>                 xmlns="http://www.openejb.org/xml/ns/openejb-jar-2.1 "
>                 xmlns:nam="http://geronimo.apache.org/xml/ns/ 
> naming-1.1"
>                 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.2">
>
>         <sys:environment>
>                 <sys:moduleId>
>                         <sys:groupId>default</sys:groupId>
>                         <sys:artifactId>EstadoAlarmaBean</ 
> sys:artifactId>
>                         <sys:version>1.31</sys:version>
>                         <sys:type>jar</sys:type>
>                 </sys:moduleId>
>         </sys:environment>
>    <enterprise-beans>
>         <entity>
>                 <ejb-name>EstadoAlarmaBean</ejb-name>
>                 <jndi-name>EstadoAlarma</jndi-name>
>         <table-name>CRC_GSE_ALAR_ESTADO_ALARMA</table-name>
>                 <cmp-field-mapping>
>                         <cmp-field-name>estadoAlarma</cmp-field-name>
>                         <table-column>ESTADO_ALARMA_TP</table-column>
>                 </cmp-field-mapping>
>                 <cmp-field-mapping>
>                         <cmp-field-name>estadoAlarmaGIA</cmp-field- 
> name>
>                         <table-column>ESTADO_ALARMA_GIA_NU</table- 
> column>
>                 </cmp-field-mapping>
>                 <resource-ref>
>             <ref-name>jdbc/gsePool</ref-name>
>             <resource-link>gsePool</resource-link>
>         </resource-ref>
>         </entity>
>   </enterprise-beans>
> </openejb-jar>
>
> EJB-JAR-XML
>
> <?xml version="1.0" encoding="UTF-8"?>
> <ejb-jar xmlns=" 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/ejb-jar_2_1.xsd" version="2.1">
>
>    <enterprise-beans>
>       <entity>
>             <display-name></display-name>
>             <ejb-name>EstadoAlarmaBean</ejb-name>
>
> <home>com.indra.gse.server.ejb.estadoalarma.EstadoAlarmaHome</home>
>
> <remote>com.indra.gse.server.ejb.estadoalarma.EstadoAlarma</remote>
>
> <local- 
> home>com.indra.gse.server.ejb.estadoalarma.EstadoAlarmaLocalHome</ 
> local-home>
>
> <local>com.indra.gse.server.ejb.estadoalarma.EstadoAlarmaLocal </ 
> local>
>
> <ejb-class>com.indra.gse.server.ejb.estadoalarma.EstadoAlarmaBean</ 
> ejb-class>
>             <persistence-type>Container</persistence-type>
>             <prim-key-class> java.lang.String</prim-key-class>
>             <reentrant>False</reentrant>
>             <cmp-version>2.x</cmp-version>
>             <abstract-schema-name>EstadoAlarmaBean</abstract-schema- 
> name>
>             <cmp-field>
>                 <field-name>estadoAlarma</field-name>
>             </cmp-field>
>             <cmp-field>
>                 <field-name>estadoAlarmaGIA</field-name>
>             </cmp-field>
>             <primkey-field>estadoAlarma</primkey-field>
>             <query>
>                 <query-method>
>                     <method-name>findAll</method-name>
>                     <method-params/>
>                 </query-method>
>                 <ejb-ql>SELECT OBJECT(o) FROM EstadoAlarmaBean as o  
> ORDER BY
> o.estadoAlarma</ejb-ql>
>             </query>
>
> Try adding this to the <entity> element in your ejb-jar.xml.
> <resource-ref>
> <!-- JNDI name -->
> <res-ref-name>gsePool</res-ref-name>
> <!-- Object type expected back from JNDI lookup -->
> <res-type>javax.sql.DataSource</res-type>
> <res-auth>Container</res-auth>
> </resource-ref>
> I have not tested this.
>
I think this would be more appropriate if they were BMP entity  
beans.  For CMP beans which don't use a resource-ref I think you need  
to specify the datasource for the cmp engine using a cmp-connection- 
factory element following these schema bits:

     <xsd:element name="cmp-connection-factory"
         type="gernaming:resource-locatorType">
         <xsd:annotation>
             <xsd:documentation>
                 The element cmp-connection-factory defines the  
connection pool
                 which will be used by CMP entity beans to connect to  
datasource.
                 This element will be used by openejb specifications.
             </xsd:documentation>
         </xsd:annotation>
     </xsd:element>
     <xsd:complexType name="resource-locatorType">
         <xsd:sequence>
             <xsd:choice>
                 <xsd:element name="pattern"  
type="gernaming:patternType">
                     <xsd:annotation>
                         <xsd:documentation>
                             The element pattern is used to provide  
additional
                             selection criterion for resources if  
multiple
                             resources with same resource-name exists in
                             dependency modules. The pattern mapped  
should result
                             in single resource.
                         </xsd:documentation>
                     </xsd:annotation>
                 </xsd:element>
                 <xsd:element name="resource-link" type="xsd:string">
                     <xsd:annotation>
                         <xsd:documentation>
                             The element resource-link is used to  
identify the
                             JDBC, JMS, or JavaMail resource  
specified in all the
                             dependency modules. This name should  
match the
                             connectiondefination-instance/name  
defined in
                             resource adapter deployment descriptor.  
If the name
                             is not unique the pattern element will  
be used to
                             uniquely identify this resource.
                         </xsd:documentation>
                     </xsd:annotation>
                 </xsd:element>
                 <xsd:element name="url" type="xsd:string">
                     <xsd:annotation>
                         <xsd:documentation>
                             The element url is used to identify the  
resources of
                             type java.net.URL deployed in all the  
dependency
                             modules. If the url doesn't map to  
unique resource
                             the pattern element will be used to  
uniquely
                             identify this resource.
                         </xsd:documentation>
                     </xsd:annotation>
                 </xsd:element>
             </xsd:choice>
         </xsd:sequence>
     </xsd:complexType>


Something like
<cmp-connection-factory>
   <resource-link>gsePool</resource-link>
</cmp-connection-factory>

ought to work.  This would go right after the <environment> element  
in your openejb-jar.xml plan

thanks
david jencks


> HTH,
> Viet
>         </entity>
>    </enterprise-beans>
> </ejb-jar>
>
>
>
> --
> View this message in context: http://www.nabble.com/EJB-CMP-%2B- 
> Database-Pools-config-tf4682861s134.html#a13381206
> Sent from the Apache Geronimo - Users mailing list archive at  
> Nabble.com.
>
>


Re: EJB CMP + Database Pools config

Posted by ivanrc <ir...@indra.es>.
I´ve changed the line that you´ve told me and I added both dependency and
cmp-connection-factory tags and finally work!! thank you.


openejb-jar.xml

<?xml version="1.0" encoding="UTF-8"?>
<openejb-jar
		xmlns="http://www.openejb.org/xml/ns/openejb-jar-2.1"
		xmlns:nam="http://geronimo.apache.org/xml/ns/naming-1.1"
		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.2">
	<sys:environment>
		<sys:moduleId>
			<sys:groupId>default</sys:groupId>
			<sys:artifactId>EstadoAlarmaBean</sys:artifactId>
			<sys:version>1.52</sys:version>
			<sys:type>jar</sys:type>
		</sys:moduleId>
		<sys:dependencies>
         <sys:dependency>
            <sys:groupId>console.dbpool</sys:groupId>
            <sys:artifactId>gsePool</sys:artifactId>
            <sys:version>1.0</sys:version>
            <sys:type>rar</sys:type>
         </sys:dependency>
      </sys:dependencies>
	</sys:environment> 
	<cmp-connection-factory>
      <resource-link>gsePool</resource-link>
   </cmp-connection-factory>

	
   <enterprise-beans>
	<entity>
		<ejb-name>EstadoAlarmaBean</ejb-name>
		<jndi-name>EstadoAlarma</jndi-name>
        <table-name>CRC_GSE_ALAR_ESTADO_ALARMA</table-name>
		<cmp-field-mapping>
			<cmp-field-name>estadoAlarma</cmp-field-name>
			<table-column>ESTADO_ALARMA_TP</table-column>
		</cmp-field-mapping>
		<cmp-field-mapping>
			<cmp-field-name>estadoAlarmaGIA</cmp-field-name>
			<table-column>ESTADO_ALARMA_GIA_NU</table-column>
		</cmp-field-mapping>
		<resource-ref>
        	<ref-name>jdbc/gsePool</ref-name>
        	<resource-link>gsePool</resource-link>
    </resource-ref> 
	</entity>
  </enterprise-beans>
</openejb-jar>

ejb-jar.xml

<?xml version="1.0" encoding="UTF-8"?>
<ejb-jar xmlns="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/ejb-jar_2_1.xsd" version="2.1">
 
   <enterprise-beans>
      <entity>
            <display-name></display-name>
            <ejb-name>EstadoAlarmaBean</ejb-name>
           
<home>com.indra.gse.server.ejb.estadoalarma.EstadoAlarmaHome</home>
           
<remote>com.indra.gse.server.ejb.estadoalarma.EstadoAlarma</remote>
           
<local-home>com.indra.gse.server.ejb.estadoalarma.EstadoAlarmaLocalHome</local-home>
           
<local>com.indra.gse.server.ejb.estadoalarma.EstadoAlarmaLocal</local>
           
<ejb-class>com.indra.gse.server.ejb.estadoalarma.EstadoAlarmaBean</ejb-class>
            <persistence-type>Container</persistence-type>
            <prim-key-class>java.lang.String</prim-key-class>
            <reentrant>False</reentrant>
            <cmp-version>2.x</cmp-version>
            <abstract-schema-name>EstadoAlarmaBean</abstract-schema-name>
            <cmp-field>
                <field-name>estadoAlarma</field-name>
            </cmp-field>
            <cmp-field>
                <field-name>estadoAlarmaGIA</field-name>
            </cmp-field>
            <primkey-field>estadoAlarma</primkey-field>
               
            <resource-ref>
		    	<res-ref-name>jdbc/gsePool</res-ref-name>
		    	<res-type>javax.sql.DataSource</res-type>
		    	<res-auth>Container</res-auth>
  			</resource-ref>
           
            <query>
                <query-method>
                    <method-name>findAll</method-name>
                    <method-params/>
                </query-method>
                <ejb-ql>SELECT OBJECT(o) FROM EstadoAlarmaBean as o ORDER BY
o.estadoAlarma</ejb-ql>
            	
            </query>
            
        </entity>
   </enterprise-beans>
</ejb-jar>















vhnguy2 wrote:
> 
> You might want to try
> 
> <res-ref-name>jdbc/gsePool</res-ref-name>
> 
> also. I am not sure what you named it. Can you post your database pool
> plan
> here too?
> 
> Thanks,
> Viet
> 
> On 10/24/07, ivanrc <ir...@indra.es> wrote:
>>
>>
>> I´ve added this lines and now I obtain this exception. I use
>> geronimo-tomcat6-jee5-2.0.1 version. Do you know what is the problem?
>>
>>
>> org.apache.geronimo.common.DeploymentException: Unable to resolve
>> resource
>> reference 'gsePool' (Could not auto-map to resource.  Try adding a
>> resource-ref mapping to your Geronimo deployment plan.
>> Search conducted in current module and dependencies:
>> [ALL: org.apache.geronimo.configs/openejb//car]
>> [ALL: org.apache.geronimo.configs/system-database//car]
>> [ALL: org.apache.geronimo.configs/tomcat6//car]
>> [ALL: org.apache.openejb/openejb-core//jar]
>> [ALL: org.apache.geronimo.modules/geronimo-openejb//jar]
>> [ALL: org.apache.geronimo.configs/openjpa//car]
>> [ALL: org.apache.geronimo.configs/j2ee-corba-yoko//car]
>> [ALL: org.apache.geronimo.configs/axis//car]
>> [ALL: org.apache.geronimo.configs/axis2//car]
>> )
>> org.apache.geronimo.common.DeploymentException:
>> org.apache.geronimo.common.DeploymentException: Unable to resolve
>> resource
>> reference 'gsePool' (Could not auto-map to resource.  Try adding a
>> resource-ref mapping to your Geronimo deployment plan.
>> Search conducted in current module and dependencies:
>> [ALL: org.apache.geronimo.configs/openejb//car]
>> [ALL: org.apache.geronimo.configs/system-database//car]
>> [ALL: org.apache.geronimo.configs/tomcat6//car]
>> [ALL: org.apache.openejb/openejb-core//jar]
>> [ALL: org.apache.geronimo.modules/geronimo-openejb//jar]
>> [ALL: org.apache.geronimo.configs/openjpa//car]
>> [ALL: org.apache.geronimo.configs/j2ee-corba-yoko//car]
>> [ALL: org.apache.geronimo.configs/axis//car]
>> [ALL: org.apache.geronimo.configs/axis2//car]
>>
>>
>>
>>
>>
>> vhnguy2 wrote:
>> >
>> > On 10/24/07, ivanrc <ir...@indra.es> wrote:
>> >>
>> >>
>> >> Hi,
>> >>
>> >> I want to deploy EJB CMP. The EJB is deployed well, but I obtain by
>> logs
>> >> this lines about dababase pool that I want to use:
>> >>
>> >> 10:06:58,154 WARN  [ResourceRefBuilder] Failed to build reference to
>> >> resource reference [jdbc/gsePool] defined in plan file, reason -
>> >> corresponding entry in deployment descriptor missing.
>> >>
>> >> In openejb-jar.xml,  this is the Entity tag´s resource-ref:
>> >>
>> >> <resource-ref>
>> >>         <ref-name>jdbc/gsePool</ref-name>
>> >>         <resource-link>gsePool</resource-link>
>> >> </resource-ref>
>> >>
>> >> I can connect remotedly to EJB but I don´t obtain elements from DB.
>> >>
>> >> Could anyone help me?.Thanks
>> >>
>> >>
>> >>
>> >>
>> >> OPENEJB-JAR.XML
>> >>
>> >> <?xml version="1.0" encoding="UTF-8"?>
>> >> <openejb-jar
>> >>                 xmlns="http://www.openejb.org/xml/ns/openejb-jar-2.1"
>> >>                
>> xmlns:nam="http://geronimo.apache.org/xml/ns/naming-1.1
>> "
>> >>                 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.2">
>> >>
>> >>         <sys:environment>
>> >>                 <sys:moduleId>
>> >>                         <sys:groupId>default</sys:groupId>
>> >>
>> <sys:artifactId>EstadoAlarmaBean</sys:artifactId>
>> >>                         <sys:version>1.31</sys:version>
>> >>                         <sys:type>jar</sys:type>
>> >>                 </sys:moduleId>
>> >>         </sys:environment>
>> >>    <enterprise-beans>
>> >>         <entity>
>> >>                 <ejb-name>EstadoAlarmaBean</ejb-name>
>> >>                 <jndi-name>EstadoAlarma</jndi-name>
>> >>         <table-name>CRC_GSE_ALAR_ESTADO_ALARMA</table-name>
>> >>                 <cmp-field-mapping>
>> >>                         <cmp-field-name>estadoAlarma</cmp-field-name>
>> >>                         <table-column>ESTADO_ALARMA_TP</table-column>
>> >>                 </cmp-field-mapping>
>> >>                 <cmp-field-mapping>
>> >>
>> <cmp-field-name>estadoAlarmaGIA</cmp-field-name>
>> >>
>> <table-column>ESTADO_ALARMA_GIA_NU</table-column>
>> >>                 </cmp-field-mapping>
>> >>                 <resource-ref>
>> >>             <ref-name>jdbc/gsePool</ref-name>
>> >>             <resource-link>gsePool</resource-link>
>> >>         </resource-ref>
>> >>         </entity>
>> >>   </enterprise-beans>
>> >> </openejb-jar>
>> >>
>> >> EJB-JAR-XML
>> >>
>> >> <?xml version="1.0" encoding="UTF-8"?>
>> >> <ejb-jar xmlns="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/ejb-jar_2_1.xsd" version="2.1">
>> >>
>> >>    <enterprise-beans>
>> >>       <entity>
>> >>             <display-name></display-name>
>> >>             <ejb-name>EstadoAlarmaBean</ejb-name>
>> >>
>> >> <home>com.indra.gse.server.ejb.estadoalarma.EstadoAlarmaHome</home>
>> >>
>> >> <remote>com.indra.gse.server.ejb.estadoalarma.EstadoAlarma</remote>
>> >>
>> >>
>> <local-home>com.indra.gse.server.ejb.estadoalarma.EstadoAlarmaLocalHome
>> >> </local-home>
>> >>
>> >> <local>com.indra.gse.server.ejb.estadoalarma.EstadoAlarmaLocal</local>
>> >>
>> >> <ejb-class>com.indra.gse.server.ejb.estadoalarma.EstadoAlarmaBean
>> >> </ejb-class>
>> >>             <persistence-type>Container</persistence-type>
>> >>             <prim-key-class>java.lang.String</prim-key-class>
>> >>             <reentrant>False</reentrant>
>> >>             <cmp-version>2.x</cmp-version>
>> >>
>> <abstract-schema-name>EstadoAlarmaBean</abstract-schema-name>
>> >>             <cmp-field>
>> >>                 <field-name>estadoAlarma</field-name>
>> >>             </cmp-field>
>> >>             <cmp-field>
>> >>                 <field-name>estadoAlarmaGIA</field-name>
>> >>             </cmp-field>
>> >>             <primkey-field>estadoAlarma</primkey-field>
>> >>             <query>
>> >>                 <query-method>
>> >>                     <method-name>findAll</method-name>
>> >>                     <method-params/>
>> >>                 </query-method>
>> >>                 <ejb-ql>SELECT OBJECT(o) FROM EstadoAlarmaBean as o
>> ORDER
>> >> BY
>> >> o.estadoAlarma</ejb-ql>
>> >>             </query>
>> >
>> >
>> > Try adding this to the <entity> element in your ejb-jar.xml.
>> >
>> >          <resource-ref>
>> >             <!-- JNDI name -->
>> >             <res-ref-name>gsePool</res-ref-name>
>> >             <!-- Object type expected back from JNDI lookup -->
>> >             <res-type>javax.sql.DataSource</res-type>
>> >             <res-auth>Container</res-auth>
>> >          </resource-ref>
>> >
>> > I have not tested this.
>> >
>> > HTH,
>> > Viet
>> >
>> >>         </entity>
>> >>    </enterprise-beans>
>> >> </ejb-jar>
>> >>
>> >>
>> >>
>> >> --
>> >> View this message in context:
>> >>
>> http://www.nabble.com/EJB-CMP-%2B-Database-Pools-config-tf4682861s134.html#a13381206
>> >> Sent from the Apache Geronimo - Users mailing list archive at
>> Nabble.com.
>> >>
>> >>
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/EJB-CMP-%2B-Database-Pool-config-tf4682861s134.html#a13384951
>> Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/EJB-CMP-%2B-Database-Pool-config-tf4682861s134.html#a13400864
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.


Re: EJB CMP + Database Pools config

Posted by Viet Nguyen <vh...@gmail.com>.
You might want to try

<res-ref-name>jdbc/gsePool</res-ref-name>

also. I am not sure what you named it. Can you post your database pool plan
here too?

Thanks,
Viet

On 10/24/07, ivanrc <ir...@indra.es> wrote:
>
>
> I´ve added this lines and now I obtain this exception. I use
> geronimo-tomcat6-jee5-2.0.1 version. Do you know what is the problem?
>
>
> org.apache.geronimo.common.DeploymentException: Unable to resolve resource
> reference 'gsePool' (Could not auto-map to resource.  Try adding a
> resource-ref mapping to your Geronimo deployment plan.
> Search conducted in current module and dependencies:
> [ALL: org.apache.geronimo.configs/openejb//car]
> [ALL: org.apache.geronimo.configs/system-database//car]
> [ALL: org.apache.geronimo.configs/tomcat6//car]
> [ALL: org.apache.openejb/openejb-core//jar]
> [ALL: org.apache.geronimo.modules/geronimo-openejb//jar]
> [ALL: org.apache.geronimo.configs/openjpa//car]
> [ALL: org.apache.geronimo.configs/j2ee-corba-yoko//car]
> [ALL: org.apache.geronimo.configs/axis//car]
> [ALL: org.apache.geronimo.configs/axis2//car]
> )
> org.apache.geronimo.common.DeploymentException:
> org.apache.geronimo.common.DeploymentException: Unable to resolve resource
> reference 'gsePool' (Could not auto-map to resource.  Try adding a
> resource-ref mapping to your Geronimo deployment plan.
> Search conducted in current module and dependencies:
> [ALL: org.apache.geronimo.configs/openejb//car]
> [ALL: org.apache.geronimo.configs/system-database//car]
> [ALL: org.apache.geronimo.configs/tomcat6//car]
> [ALL: org.apache.openejb/openejb-core//jar]
> [ALL: org.apache.geronimo.modules/geronimo-openejb//jar]
> [ALL: org.apache.geronimo.configs/openjpa//car]
> [ALL: org.apache.geronimo.configs/j2ee-corba-yoko//car]
> [ALL: org.apache.geronimo.configs/axis//car]
> [ALL: org.apache.geronimo.configs/axis2//car]
>
>
>
>
>
> vhnguy2 wrote:
> >
> > On 10/24/07, ivanrc <ir...@indra.es> wrote:
> >>
> >>
> >> Hi,
> >>
> >> I want to deploy EJB CMP. The EJB is deployed well, but I obtain by
> logs
> >> this lines about dababase pool that I want to use:
> >>
> >> 10:06:58,154 WARN  [ResourceRefBuilder] Failed to build reference to
> >> resource reference [jdbc/gsePool] defined in plan file, reason -
> >> corresponding entry in deployment descriptor missing.
> >>
> >> In openejb-jar.xml,  this is the Entity tag´s resource-ref:
> >>
> >> <resource-ref>
> >>         <ref-name>jdbc/gsePool</ref-name>
> >>         <resource-link>gsePool</resource-link>
> >> </resource-ref>
> >>
> >> I can connect remotedly to EJB but I don´t obtain elements from DB.
> >>
> >> Could anyone help me?.Thanks
> >>
> >>
> >>
> >>
> >> OPENEJB-JAR.XML
> >>
> >> <?xml version="1.0" encoding="UTF-8"?>
> >> <openejb-jar
> >>                 xmlns="http://www.openejb.org/xml/ns/openejb-jar-2.1"
> >>                 xmlns:nam="http://geronimo.apache.org/xml/ns/naming-1.1
> "
> >>                 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.2">
> >>
> >>         <sys:environment>
> >>                 <sys:moduleId>
> >>                         <sys:groupId>default</sys:groupId>
> >>
> <sys:artifactId>EstadoAlarmaBean</sys:artifactId>
> >>                         <sys:version>1.31</sys:version>
> >>                         <sys:type>jar</sys:type>
> >>                 </sys:moduleId>
> >>         </sys:environment>
> >>    <enterprise-beans>
> >>         <entity>
> >>                 <ejb-name>EstadoAlarmaBean</ejb-name>
> >>                 <jndi-name>EstadoAlarma</jndi-name>
> >>         <table-name>CRC_GSE_ALAR_ESTADO_ALARMA</table-name>
> >>                 <cmp-field-mapping>
> >>                         <cmp-field-name>estadoAlarma</cmp-field-name>
> >>                         <table-column>ESTADO_ALARMA_TP</table-column>
> >>                 </cmp-field-mapping>
> >>                 <cmp-field-mapping>
> >>
> <cmp-field-name>estadoAlarmaGIA</cmp-field-name>
> >>
> <table-column>ESTADO_ALARMA_GIA_NU</table-column>
> >>                 </cmp-field-mapping>
> >>                 <resource-ref>
> >>             <ref-name>jdbc/gsePool</ref-name>
> >>             <resource-link>gsePool</resource-link>
> >>         </resource-ref>
> >>         </entity>
> >>   </enterprise-beans>
> >> </openejb-jar>
> >>
> >> EJB-JAR-XML
> >>
> >> <?xml version="1.0" encoding="UTF-8"?>
> >> <ejb-jar xmlns="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/ejb-jar_2_1.xsd" version="2.1">
> >>
> >>    <enterprise-beans>
> >>       <entity>
> >>             <display-name></display-name>
> >>             <ejb-name>EstadoAlarmaBean</ejb-name>
> >>
> >> <home>com.indra.gse.server.ejb.estadoalarma.EstadoAlarmaHome</home>
> >>
> >> <remote>com.indra.gse.server.ejb.estadoalarma.EstadoAlarma</remote>
> >>
> >> <local-home>com.indra.gse.server.ejb.estadoalarma.EstadoAlarmaLocalHome
> >> </local-home>
> >>
> >> <local>com.indra.gse.server.ejb.estadoalarma.EstadoAlarmaLocal</local>
> >>
> >> <ejb-class>com.indra.gse.server.ejb.estadoalarma.EstadoAlarmaBean
> >> </ejb-class>
> >>             <persistence-type>Container</persistence-type>
> >>             <prim-key-class>java.lang.String</prim-key-class>
> >>             <reentrant>False</reentrant>
> >>             <cmp-version>2.x</cmp-version>
> >>
> <abstract-schema-name>EstadoAlarmaBean</abstract-schema-name>
> >>             <cmp-field>
> >>                 <field-name>estadoAlarma</field-name>
> >>             </cmp-field>
> >>             <cmp-field>
> >>                 <field-name>estadoAlarmaGIA</field-name>
> >>             </cmp-field>
> >>             <primkey-field>estadoAlarma</primkey-field>
> >>             <query>
> >>                 <query-method>
> >>                     <method-name>findAll</method-name>
> >>                     <method-params/>
> >>                 </query-method>
> >>                 <ejb-ql>SELECT OBJECT(o) FROM EstadoAlarmaBean as o
> ORDER
> >> BY
> >> o.estadoAlarma</ejb-ql>
> >>             </query>
> >
> >
> > Try adding this to the <entity> element in your ejb-jar.xml.
> >
> >          <resource-ref>
> >             <!-- JNDI name -->
> >             <res-ref-name>gsePool</res-ref-name>
> >             <!-- Object type expected back from JNDI lookup -->
> >             <res-type>javax.sql.DataSource</res-type>
> >             <res-auth>Container</res-auth>
> >          </resource-ref>
> >
> > I have not tested this.
> >
> > HTH,
> > Viet
> >
> >>         </entity>
> >>    </enterprise-beans>
> >> </ejb-jar>
> >>
> >>
> >>
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/EJB-CMP-%2B-Database-Pools-config-tf4682861s134.html#a13381206
> >> Sent from the Apache Geronimo - Users mailing list archive at
> Nabble.com.
> >>
> >>
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/EJB-CMP-%2B-Database-Pool-config-tf4682861s134.html#a13384951
> Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.
>
>

Re: EJB CMP + Database Pools config

Posted by ivanrc <ir...@indra.es>.
I´ve added this lines and now I obtain this exception. I use
geronimo-tomcat6-jee5-2.0.1 version. Do you know what is the problem?


org.apache.geronimo.common.DeploymentException: Unable to resolve resource
reference 'gsePool' (Could not auto-map to resource.  Try adding a
resource-ref mapping to your Geronimo deployment plan.
Search conducted in current module and dependencies:
[ALL: org.apache.geronimo.configs/openejb//car]
[ALL: org.apache.geronimo.configs/system-database//car]
[ALL: org.apache.geronimo.configs/tomcat6//car]
[ALL: org.apache.openejb/openejb-core//jar]
[ALL: org.apache.geronimo.modules/geronimo-openejb//jar]
[ALL: org.apache.geronimo.configs/openjpa//car]
[ALL: org.apache.geronimo.configs/j2ee-corba-yoko//car]
[ALL: org.apache.geronimo.configs/axis//car]
[ALL: org.apache.geronimo.configs/axis2//car]
)
org.apache.geronimo.common.DeploymentException:
org.apache.geronimo.common.DeploymentException: Unable to resolve resource
reference 'gsePool' (Could not auto-map to resource.  Try adding a
resource-ref mapping to your Geronimo deployment plan.
Search conducted in current module and dependencies:
[ALL: org.apache.geronimo.configs/openejb//car]
[ALL: org.apache.geronimo.configs/system-database//car]
[ALL: org.apache.geronimo.configs/tomcat6//car]
[ALL: org.apache.openejb/openejb-core//jar]
[ALL: org.apache.geronimo.modules/geronimo-openejb//jar]
[ALL: org.apache.geronimo.configs/openjpa//car]
[ALL: org.apache.geronimo.configs/j2ee-corba-yoko//car]
[ALL: org.apache.geronimo.configs/axis//car]
[ALL: org.apache.geronimo.configs/axis2//car]





vhnguy2 wrote:
> 
> On 10/24/07, ivanrc <ir...@indra.es> wrote:
>>
>>
>> Hi,
>>
>> I want to deploy EJB CMP. The EJB is deployed well, but I obtain by logs
>> this lines about dababase pool that I want to use:
>>
>> 10:06:58,154 WARN  [ResourceRefBuilder] Failed to build reference to
>> resource reference [jdbc/gsePool] defined in plan file, reason -
>> corresponding entry in deployment descriptor missing.
>>
>> In openejb-jar.xml,  this is the Entity tag´s resource-ref:
>>
>> <resource-ref>
>>         <ref-name>jdbc/gsePool</ref-name>
>>         <resource-link>gsePool</resource-link>
>> </resource-ref>
>>
>> I can connect remotedly to EJB but I don´t obtain elements from DB.
>>
>> Could anyone help me?.Thanks
>>
>>
>>
>>
>> OPENEJB-JAR.XML
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <openejb-jar
>>                 xmlns="http://www.openejb.org/xml/ns/openejb-jar-2.1"
>>                 xmlns:nam="http://geronimo.apache.org/xml/ns/naming-1.1"
>>                 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.2">
>>
>>         <sys:environment>
>>                 <sys:moduleId>
>>                         <sys:groupId>default</sys:groupId>
>>                         <sys:artifactId>EstadoAlarmaBean</sys:artifactId>
>>                         <sys:version>1.31</sys:version>
>>                         <sys:type>jar</sys:type>
>>                 </sys:moduleId>
>>         </sys:environment>
>>    <enterprise-beans>
>>         <entity>
>>                 <ejb-name>EstadoAlarmaBean</ejb-name>
>>                 <jndi-name>EstadoAlarma</jndi-name>
>>         <table-name>CRC_GSE_ALAR_ESTADO_ALARMA</table-name>
>>                 <cmp-field-mapping>
>>                         <cmp-field-name>estadoAlarma</cmp-field-name>
>>                         <table-column>ESTADO_ALARMA_TP</table-column>
>>                 </cmp-field-mapping>
>>                 <cmp-field-mapping>
>>                         <cmp-field-name>estadoAlarmaGIA</cmp-field-name>
>>                         <table-column>ESTADO_ALARMA_GIA_NU</table-column>
>>                 </cmp-field-mapping>
>>                 <resource-ref>
>>             <ref-name>jdbc/gsePool</ref-name>
>>             <resource-link>gsePool</resource-link>
>>         </resource-ref>
>>         </entity>
>>   </enterprise-beans>
>> </openejb-jar>
>>
>> EJB-JAR-XML
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <ejb-jar xmlns="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/ejb-jar_2_1.xsd" version="2.1">
>>
>>    <enterprise-beans>
>>       <entity>
>>             <display-name></display-name>
>>             <ejb-name>EstadoAlarmaBean</ejb-name>
>>
>> <home>com.indra.gse.server.ejb.estadoalarma.EstadoAlarmaHome</home>
>>
>> <remote>com.indra.gse.server.ejb.estadoalarma.EstadoAlarma</remote>
>>
>> <local-home>com.indra.gse.server.ejb.estadoalarma.EstadoAlarmaLocalHome
>> </local-home>
>>
>> <local>com.indra.gse.server.ejb.estadoalarma.EstadoAlarmaLocal</local>
>>
>> <ejb-class>com.indra.gse.server.ejb.estadoalarma.EstadoAlarmaBean
>> </ejb-class>
>>             <persistence-type>Container</persistence-type>
>>             <prim-key-class>java.lang.String</prim-key-class>
>>             <reentrant>False</reentrant>
>>             <cmp-version>2.x</cmp-version>
>>             <abstract-schema-name>EstadoAlarmaBean</abstract-schema-name>
>>             <cmp-field>
>>                 <field-name>estadoAlarma</field-name>
>>             </cmp-field>
>>             <cmp-field>
>>                 <field-name>estadoAlarmaGIA</field-name>
>>             </cmp-field>
>>             <primkey-field>estadoAlarma</primkey-field>
>>             <query>
>>                 <query-method>
>>                     <method-name>findAll</method-name>
>>                     <method-params/>
>>                 </query-method>
>>                 <ejb-ql>SELECT OBJECT(o) FROM EstadoAlarmaBean as o ORDER
>> BY
>> o.estadoAlarma</ejb-ql>
>>             </query>
> 
> 
> Try adding this to the <entity> element in your ejb-jar.xml.
> 
>          <resource-ref>
>             <!-- JNDI name -->
>             <res-ref-name>gsePool</res-ref-name>
>             <!-- Object type expected back from JNDI lookup -->
>             <res-type>javax.sql.DataSource</res-type>
>             <res-auth>Container</res-auth>
>          </resource-ref>
> 
> I have not tested this.
> 
> HTH,
> Viet
> 
>>         </entity>
>>    </enterprise-beans>
>> </ejb-jar>
>>
>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/EJB-CMP-%2B-Database-Pools-config-tf4682861s134.html#a13381206
>> Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/EJB-CMP-%2B-Database-Pool-config-tf4682861s134.html#a13384951
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.


Re: EJB CMP + Database Pools config

Posted by Viet Nguyen <vh...@gmail.com>.
On 10/24/07, ivanrc <ir...@indra.es> wrote:
>
>
> Hi,
>
> I want to deploy EJB CMP. The EJB is deployed well, but I obtain by logs
> this lines about dababase pool that I want to use:
>
> 10:06:58,154 WARN  [ResourceRefBuilder] Failed to build reference to
> resource reference [jdbc/gsePool] defined in plan file, reason -
> corresponding entry in deployment descriptor missing.
>
> In openejb-jar.xml,  this is the Entity tag´s resource-ref:
>
> <resource-ref>
>         <ref-name>jdbc/gsePool</ref-name>
>         <resource-link>gsePool</resource-link>
> </resource-ref>
>
> I can connect remotedly to EJB but I don´t obtain elements from DB.
>
> Could anyone help me?.Thanks
>
>
>
>
> OPENEJB-JAR.XML
>
> <?xml version="1.0" encoding="UTF-8"?>
> <openejb-jar
>                 xmlns="http://www.openejb.org/xml/ns/openejb-jar-2.1"
>                 xmlns:nam="http://geronimo.apache.org/xml/ns/naming-1.1"
>                 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.2">
>
>         <sys:environment>
>                 <sys:moduleId>
>                         <sys:groupId>default</sys:groupId>
>                         <sys:artifactId>EstadoAlarmaBean</sys:artifactId>
>                         <sys:version>1.31</sys:version>
>                         <sys:type>jar</sys:type>
>                 </sys:moduleId>
>         </sys:environment>
>    <enterprise-beans>
>         <entity>
>                 <ejb-name>EstadoAlarmaBean</ejb-name>
>                 <jndi-name>EstadoAlarma</jndi-name>
>         <table-name>CRC_GSE_ALAR_ESTADO_ALARMA</table-name>
>                 <cmp-field-mapping>
>                         <cmp-field-name>estadoAlarma</cmp-field-name>
>                         <table-column>ESTADO_ALARMA_TP</table-column>
>                 </cmp-field-mapping>
>                 <cmp-field-mapping>
>                         <cmp-field-name>estadoAlarmaGIA</cmp-field-name>
>                         <table-column>ESTADO_ALARMA_GIA_NU</table-column>
>                 </cmp-field-mapping>
>                 <resource-ref>
>             <ref-name>jdbc/gsePool</ref-name>
>             <resource-link>gsePool</resource-link>
>         </resource-ref>
>         </entity>
>   </enterprise-beans>
> </openejb-jar>
>
> EJB-JAR-XML
>
> <?xml version="1.0" encoding="UTF-8"?>
> <ejb-jar xmlns="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/ejb-jar_2_1.xsd" version="2.1">
>
>    <enterprise-beans>
>       <entity>
>             <display-name></display-name>
>             <ejb-name>EstadoAlarmaBean</ejb-name>
>
> <home>com.indra.gse.server.ejb.estadoalarma.EstadoAlarmaHome</home>
>
> <remote>com.indra.gse.server.ejb.estadoalarma.EstadoAlarma</remote>
>
> <local-home>com.indra.gse.server.ejb.estadoalarma.EstadoAlarmaLocalHome
> </local-home>
>
> <local>com.indra.gse.server.ejb.estadoalarma.EstadoAlarmaLocal</local>
>
> <ejb-class>com.indra.gse.server.ejb.estadoalarma.EstadoAlarmaBean
> </ejb-class>
>             <persistence-type>Container</persistence-type>
>             <prim-key-class>java.lang.String</prim-key-class>
>             <reentrant>False</reentrant>
>             <cmp-version>2.x</cmp-version>
>             <abstract-schema-name>EstadoAlarmaBean</abstract-schema-name>
>             <cmp-field>
>                 <field-name>estadoAlarma</field-name>
>             </cmp-field>
>             <cmp-field>
>                 <field-name>estadoAlarmaGIA</field-name>
>             </cmp-field>
>             <primkey-field>estadoAlarma</primkey-field>
>             <query>
>                 <query-method>
>                     <method-name>findAll</method-name>
>                     <method-params/>
>                 </query-method>
>                 <ejb-ql>SELECT OBJECT(o) FROM EstadoAlarmaBean as o ORDER
> BY
> o.estadoAlarma</ejb-ql>
>             </query>


Try adding this to the <entity> element in your ejb-jar.xml.

         <resource-ref>
            <!-- JNDI name -->
            <res-ref-name>gsePool</res-ref-name>
            <!-- Object type expected back from JNDI lookup -->
            <res-type>javax.sql.DataSource</res-type>
            <res-auth>Container</res-auth>
         </resource-ref>

I have not tested this.

HTH,
Viet

>         </entity>
>    </enterprise-beans>
> </ejb-jar>
>
>
>
> --
> View this message in context:
> http://www.nabble.com/EJB-CMP-%2B-Database-Pools-config-tf4682861s134.html#a13381206
> Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.
>
>