Skip to main content

Glassfish with Axis: EJB injection - has anyone been successful doing this?

2 replies [Last post]
st.h
Offline
Joined: 2012-01-26
Points: 0

For legacy reasons we are forced to implement a soap endpoint using Axis 1.4. The endpoint is packaged as a war. We tried to inject our EJBs using @EJB Annotions, however this failed silently and left us with a field with a value that is null. There are ways to get around this, however, I would be interested in the reasons why this does not work. On the other hand, probably there still is an error in the application I haven't been able to find. So, has anybody been able to inject their EJBs with an Axis endpoint running in glassfish? If not, can somebody please explain why I can't do this in the same way this can be done using an JAX-RS endpoint in a war?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
mvatkina
Offline
Joined: 2005-04-04
Points: 0

If injection doesn't work, the field is not set and it will be null. If
the injection fails, you will see a warning or an exception in the log.
If it didn't happen because there is no code that performs the injection
in this type of the component, the field will not be set and there will
be no trace in the log.

-marina

On 3/8/13 2:33 AM, forums@java.net wrote:
> For legacy reasons we are forced to implement a soap endpoint using
> Axis 1.4.
> The endpoint is packaged as a war. We tried to inject our EJBs using @EJB
> Annotions, however this failed silently and left us with a field with
> a value
> that is null. There are ways to get around this, however, I would be
> interested in the reasons why this does not work. On the other hand,
> probably
> there still is an error in the application I haven't been able to
> find. So,
> has anybody been able to inject their EJBs with an Axis endpoint
> running in
> glassfish? If not, can somebody please explain why I can't do this in the
> same way this can be done using an JAX-RS endpoint in a war?
>
> --
>
> [Message sent by forum member 'st.h']
>
> View Post: http://forums.java.net/node/895535
>
>

st.h
Offline
Joined: 2012-01-26
Points: 0

Thank you for your answer.

mvatkina wrote:
If injection doesn't work, the field is not set and it will be null.

Yes, I can observe that for instance by putting a logger statement before the call to the ejb.

mvatkina wrote:
If
the injection fails, you will see a warning or an exception in the log.
If it didn't happen because there is no code that performs the injection
in this type of the component, the field will not be set and there will
be no trace in the log.

There is nothing in the log. But I don't think it is the code, since we have been using similar code for quite some time and the code actually works fine when not used within context of AXIS. That's why I've been asking if somebody has more details on a similar issue when using AXIS. I don't think it is a general problem.