-
1. Re: Esb service and EJB3 Action or JBESB-2134 continuation...
maksrma Jul 27, 2012 4:19 AM (in response to maksrma)1 of 1 people found this helpfulI fix it with creating custom EJBProcessor.
ESB action in jboss-esb.xml looks like:
<action name="ejb-action" class="com.mypackage.CustomEJBProcessor">
CustomEJBProcessor is:
package com.mypackage;
import org.jboss.soa.esb.ConfigurationException;
import org.jboss.soa.esb.actions.ActionLifecycleException;
import org.jboss.soa.esb.actions.ActionProcessingException;
import org.jboss.soa.esb.helpers.ConfigTree;
import org.jboss.soa.esb.message.Message;
public class CustomEJBProcessor extends org.jboss.soa.esb.actions.EJBProcessor{private boolean isInited = false;
public CustomEJBProcessor(ConfigTree config) {
super(config);
}@Override
public void destroy() {
super.destroy();
}@Override
public void initialise() throws ActionLifecycleException {
//super.initialise(); --- IT'S PROBLEM METHOD! It called when esb resvice deployes by HDScaner BUT EJB3 Bean haven't deployed yet.
System.out.println("watsuppppp fuck!!!");
}@Override
public Message process(Message arg0) throws ActionProcessingException, ConfigurationException {
if(!isInited){
try {
super.initialise(); //Call once in first call of service! EJB is alreary deployed!
isInited = true;
} catch (ActionLifecycleException e) {//Probably need add some processing... but in practice I didn't catch any error here
e.printStackTrace();
}
}
return super.process(arg0);
}
}AND don't forget include:
<jboss-6.1_home>/server/<your_conf>/deploy/slsb.esb/jbossesb-slsb.jar to your application classpath.
Good luck!