[EJB3] - Interceptor not triggered in JBoss AS 6.0.0.Final
by Pasqualino Imbemba
Pasqualino Imbemba [https://community.jboss.org/people/pi4630] created the discussion
"Interceptor not triggered in JBoss AS 6.0.0.Final"
To view the discussion, visit: https://community.jboss.org/message/737939#737939
--------------------------------------------------------------
Hi,
this is my SLSB:
Stateless
public class TestBean implements ITest {
Logger log = Logger.getLogger(this.getClass());
@Resource
private TimerService timerService;
@Override
public void callMe() {
String array[] = { "Pinco", "Pallo", "Pallino" };
for (int i = 0; i < array.length; i++) {
timerService.createTimer(new Date(),(1 + i) * 60 * 1000, array[i] + " "+i);
}
}
@Timeout
@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
@Interceptors(TimerInterceptor.class)
private void testMe(Timer t) {
log.info("I am in timeout method");
if (t != null) {
System.out.println((String) t.getInfo());
}
}
The TimerInterceptor class looks like this:
public class TimerInterceptor {
Logger log = Logger.getLogger(this.getClass());
@AroundTimeout
public Object checkTimer(InvocationContext invContext) throws Exception {
log.info("I am in interceptor");
Timer t = (Timer) invContext.getTimer();
String timerName = (String) t.getInfo();
log.info("INTERCEPTOR: " + timerName);
return invContext.proceed();
}
I'd expect to find a log insertion, but there isn't. Breakpoint is also ignored. Am I missing something?
Thanks
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/737939#737939]
Start a new discussion in EJB3 at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 7 months
[JBoss Web Services] - @EJB not injected when using JBossWS-metro
by Markus Kilås
Markus Kilås [https://community.jboss.org/people/ne1mackan] created the discussion
"@EJB not injected when using JBossWS-metro"
To view the discussion, visit: https://community.jboss.org/message/737937#737937
--------------------------------------------------------------
After switching from JBossWS-native in JBoss 5.1.0.GA-jdk6 to JBossWS-metro-3.3.1 my servlet endpoint no longer get the EJBs injected. This worked fine with JBossWS-native (and also in GlassFish) but not after changing to jbossws-metro.
The servlet endpoint is implemented as below:
@WebService(serviceName = "MyService", portName = "MyServicePort", endpointInterface = "com.example.server.MyService", targetNamespace = "http://myservice.server.example.com/", wsdlLocation = "WEB-INF/wsdl/MyService/MyService.wsdl")
public class MyService {
@EJB
private FirstSessionLocal first;
@EJB
private SecondSessionLocal second;
@Resource
private WebServiceContext wsContext;
public void business() {
LOG.debug(">business");
if (first == null) LOG.error("first not injected");
if (second == null) LOG.error("second not injected");
if (wsContext == null) LOG.error("wsContext not injected");
}
}
Is this a known issue? What could be the problem? Any workaround?
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/737937#737937]
Start a new discussion in JBoss Web Services at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 7 months
[JBoss Web Services] - JAXWSProperties.SSL_SOCKET_FACTORY alternative in JBoss
by Markus Kilås
Markus Kilås [https://community.jboss.org/people/ne1mackan] created the discussion
"JAXWSProperties.SSL_SOCKET_FACTORY alternative in JBoss"
To view the discussion, visit: https://community.jboss.org/message/737901#737901
--------------------------------------------------------------
I have WS clients inside the application server making web services calls out to other servers. I need to specify the SSLSocket factory to be used by the request (as I have custom keystores and trust stores).
The first obvious solution is to set the default SSLSocketFactory of the HttpsURLConnection:
{code}
// SSLSocketFactory factory = ...
HttpsURLConnection.setDefaultSSLSocketFactory(factory);
{code}
This works fine on both JBoss 5.1.0 and GlassFish 3.1.2 as long as all SSL connections in the VM can use the same truststore/keystore and keys.
However in my case I want to be able to connect to different servers using different keystores and having multiple concurrent requests. This means that setting the SSLSocketFactory globally for the VM is not an option.
Instead the JAX-WS RI offers an way of specifying the SSLSocketFactory per request:
{code}
import com.sun.xml.ws.developer.JAXWSProperties;
...
EjbcaWS ejbca = service.getEjbcaWSPort();
BindingProvider binding = (BindingProvider) ejbca;
Map<String, Object> requestContext = binding.getRequestContext();
requestContext.put(JAXWSProperties.SSL_SOCKET_FACTORY, factory);
{code}
This achieves exactly the functionality I need and works perfect on GlassFish, however the property is ignored by JBoss 5.1.0.GA-jdk6.
*Is there a similar property that JBoss uses or how can I achive different SSL socket factories per request?*
*
*
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/737901#737901]
Start a new discussion in JBoss Web Services at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 7 months