¿ìËÙÒµÎñͨµÀ

eclipse+JBoss 5+EJB3¿ª·¢Ö¸ÄÏ(1)£º±àдµÚÒ»¸öÎÞ״̬µÄSessionBean - ±à³ÌÈëÃÅÍø

×÷Õß ØýÃû¼¼Êõ À´Ô´ NET±à³Ì ä¯ÀÀ ·¢²¼Ê±¼ä 2012-06-15
System.out.println(greeter.greet("ÀîÄþ")); ¡¡¡¡¡¡¡¡¡¡¡¡¡¡ System.out.println(greeter.getAllGreetings().get(0).getName()); ¡¡¡¡¡¡ } }

eclipse+JBoss 5+EJB3¿ª·¢Ö¸ÄÏ(1)£º±àдµÚÒ»¸öÎÞ״̬µÄSessionBean(6)

ʱ¼ä:2011-09-18 blogjava ¹þ·ðУѵ

ÔÚÉÏÃæµÄ´úÂëÖУ¬Ê¹ÓÃÁËContext.PROVIDER_URLÉèÖÃÁË·þÎñ¶ËµÄIPºÍ¶Ë¿ÚºÅ¡£

ÉÏÃæ»ý´úÂëµÄÔËÐнá¹ûÈ磺

ÄúºÃ ÀîÄþ

bill gates

³ýÁËÔÚ³ÌÐòÖÐÉèÖÃÊôÐÔÖµÍ⣬Ҳ¿ÉÒÔͨ¹ýjndi.propertiesÎļþ½øÐÐÉèÖ᣸ÃÎļþÓ¦·ÅÔÚEclipse¹¤³Ì µÄsrcĿ¼ÖС£¸ÃÎļþµÄÄÚÈÝÈçÏ£º

java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory

java.naming.provider.url=192.168.17.105:1099

Èç¹ûʹÓÃjndi.propertiesÎļþ£¬¾Í²»ÐèÒªÔÚ¿Í»§¶Ë³ÌÐòÖÐÉèÖÃÏàÓ¦µÄÊôÐÔÖµÁË£¬Òò´Ë£¬¿ÉÒÔʹÓÃÈçÏ µÄ´úÂëÀ´µ÷ÓÃSession Bean£º

package test;
import javax.naming.Context;
import javax.naming.InitialContext;
import service.Greeter;
public class Client
{
¡¡¡¡¡¡ public static void main(String[] args) throws Exception
¡¡¡¡¡¡ {
¡¡¡¡¡¡¡¡¡¡¡¡¡¡ // ²»ÐèÒªÔÚ³ÌÐòÖÐÉèÖÃÏàÓ¦µÄÊôÐÔÖµ
¡¡¡¡¡¡¡¡¡¡¡¡¡¡ InitialContext ctx = new InitialContext();
¡¡¡¡¡¡¡¡¡¡¡¡¡¡ // ¿ªÊ¼µ÷ÓÃGreeter½Ó¿ÚµÄ·½·¨
¡¡¡¡¡¡¡¡¡¡¡¡¡¡ Greeter greeter = (Greeter) ctx.lookup("GreeterBean/remote");
¡¡¡¡¡¡¡¡¡¡¡¡¡¡ System.out.println(greeter.greet("ÀîÄþ"));
¡¡¡¡¡¡¡¡¡¡¡¡¡¡ System.out.println(greeter.getAllGreetings().get(0).getName());
¡¡¡¡¡¡ }
}

×¢Ò⣺ÔÚ±àд¿Í»§¶Ë³ÌÐòʱ£¬ÐèÒªÒýÓÃ<JBoss°²×°Ä¿Â¼>\clientĿ¼ÖеÄËùÓÐjarÎļþ¡£

ÁèÖڿƼ¼×¨ÒµÌṩ·þÎñÆ÷×âÓᢷþÎñÆ÷Íйܡ¢ÆóÒµÓʾ֡¢ÐéÄâÖ÷»úµÈ·þÎñ£¬¹«Ë¾ÍøÕ¾£ºhttp://www.lingzhong.cn ΪÁ˸ø¹ã´ó¿Í»§Á˽â¸ü¶àµÄ¼¼ÊõÐÅÏ¢£¬±¾¼¼ÊõÎÄÕÂÊÕ¼¯À´Ô´ÓÚÍøÂç,ÁèÖڿƼ¼×ðÖØÎÄÕÂ×÷ÕߵİæȨ£¬Èç¹ûÓÐÉæ¼°ÄãµÄ°æȨÓбØҪɾ³ýÄãµÄÎÄÕ£¬ÇëºÍÎÒÃÇÁªÏµ¡£ÒÔÉÏÐÅÏ¢ÓëÎÄÕÂÕýÎÄÊDz»¿É·Ö¸îµÄÒ»²¿·Ö,Èç¹ûÄúҪתÔر¾ÎÄÕÂ,Çë±£ÁôÒÔÉÏÐÅÏ¢£¬Ð»Ð»!

·ÖÏíµ½£º ¸ü¶à
HTTP/1.1 401 Access Denied óÌÐòÄÚµÄÒ»Öֳ־ÿò¼Ü - ±à³ÌÈëÃÅÍø
  • Photoshop»æÖƸ߹âË®¾§ÖʸÐË®¾§Æ»¹û
  • Copyright ©1999-2011 ÏÃÃÅÁèÖڿƼ¼ÓÐÏÞ¹«Ë¾ ÏÃÃÅÓÅͨ»¥Áª¿Æ¼¼¿ª·¢ÓÐÏÞ¹«Ë¾ All rights reserved

    µØÖ·(ADD)£ºÏÃÃÅÈí¼þÔ°¶þÆÚÍûº£Â·63ºÅ701E£¨¶«ÄÏÈÚͨÅÔ£© Óʱà(ZIP)£º361008

    µç»°£º0592-5908028 ´«Õ棺0592-5908039 ×ÉѯÐÅÏ䣺web@lingzhong.cn ×ÉѯOICQ£º173723134

    ¡¶ÖлªÈËÃñ¹²ºÍ¹úÔöÖµµçÐÅÒµÎñ¾­ÓªÐí¿ÉÖ¤¡·ÃöB2-20100024  ICP±¸°¸:ÃöICP±¸05037997ºÅ