Return-Path: Delivered-To: apmail-geronimo-user-archive@www.apache.org Received: (qmail 72323 invoked from network); 3 Jul 2007 12:00:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 3 Jul 2007 12:00:18 -0000 Received: (qmail 33800 invoked by uid 500); 3 Jul 2007 12:00:11 -0000 Delivered-To: apmail-geronimo-user-archive@geronimo.apache.org Received: (qmail 33773 invoked by uid 500); 3 Jul 2007 12:00:11 -0000 Mailing-List: contact user-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: user@geronimo.apache.org List-Id: Delivered-To: mailing list user@geronimo.apache.org Received: (qmail 33725 invoked by uid 99); 3 Jul 2007 12:00:11 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Jul 2007 05:00:11 -0700 X-ASF-Spam-Status: No, hits=3.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS,WEIRD_QUOTING X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of shivahr@gmail.com designates 66.249.92.171 as permitted sender) Received: from [66.249.92.171] (HELO ug-out-1314.google.com) (66.249.92.171) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Jul 2007 05:00:07 -0700 Received: by ug-out-1314.google.com with SMTP id 44so82643uga for ; Tue, 03 Jul 2007 04:59:46 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=ccE7w28HuDbBZtqqYAP1jCaFm8/43VOgO2TqrNbmcaRIjTOG3IUdnwoQeLz955zscQOdQcaIoX0U+/LZcGdSopYZr8XeUFeQnbm4GiXIq3d7c3eqFqG1SW7GJa9PlUBEby9wOk5GLfuMb7BX7mKcGTfLF9srRngJKQfWiyyVt+Y= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=Z//gF9frGZ5/kixcsDLpAd90fLZRxsV/4VUX7aD2QmMA7zSrN/AQntxfXubu5XNBbAtNtUPwFMr/hw+OL0w2xy+58tX2rvznUfT2zfDQ1pv96xy03COWXc+Au+ATrdVHoVxNQAM6JnYGzMuvxa7UI2SHn5qra37OnruqGlJmlmE= Received: by 10.78.130.6 with SMTP id c6mr3486979hud.1183463985551; Tue, 03 Jul 2007 04:59:45 -0700 (PDT) Received: by 10.78.138.8 with HTTP; Tue, 3 Jul 2007 04:59:45 -0700 (PDT) Message-ID: <5da94e5a0707030459w2904cfb9p8676cfd6ada35f4d@mail.gmail.com> Date: Tue, 3 Jul 2007 17:29:45 +0530 From: "Shiva Kumar H R" To: user@geronimo.apache.org Subject: Re: Can't connect to ConnectionFactory, need resource-ref? In-Reply-To: <200707031153.18241.francisco@x-hive.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_69947_11302301.1183463985527" References: <200707031153.18241.francisco@x-hive.com> X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_69947_11302301.1183463985527 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Comments inline. On 7/3/07, Francisco Borges wrote: > > Hello, > > I'm trying to port this J2EE module to Geronimo1.2, but I'm not familiar > with EJB's, so I might be missing something obvious. > > [...] > > I managed to deploy both our resource adapter to a connection factory (as > a RAR file), and our sample session (JAR+EJB). > > I can start running the sample, but from it I can't get a connection to > the ConnectionFactory. > > From "12.3.6 Resolving References from EJBs" at > > I gather that on Geronimo (differently from JBoss) after deploying the > RAR, in order to be able to find it from my sample app, I need to declare > it as a resource-ref at the sample's "openejb-jar.xml" and "ejb-jar.xml". > Is this correct? Yes If so, how should I do this? I managed to declare a resource-ref on > openejb-jar.xml, but not on the ejb-jar.xml. > > On the openejb-jar.xml, I have: > > """" > > XhiveSampleSessionBean > com.xhive.ejb.XhiveSampleSessionEJB > > ejb/XhiveDS > XhiveDS > > > """" is not the element to be used. Please use as below: XhiveSampleSessionBean com.xhive.ejb.XhiveSampleSessionEJB jdbc/XhiveDS XhiveDS What should I add to ejb-jar.xml? > > I've tried adding something like > """ > > XhiveSampleSessionBean > [....] > > ejb/XhiveDS > > > com.xhive.j2ee.connector.interfaces.XhiveCCIConnectionFactoryIf > > > > """ JNDI namespace for datasources should ideally be jdbc. Try changing to "jdbc/XhiveDS" (plus update jndi lookup code in your ejbs) as below, in sync with in openejb-jar.xml, and see if it solves the problem. jdbc/XhiveDS com.xhive.j2ee.connector.interfaces.XhiveCCIConnectionFactoryIf Container Shareable But with this last change the Sample EJB won't deploy. For clarity, I'm > attaching the 4 xml files I'm using for RAR and EJB+JAR deployment. > > Any hints, or tips are heartily appreciated, If this doesn't solve, do post the errors you are seeing while deploying/running. Cheers, > -- > Francisco Borges - Shiva ------=_Part_69947_11302301.1183463985527 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Comments inline.

