On Mon, Nov 29, 2010 at 6:31 AM, Tony Tubbs <[email protected]> wrote:
>
> Still not able to do EJB lookup using OpenEJB inside a JUnit test.  Below is 
> my
> actual code.
[...]
> Failing JUnit test
> -----------------------------------------------------------------------------------------
>
>   �...@test
>    public void testCallStoredProcedure() {
>        System.out.println("callStoredProcedure");
>        IProcedureEntity sp = new ProductFamilyRegistrationProcedure(new
> BigDecimal("0"));
>        int expResultSize = 0;

Your testcase should be using a lookup and not 'new MyEjb'.  Doesn't
matter if the testcase lookup isn't portable, you stil need to use a
lookup to get any EJB features.  This could be the source of your
shutdown issues.  As well it looks like your ejb-jar.xml is attempting
to give the ejb the name
"java:comp/env/ProductFamilyRegistrationFacade" without using an
"<ejb-local-ref>" as noted in one of the other links I showed.

I think I have you far more confused and off in the wrong direction
than in the right direction :)  Very understandable as this is the
least intuitive aspect of Java EE and is very hard to explain and
learn.

I took another stab at a better doc:

  https://cwiki.apache.org/OPENEJBx30/lookup-of-other-ejbs-example.html

I setup this example to be deliberately confusing as possible and
challenge common false assumptions, but I've also tried to explain as
best as possible.  Maybe we can shift things away from your code for a
moment and spend some time discussing any aspects of this example that
you find confusing -- my hope is it can help us flush out some good
questions and answers.


-David

Reply via email to