JBoss Community

Re: EJB bean is not working in Multi threading of JBoss 7.1.1 Final

created by Bijoy James in JBoss AS 7 Development - View the full discussion

Hi Wolf-Dieter Fink,

 

Sure, below pasted is the code that am using for getting the remote object.

JMSRARemote objRemote = null;

Properties env = null;

Context initContext = null;

Object obj = null;

JMSRAHome home = null;

env = new Properties();

env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory");

env.put(Context.PROVIDER_URL, "remote://localhost:4447");

env.put("jboss.naming.client.ejb.context", true);

env.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming");

initContext = new InitialContext(env);

obj = initContext.lookup("JMSRa/JMSRA!Home.JMSRAHome");

home = (JMSRAHome) PortableRemoteObject.narrow(obj, JMSRAHome.class);

objRemote = home.create();

 

after this if I try  objRemote.ReadTxnFromInputQueueString("inputqueue1");

It’s working. After this method am calling multithreading i.e.

transactionQueueListener[i].start()

 

and inside thread am using the same remote object (objRemote) which is declared as public static, whenever am trying to call the method inside the bean by using the remote object i.e.


objRemote.ReadTxnFromInputQueueString("inputqueue1"); am getting the exception

 


java.lang.IllegalStateException: No EJB receiver available for handling [appName:,modulename:JMSRa,distinctname:] combination for invocation context org.jboss.ejb.client.EJBClientInvocationContext@1f12373;

 

for thread call if am using thread.run(); means everything is working am able to call remote method in the bean and result is getting. since am using multi threading i have to use start() method for calling thread.

Reply to this message by going to Community

Start a new discussion in JBoss AS 7 Development at Community