Hey folks,
I'm trying to use a LocalStatelessSessionProxyFactoryBean to advise methods in an ejb.
Basically I want to be able to retry the ejb method should it fail for a specific reason.
This is what i'm doing ( i think this is a fairly reasonable way of doing it, but please correct me if wrong..) :
but then it barfs when I try to cast back to the JobLocal.Code:LocalStatelessSessionProxyFactoryBean bean = new LocalStatelessSessionProxyFactoryBean(); bean.setJndiName("JobLocal"); bean.setBusinessInterface(JobLocal.class); bean.setLookupHomeOnStartup(false); try { bean.afterPropertiesSet(); } catch(Exception e) { logger.error("e=" + e.getMessage()); } Object proxy = bean.getObject(); TransactionFailureInterceptor i = new TransactionFailureInterceptor(); ProxyFactory factory = new ProxyFactory(JobLocal.class); factory.setTarget(proxy); factory.addAdvice(0, i); Object p1 = factory.getProxy();
I'm possibly doing something dull here... and if someone could point it out I'd be really really grateful. thanks in advance!
Marty


Reply With Quote