RE: References between Webapp and EJB

2006-04-09 Thread Fabian Dankof
Hi!

Isn't it java:comp/env/ejb/ where the ejb can be looked up? I
remember some examples
where /ejb was the "sub-level" for EJBs.
And can you tell me about the names? I mean, I have an ejb-name written in
ejb-jar.xml. Is this the definitive name for the component which I have to
use everywhere? Or has the name of the remote interface to be referenced
somewhere? I'm actually asking because I played a bit with these names bit
never succeeded.

Thanks much,

Fabian

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Aaron
Mulder
Sent: Saturday, April 08, 2006 5:44 PM
To: user@geronimo.apache.org
Subject: Re: References between Webapp and EJB

Yes, you need an EJB Ref (or more likely an EJB Local Ref) in web.xml.
 If the WAR and EJB JAR are in the same EAR, then the ejb-link in the EJB
ref should point to the ejb-name of the EJB and that should make it work.
If the WAR and EJB JAR are separate, then you need a geronimo-web.xml with a
matching ejb-ref or ejb-local-ref that resolves the reference to the EJB in
the standalone EJB JAR.

Once you have the EJB ref, the servlet can look up the EJB in JNDI at the
location java:comp/env/(name of EJB ref)

Thanks,
Aaron

On 4/8/06, Fabian Dankof <[EMAIL PROTECTED]> wrote:
> Hello!
>
> I'm trying to get a simple example thing to work that consists of an EJB
and a webapp.
> Up to now I don't know exactly how references between webapps and ejbs are
made.
> Additionally I don't know which files I actually need.
>
> I've got the following deployment descriptors:
>
> ejb-jar.xml:
> --
> 
>
> 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">
>
>
>StringMirrorEJB
>
>
>
>   
>   
>  
>  MyStringMirror
>
>  MyStringMirror
>
>  foo.MyStringMirrorHome
>  foo.MyStringMirror
>  foo.MyStringMirrorLocalHome
>  foo.MyStringMirrorLocal
>  foo.MyStringMirrorSession
>  Stateless
>  Container
>   
>
>
> 
> --
>
> Here is my question if i need an additional 'id' attribute in the 
>  tag and which value it should have. I already noticed that 
> the value in the 'id' attribute is taken as 'Component Name' in Geronimo
Console.
>
>
> Here is my web.xml:
>
> ---
> 
>
> 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/web-app_2_4.xsd"; version="2.4">
>SimpleEJBConsumer
>
>
>
>
>   SimpleEJBConsumer
>   SimpleEJBConsumer
>   foo.SimpleEJBConsumer
>
>
>
>
>
>   SimpleEJBConsumer
>   /SimpleEJBConsumer
>
>  
> ---
>
> Do i need an ejb-ref in the web.xml???
>
>
> geronimo-web.xml:
>
> ---
>   xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-1.0";
xmlns:nam="http://geronimo.apache.org/xml/ns/naming-1.0";
xmlns:sec="http://geronimo.apache.org/xml/ns/security-1.1";
xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.0";
configId="SimpleEJBConsumer/SimpleEJBConsumer">
>   /SimpleEJBConsumer
>   false
>   
> ejb/MyStringMirror
>
geronimo.server:J2EEServer=geronimo,j2eeType=StatelessSessi
onBean,name=MyStringMirror
>   
> 
> ---
>
>
> I would be very glad if someone can just tell my what is needed, and what
is not.
>
>
> Thanks,
>
> Fabian
>
>
>



Re: References between Webapp and EJB

2006-04-08 Thread Aaron Mulder
Yes, you need an EJB Ref (or more likely an EJB Local Ref) in web.xml.
 If the WAR and EJB JAR are in the same EAR, then the ejb-link in the
EJB ref should point to the ejb-name of the EJB and that should make
it work.  If the WAR and EJB JAR are separate, then you need a
geronimo-web.xml with a matching ejb-ref or ejb-local-ref that
resolves the reference to the EJB in the standalone EJB JAR.

Once you have the EJB ref, the servlet can look up the EJB in JNDI at
the location java:comp/env/(name of EJB ref)

Thanks,
Aaron

On 4/8/06, Fabian Dankof <[EMAIL PROTECTED]> wrote:
> Hello!
>
> I'm trying to get a simple example thing to work that consists of an EJB and 
> a webapp.
> Up to now I don't know exactly how references between webapps and ejbs are 
> made.
> Additionally I don't know which files I actually need.
>
> I've got the following deployment descriptors:
>
> ejb-jar.xml:
> --
> 
>
> 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">
>
>
>StringMirrorEJB
>
>
>
>   
>   
>  
>  MyStringMirror
>
>  MyStringMirror
>
>  foo.MyStringMirrorHome
>  foo.MyStringMirror
>  foo.MyStringMirrorLocalHome
>  foo.MyStringMirrorLocal
>  foo.MyStringMirrorSession
>  Stateless
>  Container
>   
>
>
> 
> --
>
> Here is my question if i need an additional 'id' attribute in the  
> tag and
> which value it should have. I already noticed that the value in the 'id' 
> attribute
> is taken as 'Component Name' in Geronimo Console.
>
>
> Here is my web.xml:
>
> ---
> 
>
> 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/web-app_2_4.xsd"; version="2.4">
>SimpleEJBConsumer
>
>
>
>
>   SimpleEJBConsumer
>   SimpleEJBConsumer
>   foo.SimpleEJBConsumer
>
>
>
>
>
>   SimpleEJBConsumer
>   /SimpleEJBConsumer
>
>  
> ---
>
> Do i need an ejb-ref in the web.xml???
>
>
> geronimo-web.xml:
>
> ---
> 
> http://geronimo.apache.org/xml/ns/j2ee/web-1.0"; 
> xmlns:nam="http://geronimo.apache.org/xml/ns/naming-1.0"; 
> xmlns:sec="http://geronimo.apache.org/xml/ns/security-1.1"; 
> xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.0"; 
> configId="SimpleEJBConsumer/SimpleEJBConsumer">
>   /SimpleEJBConsumer
>   false
>   
> ejb/MyStringMirror
> 
> geronimo.server:J2EEServer=geronimo,j2eeType=StatelessSessionBean,name=MyStringMirror
>   
> 
> ---
>
>
> I would be very glad if someone can just tell my what is needed, and what is 
> not.
>
>
> Thanks,
>
> Fabian
>
>
>