As far as I understood you have two possibilities:
1. Inject your EJB into a CDI component and inject that component into your
wicket pages using @Inject annotation. That should solve the serialization
problem but you will have an additional "layer".
2. Use javaee-inject from wicketstuff [1] to inject your EJBs with @EJB
annotation into your wicket pages.

I've tried the second approach (though in JBoss, not glassfish) and so
far have had no problems with using both wicket-cdi and javaee-inject in
the same project. Maybe it's not so nice because you have to include two
dependencies and use two different kinds of annotations in your wicket
pages.

[1] https://github.com/wicketstuff/core/wiki/Java-EE-Inject


2012/10/8 Dieter Tremel <tre...@tremel-computer.de>

> Moving from JSF to Wicket 6.1.0 I am used to having all JPA operations
> in a EJB facade to use the container's (Glassfish 3.2.1) transaction
> management. I use and know wicket-cdi for injection, which works fine.
>
> Unfortunately, if I inject an EJB in a wicket page, the serialization
> checks of wicket complain that it is not serializable. This is true for
> EJB, I suppose since they are proxied by
> EJBLocalObjectInvocationHandlerDelegate. Frustrated I have read the
> thread around http://markmail.org/message/4esc7m5subft5ngu
>
> My thinking is blocked at this point. If I can't use jpa with container
> managed transactions wicket how is the simpliest way do achieve it? All
> examples I googled and also these in the book "Wicket in Action" are
> only reading data or using Spring, what I do not want to do.
>
> Thank you for any hint
> Dieter Tremel
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

Reply via email to