On 7/3/07, Francisco Borges <francisco@x-hive.com> wrote:
Hello,

I'm trying to port this J2EE module to Geronimo1.2, but I'm not familiar
with EJB's, so I might be missing something obvious.

[...]

I managed to deploy both our resource adapter to a connection factory (as
a RAR file), and our sample session (JAR+EJB).

I can start running the sample, but from it I can't get a connection to
the ConnectionFactory.

From "12.3.6 Resolving References from EJBs" at
<http://www.chariotsolutions.com/geronimo/geronimo-1.1/ejb-structure.html>
I gather that on Geronimo (differently from JBoss) after deploying the
RAR, in order to be able to find it from my sample app, I need to declare
it as a resource-ref at the sample's "openejb-jar.xml" and "ejb-jar.xml".
Is this correct?

Yes

If so, how should I do this? I managed to declare a resource-ref on
openejb-jar.xml , but not on the ejb-jar.xml.

On the openejb-jar.xml, I have:

""""
      <session>
         <ejb-name>XhiveSampleSessionBean</ejb-name>
         <jndi-name> com.xhive.ejb.XhiveSampleSessionEJB</jndi-name>
         <ejb-ref>
            <ref-name>ejb/XhiveDS</ref-name>
            <ejb-link>XhiveDS</ejb-link>
         </ejb-ref>
      </session>
""""

<ejb-ref> is not the element to be used. Please use <resource-ref> as below:

      <session>
         <ejb-name>XhiveSampleSessionBean</ejb-name>
         <jndi-name>com.xhive.ejb.XhiveSampleSessionEJB</jndi-name>
         <nam:resource-ref xmlns:nam="http://geronimo.apache.org/xml/ns/naming-1.2 ">
            <ref-name>jdbc/XhiveDS</ref-name>
            <ref-link>XhiveDS</ref-link>
         </nam:resource-ref>
      </session>

What should I add to ejb-jar.xml?

I've tried adding something like
"""
    <session>
      <ejb-name>XhiveSampleSessionBean</ejb-name>
        [....]
      <resource-ref>
              <res-ref-name>ejb/XhiveDS</res-ref-name>
             <res-type>
                        com.xhive.j2ee.connector.interfaces.XhiveCCIConnectionFactoryIf
            </res-type>
     </resource-ref>
     </session>
"""

JNDI namespace for datasources should ideally be jdbc. Try changing <res-ref-name> to "jdbc/XhiveDS" (plus update jndi lookup code in your ejbs) as below, in sync with <ref-name> in openejb-jar.xml, and see if it solves the problem.

     <resource-ref>
       <res-ref-name>jdbc/XhiveDS</res-ref-name>
       <res-type>
         com.xhive.j2ee.connector.interfaces.XhiveCCIConnectionFactoryIf
       </res-type>
       <res-auth>Container</res-auth>
       <res-sharing-scope>Shareable</res-sharing-scope>
     </resource-ref>

But with this last change the Sample EJB won't deploy. For clarity, I'm
attaching the 4 xml files I'm using for RAR and EJB+JAR deployment.

Any hints, or tips are heartily appreciated,

If this doesn't solve, do post the errors you are seeing while deploying/running.

Cheers,
--
Francisco Borges

- Shiva

------=_Part_69947_11302301.1183463985527--