You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by Tim McConnell <ti...@gmail.com> on 2007/02/08 07:47:30 UTC

@EJB Deployment Plan

Hi, I'm very close to getting the Calculator Stateless SessionBean Servlet 
Sample ear file to properly deploy by changing the deployment descriptor 
based on @EJB annotation(s). However, I'm getting this ugly exception and 
it's not clear to me why....

org.apache.openejb.OpenEJBException: Cannot find bean 
"org.apache.geronimo.samples.calculator.CalculatorServlet/calc" referenced 
by bean "GeronimoEnc".
org.apache.geronimo.common.DeploymentException: 
org.apache.openejb.OpenEJBException: Cannot find bean 
"org.apache.geronimo.samples.calculator.CalculatorServlet/calc" referenced 
by bean "GeronimoEnc".
	at 
org.apache.geronimo.openejb.deployment.EjbRefBuilder.buildNaming(EjbRefBuilder.java:135)
	at 
org.apache.geronimo.openejb.deployment.EjbRefBuilder$$FastClassByCGLIB$$dbba8597.invoke(<generated>)
	at net.sf.cglib.reflect.FastMethod.invoke(FastMethod.java:53)
....


Does anyone see anything obviously incorrect about the deployment plan 
below that I've augmented based on this @EJB annotation in the 
org.apache.geronimo.samples.calculator.CalculatorServlet  servlet ?? The 
only change to the existing plan is the addition of the  <ejb-local-ref> 
element. Thanks.

     @EJB
     private CalculatorLocal calc = null;

<xml-fragment version="2.5" 
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:jav="http://java.sun.com/xml/ns/javaee">
   <jav:description>Stateless SessionBean Servlet Sample</jav:description>
   <jav:servlet>
     <jav:servlet-name>Calculator</jav:servlet-name>
 
<jav:servlet-class>org.apache.geronimo.samples.calculator.CalculatorServlet</jav:servlet-class>
     <jav:load-on-startup>0</jav:load-on-startup>
   </jav:servlet>
   <jav:servlet-mapping>
     <jav:servlet-name>Calculator</jav:servlet-name>
     <jav:url-pattern>/calculator</jav:url-pattern>
   </jav:servlet-mapping>
   <jav:welcome-file-list>
     <jav:welcome-file>index.html</jav:welcome-file>
   </jav:welcome-file-list>
   <jav:ejb-local-ref>
 
<jav:ejb-ref-name>org.apache.geronimo.samples.calculator.CalculatorServlet/calc</jav:ejb-ref-name>
 
<jav:local-home>org.apache.geronimo.samples.slsb.calculator.CalculatorLocal</jav:local-home>
     <jav:injection-target>
 
<jav:injection-target-class>org.apache.geronimo.samples.calculator.CalculatorServlet</jav:injection-target-class>
       <jav:injection-target-name>calc</jav:injection-target-name>
     </jav:injection-target>
   </jav:ejb-local-ref>
</xml-fragment>

-- 
Thanks,
Tim McConnell

Re: @EJB Deployment Plan

Posted by Tim McConnell <ti...@gmail.com>.
No idea.

Jacek Laskowski wrote:
> On 2/8/07, Tim McConnell <ti...@gmail.com> wrote:
> 
>> org.apache.openejb.OpenEJBException: Cannot find bean
>> "org.apache.geronimo.samples.calculator.CalculatorServlet/calc" 
>> referenced
>> by bean "GeronimoEnc".
>> org.apache.geronimo.common.DeploymentException:
>> org.apache.openejb.OpenEJBException: Cannot find bean
>> "org.apache.geronimo.samples.calculator.CalculatorServlet/calc" 
>> referenced
>> by bean "GeronimoEnc".
> 
> What's the GeronimoEnc bean?
> 
> Jacek
> 

-- 
Thanks,
Tim McConnell

Re: @EJB Deployment Plan

Posted by Jacek Laskowski <ja...@laskowski.net.pl>.
On 2/8/07, Tim McConnell <ti...@gmail.com> wrote:

> org.apache.openejb.OpenEJBException: Cannot find bean
> "org.apache.geronimo.samples.calculator.CalculatorServlet/calc" referenced
> by bean "GeronimoEnc".
> org.apache.geronimo.common.DeploymentException:
> org.apache.openejb.OpenEJBException: Cannot find bean
> "org.apache.geronimo.samples.calculator.CalculatorServlet/calc" referenced
> by bean "GeronimoEnc".

