📚 LinuxDocs
Topics:
All Pages8021X HOWTOACP ModemACPI HOWTOADSL Bandwidth Man..ATA RAID HOWTOATM Linux HOWTOAX25 HOWTOAccessibility Dev ..Accessibility HOWTOAdv Bash Scr HOWTOAdv Routing HOWTOAntares RAID sparc..Apache Compile HOWTOApache WebDAV LDAP..Assembly HOWTOAstronomy HOWTOAthlon Powersaving..Authentication Gat..Autodir HOWTOAviation HOWTOAvr Microcontrolle..BRIDGE STP HOWTOBTTVBackspaceDeleteBandwidth Limiting..Bangla HOWTOBash Prompt HOWTOBattery PoweredBelarusian HOWTOBelgian HOWTOBeowulf HOWTOBocaBogoMipsBootdisk HOWTOBridgeC++ dlopenC C++Beautifier HO..C editing with VIM..CDROM HOWTOCDServer HOWTOCable ModemCaudium HOWTOClone HOWTOCompaq Remote Insi..Compaq T1500 HOWTOConexant+Rockwell ..Cryptoloop HOWTODB2 HOWTODHCPDSL HOWTODVD Playback HOWTODebian Binary Pack..Debian JigdoDebian and Windows..Disk Encryption HO..Disk on Chip HOWTODocBook Demystific..DocBook InstallDocBook OpenJade S..Ecology HOWTOEmacspeak HOWTOEncourage Women Li..Encrypted Root Fil..Euro Char SupportEvent HOWTOFedora Multimedia ..Finnish HOWTOFirewall PiercingFlash Memory HOWTOFont HOWTOFramebuffer HOWTOGCC HOWTOGIS GRASSGlibc Install HOWTOHOWTO HOWTOHOWTO INDEXHP HOWTOHandspring VisorHard Disk UpgradeHardware HOWTOHighQuality Apps H..Home Electrical Co..IBM7248 HOWTOIO Perf HOWTOIP AliasIP Masquerade HOWTOIRCImplement Sys Call..Indic Fonts HOWTOInfrared HOWTOIngresII HOWTOInstall StrategiesInstallation HOWTOInstallfest HOWTOIntkeybItalian HOWTOJabber Server Farm..JavaStation HOWTOKerberos Infrastru..Kernel HOWTOKerneldKodak Digitalcam H..LDAP HOWTOLDP Reviewer HOWTOLILO crash rescue ..LVM HOWTOLeased LineLegoLinksys Blue Box R..Linux+Win95Linux+Win9x+Grub H..Linux+Windows HOWTOLinux Complete Bac..Linux Crash HOWTOLinux Gamers HOWTOLinux Modem SharingLinux Promise RAID..Linux i386 Boot Co..LinuxGL QuakeWorld..Lotus DominoR5MILO HOWTOMMBase Inst HOWTOMP3 CD BurningMail User HOWTOMajordomo MajorCoo..Man PageMasquerading Simpl..Medicine HOWTOMindTerm SSH HOWTOMobile IPv6 HOWTOMock MainframeModule HOWTOModulesMotorola Surfboard..Mozilla OptimizationMulti Distro DevNCURSES Programmin..NFS HOWTONFS Root Client mi..NIS HOWTONetMeeting HOWTONetwork boot HOWTONvidia OpenGL Conf..OLSR IPv6 HOWTOOnline Troubleshoo..Oracle 9i Fedora 3..PA RISC Linux Boot..PCTel MicroModem C..PHP Nuke HOWTOPPP HOWTOPagerPalmOS HOWTOPartitionPartition Mass Sto..Partition Mass Sto..Partition RescuePine ExchangePortSlavePost Installation ..Postfix Cyrus Web ..Pre Installation C..Print2WinPrinting HOWTOProcess AccountingProgram Library HO..Proxy ARP SubnetQmail ClamAV HOWTOQmail VMailMgr Cou..Querying libiptc H..RPM HOWTOReading List HOWTORedHat CD HOWTOReliance HOWTORemote BridgingRemote Serial Cons..SCSI 2.4 HOWTOSCSI Generic HOWTOSLIP PPP EmulatorSRM HOWTOSSL Certificates H..Scanner HOWTOScientific Computi..Scripting GUI TclTkSecure CVS PserverSecure Programs HO..Security HOWTOSecurity Quickstar..Security Quickstar..Serial Laplink HOWTOSerial Programming..Slovak HOWTOSmall MemorySmart Card HOWTOSoftware Proj Mgmt..Software Release P..Sound HOWTOSpam Filtering for..Speech Recognition..SquashFS HOWTOSybase ASA HOWTOSybase ASE HOWTOSybase PHP ApacheTCP Keepalive HOWTOTamil Linux HOWTOTimePrecision HOWTOTimeSys Linux Inst..Token RingTraffic Control HO..Traffic Control tc..UPS HOWTOUnix Hardware Buye..Unix and Internet ..UpgradeUsenet News HOWTOUser Authenticatio..VB6 to TclVMS to Linux HOWTOVPN HOWTOValgrind HOWTOVideoLAN HOWTOVim HOWTOVirtual WebWebcam HOWTOWikiText HOWTOWindows Newsreader..Wireless Link sys ..Wireless Sync HOWTOXDM XtermXDMCP HOWTOXFree Local multi ..XFree86 HOWTOXFree86 R200XFree86 Second MouseXFree86 Video Timi..XML RPC HOWTOXWindow Overview H..XWindow User HOWTOXinerama HOWTOXterminalsHtml singleI810 HOWTOLibdc1394 HOWTOOpenMosix HOWTOPhhttpd HOWTOPpp sshText
Next Previous Contents

