锘??xml version="1.0" encoding="utf-8" standalone="yes"?>日韩精品一区二区三区在线观看 ,1769在线观看,国产成人精品亚洲精品 http://www.aygfsteel.com/luckyrobbie/category/8782.html<font size=-1>JAVA鏄摑鑹茬殑-</font> <!-- Start FastOnlineUsers.com --> <a ><script type="text/javascript" src="http://fastonlineusers.com/on2.php?d=www.aygfsteel.com/luckyrobbie"></script> online</a><!-- End FastOnlineUsers.com -->zh-cnWed, 28 Feb 2007 08:18:57 GMTWed, 28 Feb 2007 08:18:57 GMT60Weblogic JMS 鐨勯厤緗拰MDB鐨勫簲鐢?鍚絎旇)http://www.aygfsteel.com/luckyrobbie/archive/2006/03/23/37048.htmlluckyrobbieluckyrobbieThu, 23 Mar 2006 06:51:00 GMThttp://www.aygfsteel.com/luckyrobbie/archive/2006/03/23/37048.htmlhttp://www.aygfsteel.com/luckyrobbie/comments/37048.htmlhttp://www.aygfsteel.com/luckyrobbie/archive/2006/03/23/37048.html#Feedback0http://www.aygfsteel.com/luckyrobbie/comments/commentRss/37048.htmlhttp://www.aygfsteel.com/luckyrobbie/services/trackbacks/37048.html
  • 鍦↗MS鐨凜onnection Factories 涓柊寤轟竴涓繛鎺ュ伐鍘?
  • 鍦⊿tores涓柊寤轟竴涓瓨鍌ㄧ┖闂達(dá)紝鍙互涓簀dbc鎴栬協(xié)ile綾誨瀷
  • 鍦⊿ervers涓柊寤轟竴涓猄erver
  • 灞曞紑鍒氭墠鍒涘緩鐨凞emoJMSServer錛屾柊寤轟竴涓狣estinations錛屽叾涓湁2縐嶇被鍨嬶紝queue錛氱偣瀵圭偣鏂瑰紡錛宼opic錛氬箍鎾柟寮忕粰鎵鏈夌殑MDB
  • 鍦╦b涓柊寤轟竴涓狹DB錛宼ransaction type:bean 錛孌estination type:javax.jms.Queue錛屽湪Destination name涓緭鍏ュ垰鎵嶅湪weblogic鐨刯ms閲岄潰寤虹珛鐨勭洰鏍囧悕縐幫紝Pool properties鐨凪aximum pool size:10
  • 鍦╫nMessage鏂規(guī)硶涓姞鍏ヤ唬鐮?
    publicvoid聽onMessage(Message聽msg){聽
    try{

    聽聽聽聽聽聽TextMessage聽TMS聽
    =聽(TextMessage)聽msg;

    聽聽聽聽聽聽String聽a1聽
    =聽TMS.getText();

    聽聽聽聽聽聽String聽b1聽
    =聽a1;

    聽聽聽聽聽聽System.out.println(
    "Message聽getted聽Is聽:"+聽a1聽+">>>>>>>>>>>OK");

    聽聽聽聽聽聽Context聽context聽
    =new聽InitialContext();

    聽聽聽聽聽聽Object聽ref聽
    =聽context.lookup("Sess");聽 //session bean鐨勬湰鍦版帴鍙?br />
    聽聽聽聽聽聽SessHome聽sessHome聽
    =聽(SessHome)聽PortableRemoteObject.narrow(ref,聽SessHome.class);

    聽聽聽聽聽聽sessHome.create().insTableAa11(a1,聽b1);

    聽聽聽聽聽聽
    //榪欐槸閫氳繃Session聽Bean鐨刬nsTableAa11璋冪敤EntityBean鐨別jbHomeEjbInsertAa11

    聽聽聽聽聽聽
    //鍔熻兘鍏舵槸寰堢畝鍗曪紝鎻掑叆Aa11琛ㄤ竴鏉¤褰?a1,a1)

    聽聽聽聽}


    聽聽聽聽
    catch聽(Exception聽ex)聽{

    聽聽聽聽聽聽ex.printStackTrace();

    聽聽聽聽}

    }
  • deploy榪欎釜娑堟伅椹卞姩Bean
  • new涓涓狹DBTestClient class
    package聽bmpsessmdb;
    import聽java.util.*;

    import聽javax.jms.*;

    import聽javax.naming.*;


    publicclass聽MDBTestClient聽{
    聽聽聽聽
    publicfinalstatic聽String

    聽聽聽聽聽聽JNDI_FACTORY聽
    ="weblogic.jndi.WLInitialContextFactory";

    聽聽
    publicfinalstatic聽String聽URL聽="t3://127.0.0.1:7001";

    聽聽
    privatestaticfinal聽String聽QUEUE_CONNECTION_FACTORY聽=

    聽聽聽聽聽聽
    "DemoJMSConnectionFactory";

    聽聽
    privatestaticfinal聽String聽QUEUE聽="DemoJMSQueue";

    聽聽
    privatestatic聽InitialContext聽getInitialContext(String聽url)聽throws

    聽聽聽聽聽聽NamingException聽
    {

    聽聽聽聽Hashtable聽env聽
    =new聽Hashtable();

    聽聽聽聽env.put(Context.INITIAL_CONTEXT_FACTORY,聽JNDI_FACTORY);

    聽聽聽聽env.put(Context.PROVIDER_URL,聽url);

    聽聽聽聽
    returnnew聽InitialContext(env);

    聽聽}




    聽聽
    publicstaticvoid聽main(String[]聽args)聽throws聽Exception聽{

    聽聽聽聽Context聽ctx聽
    =聽getInitialContext(URL);

    聽聽聽聽QueueConnectionFactory聽qConnFact聽
    =

    聽聽聽聽(QueueConnectionFactory)聽ctx.lookup(QUEUE_CONNECTION_FACTORY);

    聽聽聽聽QueueConnection聽qConn聽
    =聽qConnFact.createQueueConnection();

    聽聽聽聽QueueSession聽qSess聽
    =聽qConn.createQueueSession(false,

    聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽Session.AUTO_ACKNOWLEDGE);

    聽聽聽聽Queue聽q聽
    =聽(Queue)聽ctx.lookup(QUEUE);

    聽聽聽聽QueueSender聽qSend聽
    =聽qSess.createSender(q);



    聽聽聽聽TextMessage聽txtMsg聽
    =聽qSess.createTextMessage("songtx3");

    聽聽聽聽System.out.println(
    "Sending聽a聽message聽to聽queue");

    聽聽聽聽qSend.send(txtMsg);

    聽聽聽聽
    //---------------------------------------------------------//

    聽聽聽聽txtMsg聽
    =聽qSess.createTextMessage("songtx4");

    聽聽聽聽System.out.println(
    "Sending聽a聽message聽to聽queue");

    聽聽聽聽qSend.send(txtMsg);

    聽聽聽聽
    //---------------------------------------------------------//

    聽聽聽聽qConn.close();

    聽聽聽聽System.exit(
    0);

    聽聽}


    }
  • 榪愯嫻嬭瘯錛宱ver


  • luckyrobbie 2006-03-23 14:51 鍙戣〃璇勮
    ]]>
    Tomcat 鍜?Weblogic 涓厤緗產(chǎn)pplication鐨勫畨鍏ㄧ瓥鐣?鍚絎旇)http://www.aygfsteel.com/luckyrobbie/archive/2006/03/22/36854.htmlluckyrobbieluckyrobbieWed, 22 Mar 2006 06:24:00 GMThttp://www.aygfsteel.com/luckyrobbie/archive/2006/03/22/36854.htmlhttp://www.aygfsteel.com/luckyrobbie/comments/36854.htmlhttp://www.aygfsteel.com/luckyrobbie/archive/2006/03/22/36854.html#Feedback0http://www.aygfsteel.com/luckyrobbie/comments/commentRss/36854.htmlhttp://www.aygfsteel.com/luckyrobbie/services/trackbacks/36854.html棣栧厛瀹氫箟浜唗omcat-users.xml 涓殑鍐呭錛屼富瑕佽緗簡鐢ㄦ埛鍜岃鑹?br />
    <?xml聽version='1.0'聽encoding='utf-8'?>
    <tomcat-users>
    聽聽
    <role聽rolename="tomcat"/>
    聽聽
    <role聽rolename="role1"/>
    聽聽
    <role聽rolename="manager"/>
    聽聽
    <role聽rolename="wxds"聽description=""/>
    聽聽
    <role聽rolename="admin"/>
    聽聽
    <user聽username="tomcat"聽password="tomcat"聽roles="tomcat"/>
    聽聽
    <user聽username="both"聽password="tomcat"聽roles="tomcat,role1"/>
    聽聽
    <user聽username="role1"聽password="tomcat"聽roles="role1"/>
    聽聽
    <user聽username="abc"聽password="abc"聽fullName="abcabc"聽roles="wxds"/>
    聽聽
    <user聽username="admin"聽password=""聽roles="admin,manager"/>
    </tomcat-users>

    鐒跺悗鍦╝pplication涓殑web.xml涓搴旂殑<web-app>涓鍔犲涓嬭緗?br />
    聽聽聽<security-constraint>
    聽聽聽聽聽聽聽
    <web-resource-collection>
    聽聽聽聽聽聽聽聽聽聽聽
    <web-resource-name>Protected聽Area</web-resource-name>
    聽聽聽聽聽聽聽聽
    <!--聽Define聽the聽context-relative聽URL(s)聽to聽be聽protected-->
    聽聽聽聽聽聽聽聽聽聽聽
    <url-pattern>錛?/span>*</url-pattern>
    聽聽聽聽聽聽聽聽
    <!--聽If聽you聽list聽http聽methods,聽only聽those聽methods聽are聽protected-->
    聽聽聽聽聽聽聽聽
    <http-method>DELETE</http-method>
    聽聽聽聽聽聽聽聽聽聽聽
    <http-method>GET</http-method>
    聽聽聽聽聽聽聽聽聽聽聽
    <http-method>POST</http-method>
    聽聽聽聽聽聽聽聽
    <http-method>PUT</http-method>
    聽聽聽聽聽聽聽
    </web-resource-collection>
    聽聽聽聽聽聽聽
    <auth-constraint>
    聽聽聽聽聽聽聽聽聽聽聽
    <!--聽Anyone聽with聽one聽of聽the聽listed聽roles聽may聽access聽this聽area聽-->
    聽聽聽聽聽聽聽聽聽聽聽
    <role-name>wxds</role-name>
    聽聽聽聽聽聽聽
    </auth-constraint>
    聽聽聽
    </security-constraint>
    聽聽聽
    <login-config>
    聽聽聽聽聽聽聽
    <auth-method>BASIC</auth-method>
    聽聽聽聽聽聽聽
    <realm-name>EShop</realm-name>
    聽聽聽
    </login-config>

    榪欐牱灝卞ソ浜嗭紝鐧誨綍榪欎釜web搴旂敤浼?xì)鏈変釜楠岃瘉绐楀彛寮瑰嚭锛岃緭鍏ョ敤鎴峰悕abc鍜屽瘑鐮乤bc鍚庡氨鑳芥甯歌闂簡銆?br />
    鍦╳eblogic8.1涓殑閰嶇疆姣旇緝楹葷儲錛岄鍏堝湪web.xml鐨?lt;web-app>涓鍔犱笂闈竴孌典唬鐮佸悗錛岃繕瑕佸姞涓婅繖涓孌?br />
    <security-role>
    聽聽聽聽聽聽
    <role-name>wxds</role-name>
    </security-role>

    鐒跺悗鏂板緩涓涓獁eblogic.xml 鍐呭濡備笅
    <?xml聽version="1.0"聽encoding="UTF-8"?>
    <!DOCTYPE聽weblogic-web-app聽PUBLIC聽"-//BEA聽Systems,聽Inc.//DTD聽Web聽Application聽8.1//EN""http://www.bea.com/servers/wls810/dtd/weblogic810-web-jar.dtd">

    <weblogic-web-app>

    聽聽
    <security-role-assignment>
    聽聽聽聽
    <role-name>wxds</role-name>
    聽聽聽聽
    <principal-name>wxds_group</principal-name>
    聽聽
    </security-role-assignment>

    </weblogic-web-app>

    榪涘叆weblogic鐨刢onsole錛屽湪mydomain-security-realms涓柊寤轟竴涓猺ealm
    name: wxdsRealm
    check roles and policies for: web applications and ejbs protected in dd
    灞曞紑wxdsRealm錛?br />鍦╬roviders涓璫onfigure a new default adjudicator... 榛樿鍒涘緩
    鍦╝uditors涓垱寤轟竴涓己鐪乤uditor
    鐒跺悗鍒涘緩涓涓己鐪佺殑authentication,authorizers, cred mappers 鍜宺ole mapper 絳夌瓑
    鏈鍚庡彲浠ュ湪testing涓祴璇曚竴涓?validate this security realm... 鐪嬫槸鍚uccessful

    鍦╣roups涓畾涔変竴涓猤roup name: wxds_group
    鍦╱sers涓璫onfigure a new user
    name: jyds password:11111111
    鎶婂垰鎵嶅緩绔嬬殑wxds_group 澧炲姞榪涙潵

    鎶奡ecurity涓殑Default Realm璁劇疆涓簑xdsRealm, 鏈鍚嶢pply灝眔k鍟︺?br />



    luckyrobbie 2006-03-22 14:24 鍙戣〃璇勮
    ]]>
    主站蜘蛛池模板: 谷城县| 宜兰县| 海安县| 卢龙县| 南通市| 安阳市| 陆河县| 成武县| 商河县| 壶关县| 昌宁县| 揭西县| 博罗县| 盐山县| 昌吉市| 临武县| 济南市| 嘉义县| 鱼台县| 宁城县| 丹巴县| 科技| 安乡县| 宣汉县| 类乌齐县| 东宁县| 益阳市| 鲁甸县| 潼关县| 洱源县| 和田市| 昌都县| 温宿县| 建水县| 潢川县| 永定县| 高阳县| 广河县| 长葛市| 安平县| 营口市|