geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Blevins <>
Subject Re: Is there any reason to use @Remote for session bean...
Date Tue, 21 Aug 2007 19:44:59 GMT

On Aug 20, 2007, at 1:40 PM, Tomasz Mazan wrote:

> David Blevins pisze:
>>>>> and try to get remote SB with method
>>>>>    this.ctx.lookup("EJBtest-1.0.jar/CustomerFacade");
>>>>> and get instance of.... org.apache.openejb.client.JNDIContext..  
>>>>> where is my session bean?!
>>>> I think you need to append the name of the interface you are  
>>>> trying to get.  You could list the context to find out exactly  
>>>> what is bound there.
>>> CustomerFacade is the name of my interface that i try to get and  
>>> when i try to list the context using JNDIContext.list method -  
>>> method throws exception  
>>> javax.namin.OperationNotSupportedException: TODO: Needs to be  
>>> implemented
>> Opened a JIRA for this (OPENEJB-668).  It does work however on  
>> anything running in the server-side if they construct an initial  
>> context using org.apache.openejb.client.LocalInitialContextFactory  
>> as the JNDI inital context factory provider.  You could do this in  
>> a servlet or ejb maybe.  But before we go there, it sounds like  
>> CustomerFacade is the name of your bean implementation.  That's  
>> the only way I can think that you would find a context there.
>> Can you paste the bean class name and the remote interface name?
> Class name : CustomerFacadeImpl (annotated with @Stateless)
> Interface name : CustomerFacade (annotated with @Remote)

Assuming the moduleId is 'EJBtest-1.0.jar' :

ejbName      = CustomerFacadeImpl   (the default per spec rules)
deploymentId = EJBtest-1.0.jar/CustomerFacadeImpl
jndiName     = EJBtest-1.0.jar/CustomerFacadeImpl/ 

Unless however you used the @Stateless annotation like this as I  
suspect you might have:

public class CustomerFacadeImpl .... {..}

In which case your ejbName is CustomerFacade not CustomerFacadeImpl  
and you then get this:

ejbName      = CustomerFacade  (set in @Stateless)
deploymentId = EJBtest-1.0.jar/CustomerFacade
jndiName     = EJBtest-1.0.jar/CustomerFacade/ 

I suspect this might be more accurate as you mentioned you found a  
context when you looked up "EJBtest-1.0.jar/CustomerFacade" and that  
would explain it.

>>>>> There is CustomerFacade in JNDIViewer tree - Geronimo Console,  
>>>>> but....
>>>>> 2) Although I set key log4j.logger.OpenEJB.startup to value  
>>>>> INFO, there's no jndi messages on console
>> Hmm. Did you get any additional output at all?  Figuring out how  
>> to get those log messages is definitely our best bet.  Maybe try  
>> just "log4j.logger.OpenEJB=INFO".  Also check that a similar line  
>> isn't already there for any "OpenEJB" log cagetories.
> There's no more messages than this about deploy of MEJBGBean  
> (warning). There's no jndi messages still there.

As a last resort, you can change this line in
-log4j.rootLogger=ERROR, CONSOLE, FILE
+log4j.rootLogger=INFO, CONSOLE, FILE

That should *definitely* do it, but the flood gates will be open :)


View raw message