[jbossws-issues] [JBoss JIRA] Created: (JBWS-2558) Component's resources defined in the \<env-entry\> are not available to the handlers via JNDI for EJB3-based WS components.

Gang Yang (JIRA) jira-events at lists.jboss.org
Thu Feb 26 11:07:44 EST 2009


Component's resources defined in the \<env-entry\> are not available to the handlers via JNDI for EJB3-based WS components.
---------------------------------------------------------------------------------------------------------------------------

                 Key: JBWS-2558
                 URL: https://jira.jboss.org/jira/browse/JBWS-2558
             Project: JBoss Web Services
          Issue Type: Bug
      Security Level: Public (Everyone can see)
          Components: jbossws-native
    Affects Versions: jbossws-metro-3.0.1,  jbossws-2.0.1.SP1
            Reporter: Gang Yang
            Priority: Critical


While the resources defined in \<env-entry\> are not injected using the @Resource in handlers for both Web and EJB3 containers (an issue has been created for this problem), they are not available via JNDI lookup from handlers for EJB3 container as the JSR 109 requires. I tried this on both JBossAS 4.2.2.GA (JBossWS 2.0.1?) and JBoss 5.0.0.GA (JBossWS 3.0.1?). Here's the details on the code:

- A simple EJB3 stateless session bean annotated with @WebService and @HandlerChain
- ejb-jar.xml has the following \<env-entry\> definition for the session bean:

      \<env-entry\>
           \<env-entry-name\>configFile\<env-entry-name\>
           \<env-entry-type\>java.lang.String\<env-entry-type\>
           \<env-entry-value\>TestService2HandlerConfig.xml\<env-entry-value\>
      \<env-entry\>

- The hanler is a SOAP handler and has the following code segment:

      @Resource(name="configFile")
      String configFile;
      ....
      @PostConstruct
       public void init() {
               if (configFile == null) {
                        InitialContext icxt = new InitialContext();
                        Context myEnv = icxt.lookup("java:comp/env");
                        configFile = (String)myEnv.lookup("configFile");
                        ....

Note: the same handler configured for Web-container WS endpoints works OK - although configFile is not injected by @Resource, but at least it looked up fine using JNDI.




-- 
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