[jboss-dev-forums] [JBoss AS 7 Development] - Re: EJB bean is not working in Multi threading of JBoss 7.1.1 Final

Bijoy James do-not-reply at jboss.com
Mon Aug 20 04:14:34 EDT 2012


Bijoy James [https://community.jboss.org/people/bijoyjp] created the discussion

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

To view the discussion, visit: https://community.jboss.org/message/754465#754465

--------------------------------------------------------------
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 at 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
[https://community.jboss.org/message/754465#754465]

Start a new discussion in JBoss AS 7 Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2225]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-dev-forums/attachments/20120820/c5b1a97a/attachment.html 


More information about the jboss-dev-forums mailing list