On 12/18/06, Maurice Marrink <[EMAIL PROTECTED]> wrote:
Hey nice work,
Just the other day i had put something together myself, and now i find
more people have the need for ejb.

I just wonder how is it that your ejb's are available in the
initialcontext when your web.xml has the wrong version. I needed the
following in my web.xml to get it to work
:
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee";
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd";>

Sorry! There are actually 2 web.xml files in the sample-application,
and you have probably looked at the wrong one (my fault, I'm gonna
delete the wrong web.xml)
The correct web.xml is at
wicket-javaee-examples/web/src/webapp/WEB-INF/web.xml and, if you look
at it, you will see it has the right servlet spec version (2.5)

Thank you for your signalation, I'll re-upload the sample-app without
the wrong version of the web.ml

Also i placed:
<persistence-context-ref>
                <persistence-context-ref-name>
                        persistence/EntityManager
                </persistence-context-ref-name>
                <persistence-unit-name>myPU</persistence-unit-name>
        </persistence-context-ref>

in web.xml to have automatic access to the entitymanager in the dao
(when annotated)

If the dao is an EJB, you shouldn't need the <persistence-context-ref>
because the EntityManager is injected directly by you application
server

I havent had any luck getting a valid entitymanager injected directly
in my wicket objects (@PersistenceContext). Anybody had any luck with
that ?

Mmm... I'd prefer not to have the EntityManager injected directly in
the Wicket Page. It's mostly a matter of style (I don't want to put
the persistence logic directly in the page code) but there could be
also some issues with serialization of the Wicket page

--
Filippo Diotalevi
[EMAIL PROTECTED]
http://www.diotalevi.com/weblog
http://www.jugmilano.it

Reply via email to