7. How to Setup Enterprise Java Bean (EJB) Support

To be written.

7.1 BEA WebLogic

To be written.

See http://www.beasys.com/linux/for more information.

7.2 EJBoss

Background

EJBoss has been renamed JBoss and is well advanced with stable J2EE compliant releases at http://www.jboss.org/.

This section was written when it was still EJBoss 0.95 and needs to be updated.

Download

JBoss can be downloaded from the JBoss website at http://www.jboss.org/.

Installation

I suggest installing files in the /usr/local directory. After downloading, run:

mkdir /usr/local/ejboss 
mv ejboss* /usr/local/ejboss

Unjar the file:

jar xvf ejboss095_jdk122.jar

You should see various files and directories created under /usr/local/ejboss. .:: storage.googleapis.com ::.

The above example shows EJBoss 0.95 for JDK 1.2.2. Substitute the file names as appropriate.

Setting up Your Environment

The environment variables to set up are:

The CLASSPATH environment variable references all JARs and directories that you will need to compile and run Java programs.

Include the EJBoss JAR and the beans/generated directory in your CLASSPATH.

export CLASSPATH=/usr/local/ejboss/lib/ejboss095_jdk122.jar:/usr/local/ejboss/beans/generated:$CLASSPATH

Confiming Your Installation

You are now ready to compile and run a simple EJB application. Create the following three source files for the server. .:: www.crossroadsbaitandtackle.com ::.

First, the business interface.

// EJBTest.java

import javax.ejb.*;
import java.rmi.RemoteException;

public
 interface EJBTest extends EJBObject { 
  public String greet() throws
 RemoteException;

}

Second, the home interface.

// EJBTestHome.java

import javax.ejb.*;
import java.rmi.RemoteException;

public
 interface EJBTestHome extends EJBHome {

  public EJBTest create() throws
 
   CreateException, RemoteException;
}

Third, the bean implementation class.

// EJBTestBean.java

import javax.ejb.*;
import java.rmi.RemoteException;

public
 interface EJBTestBean implements SessionBean {

  private SessionContext
 mContext = null;

  public void ejbPassivate() {
    System.out.println("EJBTestBean
 passivated.");
}

  public void ejbActivate() {
    System.out.println("EJBTestBean
 activated.");
}

  public void ejbCreate() {
    System.out.println("EJBTestBean
 created.");
}

  public void ejbRemove() {
    System.out.println("EJBTestBean
 removed.");
}

  public void setSessionContext() {
    System.out.println("EJBTestBean
 context set.");
    mContext = context;
}

  public String greet()
 {
    return "Hello, I'm an EJB!";
}

}

Compile the server source files with the Java compiler:

javac EJBTest*.java

If the compiler produces errors, double check the syntax and confirm your PATH and CLASSPATH.

Now that you have successfully written and compiled the server source files, you need to deploy your bean to EJBoss. Deploying a bean to EJBoss requires several steps that must be performed exactly.

First, create the file ejb-jar.xml.

<?xml version="1.0" encoding="Cp1252"?>
 
<ejb-jar ID="">
     <description></description>
     <display-name></display-name>
     <small-icon></small-icon>
     <large-icon></large-icon>
     <ejb-client-jar></ejb-client-jar>
     <enterprise-beans>
       <session>
         <description>Nextgen bean</description>
         <ejb-name>nextgen.EJBTest</ejb-name>
         <home>EJBTestHome</home>
         <remote>EJBTest</remote>
         <ejb-class>EJBTestBean</ejb-class>
         <session-type>Stateful</session-type>
         <transaction-type>Bean</transaction-type>
         <env-entry>
           <description></description>
           <env-entry-name></env-entry-name>
           <env-entry-type>java.lang.String</env-entry-type>
           <env-entry-value></env-entry-value>
         </env-entry>
         <resource-ref>
           <description></description>
           <res-ref-name></res-ref-name>
           <res-type></res-type>
           <res-auth>Container</res-auth>
         </resource-ref>
       </session>
     </enterprise-beans>
     <assembly-descriptor />
   </ejb-jar>

The above file, which must be named ejb-jar.xml identifies the interface and class names of files that you just created as well as a name for the object.

Second, relative to the directory of the three class files you just created, create a META-INF directory.

mkdir META-INF
mv ejb-jar.xml META-INF

Third, package all four files into a jar.

jar cvf EJBTest.jar EJBTest*.class META-INF/ejb-jar.xml

You should see that it added the manifest as well as the three class files and the XML deployment descriptor file. [Reddit: Microsoft SQL Server Discussion] [Google Scholar: PostgreSQL]

Fourth, put the JAR you just created in the EJBoss beans directory.

mv EJBTest.jar /usr/local/ejboss/beans

Fifth, move the class files you created to the EJBoss beans/generated directory. .:: mentor.khai.edu ::.

mv EJBTest*.class /usr/local/ejboss/beans/generated

(This fifth step is redudant due to a bug in EJBoss 0.95. ) .:: podcasts.apple.com ::.

You are now ready to start the EJBoss server.

cd /usr/local/ejboss

sh server.sh

You should see the proxy files compile automatically and confirmation that your EJB is deployed.

You are now ready to write, compile and test the simple client applicaiton. .:: zb3.org ::.

7.3 Bullsoft JOnAS EJB

To be written.

See http://www.bullsoft.com/ejb/for more information.


Next Previous Contents

Share or Research:

Share on FB Post to X LinkedIn 🤖 Ask AI about this