What's the GeronimoEnc bean?

Jacek

-- 
Jacek Laskowski
http://www.JacekLaskowski.pl

Re: @EJB Deployment Plan

Posted by Tim McConnell <ti...@gmail.com>.
Thanks much David--that was it. It's working great now....

David Blevins wrote:
> 
> On Feb 7, 2007, at 10:47 PM, Tim McConnell wrote:
> 
>>   <jav:ejb-local-ref>
>> <jav:ejb-ref-name>org.apache.geronimo.samples.calculator.CalculatorServlet/calc</jav:ejb-ref-name> 
>>
>> <jav:local-home>org.apache.geronimo.samples.slsb.calculator.CalculatorLocal</jav:local-home> 
>>
>>     <jav:injection-target>
>> <jav:injection-target-class>org.apache.geronimo.samples.calculator.CalculatorServlet</jav:injection-target-class> 
>>
>>       <jav:injection-target-name>calc</jav:injection-target-name>
>>     </jav:injection-target>
>>   </jav:ejb-local-ref>
> 
> You've got the Calculator's ejb3 business interface marked as an ejb2 
> home interface.  Just s/local-home/local/ and it should work.
> 
> -David
> 
> 

-- 
Thanks,
Tim McConnell

Re: @EJB Deployment Plan

Posted by David Blevins <da...@visi.com>.
On Feb 8, 2007, at 3:09 PM, Tim McConnell wrote:

> Hi Jacek, I will follow your lead and maybe by EJB4 it'll finally  
> sink in for me.........."No home interface exists for EJB3, no home  
> interface ...."

EJB4... <shivers>...  Let's all agree not to say the words EJB4 or  
Java EE 6 for quite some time :)

-David

> Jacek Laskowski wrote:
>> On 2/8/07, David Blevins <da...@visi.com> wrote:
>>> You've got the Calculator's ejb3 business interface marked as an  
>>> ejb2
>>> home interface.  Just s/local-home/local/ and it should work.
>> Doh! No home interface exists for EJB3, no home interface exists for
>> EJB3, no home interfa....
>> Jacek
>
> -- 
> Thanks,
> Tim McConnell
>


Re: @EJB Deployment Plan

Posted by Tim McConnell <ti...@gmail.com>.
Hi Jacek, I will follow your lead and maybe by EJB4 it'll finally sink in 
for me.........."No home interface exists for EJB3, no home interface ...."

Jacek Laskowski wrote:
> On 2/8/07, David Blevins <da...@visi.com> wrote:
> 
>> You've got the Calculator's ejb3 business interface marked as an ejb2
>> home interface.  Just s/local-home/local/ and it should work.
> 
> Doh! No home interface exists for EJB3, no home interface exists for
> EJB3, no home interfa....
> 
> Jacek
> 

-- 
Thanks,
Tim McConnell

Re: @EJB Deployment Plan

Posted by Jacek Laskowski <ja...@laskowski.net.pl>.
On 2/8/07, David Blevins <da...@visi.com> wrote:

> You've got the Calculator's ejb3 business interface marked as an ejb2
> home interface.  Just s/local-home/local/ and it should work.

Doh! No home interface exists for EJB3, no home interface exists for
EJB3, no home interfa....

Jacek

-- 
Jacek Laskowski
http://www.JacekLaskowski.pl

Re: @EJB Deployment Plan

Posted by David Blevins <da...@visi.com>.
On Feb 7, 2007, at 10:47 PM, Tim McConnell wrote:

>   <jav:ejb-local-ref>
> <jav:ejb-ref- 
> name>org.apache.geronimo.samples.calculator.CalculatorServlet/calc</ 
> jav:ejb-ref-name>
> <jav:local- 
> home>org.apache.geronimo.samples.slsb.calculator.CalculatorLocal</ 
> jav:local-home>
>     <jav:injection-target>
> <jav:injection-target- 
> class>org.apache.geronimo.samples.calculator.CalculatorServlet</ 
> jav:injection-target-class>
>       <jav:injection-target-name>calc</jav:injection-target-name>
>     </jav:injection-target>
>   </jav:ejb-local-ref>

You've got the Calculator's ejb3 business interface marked as an ejb2  
home interface.  Just s/local-home/local/ and it should work.

-David