Facing concurrency issue when trying to call Web Services with CXF and WSS4J interceptors
Issue
- Exposed an SLSB (Stateless EJB) as an JAX-WS JBOSS managed Web Service, and are trying to use CXF interceptors and WS4J interceptors to authenticate the request.
- Below are the configuration settings that have been applied:
- jbossws-cxf.xml
<jaxws:endpoint id="SecuredEJBEndpoint"
address="/somecontext/secure/PostEndpoint" implementor="EJBBean">
<jaxws:invoker>
<bean class='org.jboss.wsf.stack.cxf.JBossWSInvoker' ></bean>
</jaxws:invoker>
<jaxws:inInterceptors>
<ref bean="httpHeaderUsernameTokenInInterceptor" ></ref>
<ref bean="wss4jIn"></ref>
</jaxws:inInterceptors>
<jaxws:properties>
<entry key="ws-security.validate.token" value="false"></entry>
<entry key="ws-security.ut.no-callbacks" value="true"></entry>
<entry key="ws-security.ut.validator" value-ref="ldapUsernameTokenValidator"></entry>
</jaxws:properties>
</jaxws:endpoint>
- EJB configuration in jboss-ejb3.xml file:
<session>
<ejb-name>SecuredEJBEndpoint</ejb-name>
<business-remote>PostEndpoint</business-remote>
<ejb-class>EJBBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Bean</transaction-type>
</session>
- jboss-webservices.xml:
<port-component>
<ejb-name>SomeEndpoint</ejb-name>
<port-component-name>PostEndpoint</port-component-name>
<port-component-uri>/secure/PostEndpoint</port-component-uri>
</port-component>
- EJB is not getting pooled, we are seeing always single instance of EJB. This causing concurrency issues. Is there any configuration which will prevent this issue?
Environment
- Red Hat JBoss Enterprise Application Platform (EAP)
- 6.x
- JBossWS-CXF
- Apache WSS4J
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
