on 06-21-2007 11:08 AM
I have tried unsuccessfully to get this working. I am using the Converter example and have adapted it so that the JSP uses a bean to get it's data. The bean calls the ConverterBean EJB to supply this data. If I use the old way of looking up an EJB through JNDI and an initial context it works fine. However, adapting the code to use the JEE 5 annotations I run into problems, I've tried both of the following and neither work:
// Use default naming
@EJB
private ConverterLocal converter;
// Use explicit naming:
@EJB (name="Converter")
private ConverterLocal converter;
In both situations converter is null when I come to use it. Does the @EJB annotation work from the web tier in Netweaver 7.1? I have also tried using java:comp/env/Converter in the explicit naming method without success.
Hi Richar,
The @EJB annotation is supported by the web tier in Netwaever 7.1.
However, the annotations is not supported in the JSPs. This is by the specification. So you can use the @EJB annotation in servlet instead.
Regards,
Diyan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for replying so quickly Diyan. I am not using the annotation from the JSP but from a bean used by the JSP. The specification seems a little ambiguous here as JSF managed beans are allowed to use injection annotations, so I don't see why it would be a problem for POJOs. The JSP servlet generation engine would not need to cope with annotations in this scenario. However, I will try and use the bean from a servlet and see if that works.
User | Count |
---|---|
94 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.