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

yes i placed the jboss-ejb-client.properties in the classpath of client application. but how to check the Context is using the same properties file?.

 

The code that am using in client application side for fetching data from beans is given below

 

public void getJMSRARemote(String Url)

{             

                String appName = "";

                String moduleName = "JMSRa";

                String distinctName = "";

                try {

                                Properties objProperties = new Properties();                    

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

                                Context initContext = new InitialContext(objProperties);                                            

                                String beanName = JMSRAHome.class.getSimpleName();

                                String viewClassName = JMSRAHome.class.getName();                                

                                String str = "ejb:" + appName + "/" + moduleName + "/" + distinctName + "/" + beanName + "!" + viewClassName;                                              

                                Object obj = initContext.lookup(str);                                     

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

                                JMSRARemote objRemote = home.create();

                               

                                if(objRemote!=null)

                                                objRemote.ReadTxnFromInputQueueString("inputqueue1");   

                }

                catch(Exception e) {

                                e.printStackTrace();

                                System.exit(0);

                }   

}

 

 

 

I started jboss by using below command

 

D:\jboss-as-7.1.1.Final\bin>standalone.bat

 

After that I run the java class file in the client application

Reply to this message by going to Community

Start a new discussion in JBoss AS 7 Development at Community