zoukankan      html  css  js  c++  java
  • 第一个EJB示例

    FirstEJB2.0.zip

    Eclipse + JBoss 5.1

    Ejb3Example.zip

    Eclipse + JBoss 7.1

    注意点:

    1. jboss 增加用户:

    D:DevProgramsjbossjboss-as-7.1.1.Finalin>add-user.bat
    
    What type of user do you wish to add?
     a) Management User (mgmt-users.properties)
     b) Application User (application-users.properties)
    (a): b
    
    Enter the details of the new user to add.
    Realm (ApplicationRealm) :
    Username : cg
    Password :
    Re-enter Password :
    What roles do you want this user to belong to? (Please enter a comma separated l
    ist, or leave blank for none) : testrole
    About to add user 'cg' for realm 'ApplicationRealm'
    Is this correct yes/no? yes
    Added user 'cg' to file 'D:DevProgramsjbossjboss-as-7.1.1.Finalstandaloneco
    nfigurationapplication-users.properties'
    Added user 'cg' to file 'D:DevProgramsjbossjboss-as-7.1.1.Finaldomainconfig
    urationapplication-users.properties'
    Added user 'cg' with roles testrole to file 'D:DevProgramsjbossjboss-as-7.1.1
    .Finalstandaloneconfigurationapplication-roles.properties'
    Added user 'cg' with roles testrole to file 'D:DevProgramsjbossjboss-as-7.1.1
    .Finaldomainconfigurationapplication-roles.properties'
    Press any key to continue . . .
    

      

    2.  jboss-as-7.1.1.Finalstandaloneconfigurationstandalone.xml

        <interfaces>
            <interface name="management">
                <inet-address value="${jboss.bind.address.management:127.0.0.1}"/>
            </interface>
            <interface name="public">
                <inet-address value="${jboss.bind.address:0.0.0.0}"/>
            </interface>
            <interface name="unsecure">
                <inet-address value="${jboss.bind.address.unsecure:127.0.0.1}"/>
            </interface>
    		<-- add begin -->
            <interface name="any">
                <any-ipv4-address/>
            </interface>
    		<-- add end -->
        </interfaces>
    	<!--default-interface="public" 改为 default-interface="any"  >
        <socket-binding-group name="standard-sockets" default-interface="any" port-offset="${jboss.socket.binding.port-offset:0}">
    

    3. EJB Client项目要引用:  jboss-as-7.1.1.Finalinclientjboss-client.jar

    PS:

    ejb查找名:
    ejb:<app-name>/<module-name>/<distinct-name>/<bean-name>!<fully-qualified-classname-of-the-remote-interface>
    ejb stateful:
    ejb:<app-name>/<module-name>/<distinct-name>/<bean-name>!<fully-qualified-classname-of-the-remote-interface>?stateful

  • 相关阅读:
    InnoDB实现MVCC原理
    Python中定义函数时参数有默认值的小陷阱
    Python系统编程笔记
    Python中的字典
    Python中常见的字符串小笔试题
    Oracle常见名词解析
    Oracle数据库面试题【转载】
    Oracle日期语言修改
    Oracle日期时间函数大全
    Oracle数据库分页的三种方法
  • 原文地址:https://www.cnblogs.com/wucg/p/4037580.html
Copyright © 2011-2022 走看看