[jbossws-issues] [JBoss JIRA] Commented: (JBWS-2074) Resource injection in jaxws endpoints and handlers

Richard Opalka (JIRA) jira-events at lists.jboss.org
Mon Apr 6 11:32:22 EDT 2009


    [ https://jira.jboss.org/jira/browse/JBWS-2074?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12460762#action_12460762 ] 

Richard Opalka commented on JBWS-2074:
--------------------------------------

Resource injection doesn't work in handlers associated with EJB3 endpoints because:
ad1) we don't have access to EJB3 JNDI context associated with particular EJB3 bean
ad2) JAX-WS spec. says nothing about such usecase (so don't know how to deal with it)

In WEB archives, injection-target is shared across POJO endpoints, because env-entry
is specified at top level element. With EJB3 beans, env-entry can be specified for
particular EJB3 bean only. This causes ambiguity if handler class would be reused across
different EJB3 beans. In such usecase all enventries for all EJB3 beans have to be
identical (except injection-targets). This causes descriptor code duplicity plus it is 
highly error prone when env entries differ (both name & type).

> Resource injection in jaxws endpoints and handlers
> --------------------------------------------------
>
>                 Key: JBWS-2074
>                 URL: https://jira.jboss.org/jira/browse/JBWS-2074
>             Project: JBoss Web Services
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: jbossws-cxf, jbossws-metro, jbossws-native
>    Affects Versions:  jbossws-native-2.0.3
>            Reporter: Richard Opalka
>            Assignee: Richard Opalka
>            Priority: Critical
>             Fix For:  jbossws-native-3.1.1,  jbossws-metro-3.1.1,  jbossws-cxf-3.1.1
>
>   Original Estimate: 4 hours
>  Remaining Estimate: 4 hours
>
> I tried to use resource injection in WS Handler as described in JAX-WS spec which is a MUST feature.
> I tested it in both Sun impl and Jbosss JAX-WS 2.0.x with Jboss 4.2.2. It is working well in Sun impl but not working in JBoss WS.
> here is the simple test. I am using web war as deployement, inside web.xml, I have the following:
> <env-entry>
> <env-entry-name>customFormat</env-entry-name>
> <env-entry-type>java.lang.String</env-entry-type>
> <env-entry-value>Path1: $PATH_INFO, Outbound: $MESSAGE_OUTBOUND_PROPERTY - $NODE</env-entry-value>
> <injection-target>
> <injection-target-class>testjaxws.handler.DefaultCustomLoggingWrapperHandler</injection-target-class>
> <injection-target-name>customFormat</injection-target-name>
> </injection-target>
> </env-entry>
> inside DefaultCustomLoggingWrapperHandler class, I have:
> @Resource
> private String customFormat = null;
> defined.
> It is never gets injected with this value no matter what I tried.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jbossws-issues mailing list