[jboss-user] [EJB 3.0] - Re: help required for JBOSS 4.0.4 GA and EJB 3.0 RC9

priyavijayan1 do-not-reply at jboss.com
Thu Dec 28 04:21:09 EST 2006


I got it resolved. I am pasting the code over here

package com.infosys.EJB3.application;

import com.infosys.EJB3.application.FacadeRemote;
import com.infosys.EJB3.application.FacadeBean;

import javax.naming.InitialContext;
import java.sql.Timestamp;
import java.util.Properties;

public class client
{
   public static void main(String[] args)
   {
 	try
 	{
	  Properties p = new Properties();
	  p.setProperty("java.naming.factory.initial","org.jnp.interfaces.NamingContextFactory");
  	  p.setProperty("java.naming.factory.url.pkgs","org.jboss.naming:org.jnp.interfaces");
	  p.setProperty("java.naming.provider.url","localhost:1099");
	  InitialContext ctx = new InitialContext(p);

	  System.out.println("Got initial COntext  "+ctx.lookup("FacadeBean/remote"));	
      FacadeRemote lFacadeRemote = (FacadeRemote) ctx.lookup("FacadeBean/remote");
	  System.out.println("Got Facade Remote Bean");	
	  // Added
	  lFacadeRemote.checkUserCredential("rama", "ramaxyz");
	  System.out.println("user checked");
	  // end
	  //lFacadeRemote.createDepartment("Marketing");
	  /*lFacadeRemote.createDepartment("Administration");
	  lFacadeRemote.createDepartment("Sales");*/

	  /*lFacadeRemote.assignEmployeeToDepartment(new Long(1),"Brijesh",31,"M");
	  lFacadeRemote.assignEmployeeToDepartment(new Long(1),"xxxx",31,"M");
	  lFacadeRemote.assignEmployeeToDepartment(new Long(2),"yyyy",31,"M");*/
	  System.out.println("DONE");	
 	}
 	catch(Exception ex)
 	{
		System.out.println(ex);
		ex.printStackTrace();
	}
   }
}


------------------------------------------------------------------


The change that I have made is adding the properties instance. I have another file in my directory called jndi.properties, but I still had to put it inside my code. I am not sure why I need to do it since I already have jndi.properties.... anyways its working fine..

Thanks for the reply..


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3996595#3996595

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3996595



More information about the jboss-user mailing list