-
Bug
-
Resolution: Done
-
Critical
-
jbossws-native-3.1.1
-
None
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. Therefore, for EJB3-based WS components, there's no way to pass any data into the associated handlers. I tried this on both JBossAS 4.2.2.GA (JBossWS 2.0.1) and JBoss 5.0.0.GA (JBossWS 3.0.4). 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.
Can this be fixed more easily and therefore earlier since it already works for Web container based WS endpoint/handler? This is a show stopper since there's no way to pass in info into the handler for EJB3 based WS endpoint/handler.
- blocks
-
JBWS-2631 Fix resource injection in JAX-WS handlers associated with EJB3 endpoints
- Closed