用Java实现可保存状态的数据库生成XML树(8)

80酷酷网    80kuku.com

  xml|生成xml|数据|数据库4.ejb-jar.xml文件
<?xml version="1.0" encoding="GBK"?>

<!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.1//EN' 'http://java.sun.com/j2ee/dtds/ejb-jar_1_1.dtd'>
<ejb-jar>
  <enterprise-beans>
    <session>
      <ejb-name>ResultEdit</ejb-name>
      <home>com.sitechasia.ejb.ResultEditHome</home>
      <remote>com.sitechasia.ejb.ResultEdit</remote>
      <ejb-class>com.sitechasia.ejb.ResultEditBean</ejb-class>
      <session-type>Stateful</session-type>
      <transaction-type>Container</transaction-type>
        <resource-ref>
         <res-ref-name>imis</res-ref-name>
         <res-type>javax.sql.DataSource</res-type>
         <res-auth>Application</res-auth>
        </resource-ref>
      
    </session>
  </enterprise-beans>
  <assembly-descriptor>
    <container-transaction>
      <method>
    <ejb-name>ResultEdit</ejb-name>
    <method-name>*</method-name>
      </method>
      <trans-attribute>Required</trans-attribute>
    </container-transaction>
  </assembly-descriptor>
</ejb-jar>

5.weblogic-ejb-jar.xml文件
<?xml version="1.0"?>
<!DOCTYPE weblogic-ejb-jar PUBLIC '-//BEA Systems, Inc.//DTD WebLogic 5.1.0 EJB//EN' 'http://www.bea.com/servers/wls510/dtd/weblogic-ejb-jar.dtd'>
<weblogic-ejb-jar>
    <weblogic-enterprise-bean>
        <ejb-name>ResultEdit</ejb-name>
        
          <reference-descriptor>
        <resource-description>
         <res-ref-name>
          imis
         </res-ref-name>
         <jndi-name>
          imis_jndi
         </jndi-name>
        </resource-description>
      </reference-descriptor>
        <jndi-name>ResultEdit</jndi-name>
    </weblogic-enterprise-bean>
</weblogic-ejb-jar>

6.build.cmd文件
REM Copyright (c) 2000 BEA Systems, Inc. All Rights Reserved.
REM You must set your environment by running the setCabinsEnv shell script
REM prior to executing this script.

REM Create the build directory, and copy the deployment descriptors into it
mkdir build build\META-INF
copy *.xml build\META-INF

REM Compile EJB classes into the build directory (jar preparation)
javac -d build ResultEdit.java ResultEditHome.java ResultEditBean.java

REM Make a EJB jar file, including XML deployment descriptors
cd build
jar cv0f ResultEdit.jar META-INF com
cd ..

REM Run EJBC on jar file
java -classpath %classpath%;%weblogic_HOME%/lib/weblogic_sp.jar;%weblogic_HOME%/lib/weblogic.jar weblogic.ejbc -compiler javac build\ResultEdit.jar %Weblogic_HOME%\config\mydomain\applications\ResultEdit.jar

REM Compile servlets and EJB interfaces into WEB-INF/classes directory of the Cabins Web App
REM This ensures that the EJB can be accessed by JSPs and servlets of the Cabins Web App
 



分享到
  • 微信分享
  • 新浪微博
  • QQ好友
  • QQ空间
点击: