Version 4

    Install and configure a JBoss EJB 3.0 Server

     

    &12488;&12524;&12452;&12523;&65298;&12288;JBoss EJB 3.0&12469;&12540;&12496;&12434;&12452;&12531;&12473;&12488;&12540;&12523;&12377;&12427;

     

    &12399;&12376;&12417;&12395;&65288;Introduction&65289;

     

    EJB 3.0 is supported in JBoss Application Server (AS) version 4.x series. In this trail, we cover how to install a fresh EJB 3.0 server or install EJB 3.0 support in your existing JBoss servers.

     

    EJB 3.0&12399;JBoss AS&12398;&12496;&12540;&12472;&12519;&12531;4.x&12471;&12522;&12540;&12474;&12391;&12469;&12509;&12540;&12488;&12373;&12428;&12414;&12377;&12290;&12371;&12398;&12488;&12524;&12452;&12523;&12391;&12399;&12289;&26032;&12383;&12395;EJB 3.0&12469;&12540;&12496;&12434;&12452;&12531;&12473;&12488;&12540;&12523;&12377;&12427;&26041;&27861;&12392;&12289;&12377;&12391;&12395;&12452;&12531;&12473;&12488;&12540;&12523;&28168;&12415;&12398;JBoss&12469;&12540;&12496;&12395;EJB 3.0&27231;&33021;&12434;&36861;&21152;&12377;&12427;&26041;&27861;&12395;&12388;&12356;&12390;&35500;&26126;&12375;&12414;&12377;&12290;

     

    You can download the JBoss Application Server from http://www.jboss.com/products/jbossas/downloads. We recommend you download JBoss AS version 4.0.4 and above, which bundles the latest EJB 3.0 module (EJB 3.0 RC5), in order to run examples in this trailblazer correctly. It is also possible to install EJB 3.0 RC5 in earlier versions of JBoss AS 4.x (see instructions in the last section of this trail).

     

    JBoss&12450;&12503;&12522;&12465;&12540;&12471;&12519;&12531;&12469;&12540;&12496;&12399;http://www.jboss.com/products/jbossas/downloads&12363;&12425;&12480;&12454;&12531;&12525;&12540;&12489;&21487;&33021;&12391;&12377;&12290;&12371;&12398;TrailBlazer&12391;&20351;&29992;&12377;&12427;&12469;&12531;&12503;&12523;&12434;&27491;&12375;&12367;&23455;&34892;&12377;&12427;&12383;&12417;&12395;&12399;&12289;&26368;&26032;&12398;EJB 3.0&12514;&12472;&12517;&12540;&12523;&65288;EJB 3.0 RC5&65289;&12434;&21547;&12435;&12384;JBoss AS 4.0.4&20197;&38477;&12434;&12480;&12454;&12531;&12525;&12540;&12489;&12377;&12427;&12371;&12392;&12434;&12362;&21223;&12417;&12375;&12414;&12377;&12290;4.0.4&12424;&12426;&21069;&12398;JBoss AS 4.0.x&12395;EJB 3.0 RC5&12434;&12452;&12531;&12473;&12488;&12540;&12523;&12377;&12427;&12371;&12392;&12418;&21487;&33021;&12391;&12377;&12290;&65288;&12371;&12398;&12488;&12524;&12452;&12523;&12398;&26368;&24460;&12398;&12475;&12463;&12471;&12519;&12531;&12434;&21442;&29031;&12375;&12390;&12367;&12384;&12373;&12356;&12290;&65289;

     

    JBoss AS&12452;&12531;&12473;&12488;&12540;&12521;&12391;&12452;&12531;&12473;&12488;&12540;&12523;&12377;&12427;&65288;Use the JBoss AS installer&65289;

     

    The JBoss AS 4.0.4 installer is a executable JAR file. You can run the installer by double clicking it or use the following command.

     

    JBoss AS 4.0.4&12398;&12452;&12531;&12473;&12488;&12540;&12521;&12399;&23455;&34892;&21487;&33021;&12394;JAR&12501;&12449;&12452;&12523;&12391;&12377;&12290;&12501;&12449;&12452;&12523;&12434;&12480;&12502;&12523;&12463;&12522;&12483;&12463;&12377;&12427;&12363;&12289;&12354;&12427;&12356;&12399;&20197;&19979;&12398;&12467;&12510;&12531;&12489;&12391;&23455;&34892;&12391;&12365;&12414;&12377;&12290;

     

    java -jar jboss-4.0.4-installer.jar

     

    Or, you can click on the "Run Installer" link on the JBoss AS download page (http://www.jboss.com/products/jbossas/downloads) to run the installer via Java Web Start.

     

    &12414;&12383;&12289;JBoss AS&12398;&12480;&12454;&12531;&12525;&12540;&12489;&12506;&12540;&12472;&65288;http://www.jboss.com/products/jbossas/downloads&65289;&12398;"Run Installer"&12398;&12522;&12531;&12463;&12434;&12463;&12522;&12483;&12463;&12375;&12390;&12289;Java Web Start&12434;&21033;&29992;&12375;&12390;&12452;&12531;&12473;&12488;&12540;&12521;&12434;&23455;&34892;&12377;&12427;&12371;&12392;&12418;&12391;&12365;&12414;&12377;&12290;

     

    In the installer UI, you can choose a server installation directory. The installer allows you to select a server configuration. Each configuration installs a different set of programming APIs, libraries, and deployers. The all, ejb3, and ejb3-cluster configurations support EJB 3.0. You can also customize the individual components installed in each server configuration via the UI. In the ejb3 configuration, you can remove the JBoss client-side library to reduce the server size. The installer also allows you to set password to secure the management consoles.

     

    &12452;&12531;&12473;&12488;&12540;&12521;&12398;&12518;&12540;&12470;&12452;&12531;&12479;&12501;&12455;&12540;&12473;&12391;&12399;&12289;&12414;&12378;&12469;&12540;&12496;&12398;&12452;&12531;&12473;&12488;&12540;&12523;&12487;&12451;&12524;&12463;&12488;&12522;&12434;&36984;&25246;&12375;&12414;&12377;&12290;&27425;&12395;&12469;&12540;&12496;&35373;&23450;&12434;&36984;&25246;&12375;&12414;&12377;&12290;&21508;&12469;&12540;&12496;&35373;&23450;&12399;&12289;&12381;&12428;&12382;&12428;&30064;&12394;&12427;&12503;&12525;&12464;&12521;&12511;&12531;&12464;API&12289;&12521;&12452;&12502;&12521;&12522;&12289;&12487;&12503;&12525;&12452;&12516;&12398;&32068;&12415;&21512;&12431;&12379;&12434;&12452;&12531;&12473;&12488;&12540;&12523;&12375;&12414;&12377;&12290;all&12289;ejb3&12289;ejb3-cluster&12398;&12469;&12540;&12496;&35373;&23450;&12434;&36984;&25246;&12377;&12427;&12392;&12289;EJB 3.0&12364;&21033;&29992;&12391;&12365;&12414;&12377;&12290;&21508;&12469;&12540;&12496;&35373;&23450;&12391;&12452;&12531;&12473;&12488;&12540;&12523;&12373;&12428;&12427;&20491;&12293;&12398;&12467;&12531;&12509;&12540;&12493;&12531;&12488;&12399;&12289;&12518;&12540;&12470;&12452;&12531;&12479;&12501;&12455;&12540;&12473;&12391;&12459;&12473;&12479;&12510;&12452;&12474;&12377;&12427;&12371;&12392;&12418;&12391;&12365;&12414;&12377;&12290;ejb3&12398;&12469;&12540;&12496;&35373;&23450;&12398;&22580;&21512;&12289;&12463;&12521;&12452;&12450;&12531;&12488;&12469;&12452;&12489;&12398;JBoss&12521;&12452;&12502;&12521;&12522;&12434;&21066;&38500;&12375;&12469;&12540;&12496;&12469;&12452;&12474;&12434;&21066;&28187;&12377;&12427;&12392;&33391;&12356;&12391;&12375;&12423;&12358;&12290;&12452;&12531;&12473;&12488;&12540;&12521;&12391;&12399;&12289;&31649;&29702;&12467;&12531;&12477;&12540;&12523;&12395;&12497;&12473;&12527;&12540;&12489;&35373;&23450;&12434;&34892;&12358;&12371;&12392;&12418;&12391;&12365;&12414;&12377;&12290;

     

    JBoss AS&12398;zip&12501;&12449;&12452;&12523;&12391;&12452;&12531;&12473;&12488;&12540;&12523;&12377;&12427;&65288;Use the zip distribution of JBoss AS&65289;

     

    If you do not wish to use the JBoss AS installer,you can simply download the zip version of the JBoss AS and unzip in any directory on your server. The all configuration in the server supports EJB 3.0 and clustering.

     

    JBoss AS&12398;&12452;&12531;&12473;&12488;&12540;&12521;&12434;&20351;&29992;&12375;&12383;&12367;&12394;&12356;&22580;&21512;&12399;&12289;JBoss AS&12398;zip&12501;&12449;&12452;&12523;&12434;&12480;&12454;&12531;&12525;&12540;&12489;&12375;&12289;&12469;&12540;&12496;&12398;&20219;&24847;&12398;&12487;&12451;&12524;&12463;&12488;&12522;&12395;&23637;&38283;&12375;&12390;&12367;&12384;&12373;&12356;&12290;all&12398;&12469;&12540;&12496;&35373;&23450;&12391;EJB 3.0&12392;&12463;&12521;&12473;&12479;&12522;&12531;&12464;&12434;&20351;&29992;&12391;&12365;&12414;&12377;&12290;

     

    EJB 3.0&12469;&12540;&12496;&12434;&36215;&21205;&12377;&12427;&65288;Run the EJB 3.0 server&65289;

     

    To run the EJB 3.0 server, you can just run the bin/run.sh script (or the bin/run.bat script under Windows) inside the server installation directory. The Tomcat server runs at port 8080 by default. If you have multiple server configurations installed under the server directory, you can specify which one to start using the run.sh -c ConfigName command line option. Without the -c option, the default configuration is started.

     

    EJB 3.0&12469;&12540;&12496;&12434;&36215;&21205;&12377;&12427;&12395;&12399;&12289;&12469;&12540;&12496;&12434;&12452;&12531;&12473;&12488;&12540;&12523;&12375;&12383;&12487;&12451;&12524;&12463;&12488;&12522;&12398;bin/run.sh&12473;&12463;&12522;&12503;&12488;&65288;Windows&12398;&22580;&21512;&12399;bin/run.bat&12473;&12463;&12522;&12503;&12488;&65289;&12434;&23455;&34892;&12377;&12427;&12384;&12369;&12391;&12377;&12290;&12487;&12501;&12457;&12523;&12488;&12391;&12399;&12509;&12540;&12488;8080&30058;&12391;Tomcat&12469;&12540;&12496;&12364;&36215;&21205;&12375;&12414;&12377;&12290;server&12487;&12451;&12524;&12463;&12488;&12522;&12395;&35079;&25968;&12398;&12469;&12540;&12496;&35373;&23450;&12434;&12452;&12531;&12473;&12488;&12540;&12523;&12375;&12390;&12354;&12427;&22580;&21512;&12399;&12289;run.sh&12398;&12467;&12510;&12531;&12489;&12521;&12452;&12531;&12458;&12503;&12471;&12519;&12531; -c ConfigName&12391;&12289;&36215;&21205;&12377;&12427;&12469;&12540;&12496;&35373;&23450;&12434;&25351;&23450;&12391;&12365;&12414;&12377;&12290;-c&12458;&12503;&12471;&12519;&12531;&12434;&25351;&23450;&12375;&12394;&12356;&22580;&21512;&12399;default&12469;&12540;&12496;&35373;&23450;&12391;&36215;&21205;&12375;&12414;&12377;&12290;

     

    You can deploy an application into the server by copying it's archive file into the server/default/deploy directory. You should be able to see the deployment messages on the command console. The following flash movie shows how to start a server from the console and console message for deploying an application.

     

    &12450;&12503;&12522;&12465;&12540;&12471;&12519;&12531;&12434;&12487;&12503;&12525;&12452;&12377;&12427;&12395;&12399;&12289;&12450;&12503;&12522;&12465;&12540;&12471;&12519;&12531;&12398;&12450;&12540;&12459;&12452;&12502;&12501;&12449;&12452;&12523;&12434;server/default/deploy&12487;&12451;&12524;&12463;&12488;&12522;&12395;&12467;&12500;&12540;&12375;&12414;&12377;&12290;&36215;&21205;&12467;&12531;&12477;&12540;&12523;&12395;&12487;&12503;&12525;&12452;&12373;&12428;&12383;&12371;&12392;&12434;&31034;&12377;&12513;&12483;&12475;&12540;&12472;&12364;&34920;&31034;&12373;&12428;&12427;&12399;&12378;&12391;&12377;&12290;&19979;&12398;&12501;&12521;&12483;&12471;&12517;&12512;&12540;&12499;&12540;&12391;&12289;&12467;&12531;&12477;&12540;&12523;&12363;&12425;&12469;&12540;&12496;&12434;&36215;&21205;&12377;&12427;&26041;&27861;&12392;&12289;&12450;&12503;&12522;&12465;&12540;&12471;&12519;&12531;&12434;&12487;&12503;&12525;&12452;&12375;&12383;&12392;&12365;&12398;&12467;&12531;&12477;&12540;&12523;&12513;&12483;&12475;&12540;&12472;&12434;&12372;&35239;&12356;&12383;&12384;&12369;&12414;&12377;&12290;

     

    JBoss EJB 3.0&12469;&12540;&12496;&12398;&21205;&12365;&12434;&35211;&12427;

     

    To deploy the TrailBlazer on your own server or build it from the source, please visit the JBoss TrailBlazer web at at http://www.jboss.com/docs/trailblazer.

     

    TrailBlazer&12434;&12372;&33258;&20998;&12398;&12469;&12540;&12496;&12395;&12487;&12503;&12525;&12452;&12375;&12383;&12426;&12289;&12354;&12427;&12356;&12399;&12477;&12540;&12473;&12363;&12425;TrailBlazer&12434;&12499;&12523;&12489;&12375;&12383;&12426;&12377;&12427;&12395;&12399;&12289;JBoss TrailBlazer&12398;Web&12469;&12452;&12488;http://www.jboss.com/docs/trailblazer&12434;&21442;&29031;&12375;&12390;&12367;&12384;&12373;&12356;&12290;

     

    Important Note: After you deploy the TrailBlazer on your own server, first point your browser to http://localhost:8080/EJB3Trail/. It brings up the landing page and runs the database script on the server.

     

     

    &37325;&35201;&65306;TrailBlazer&12434;&12372;&33258;&20998;&12398;&12469;&12540;&12496;&12395;&12487;&12503;&12525;&12452;&12375;&12383;&12425;&12289;&12414;&12378;&12502;&12521;&12454;&12470;&12363;&12425;http://localhost:8080/EJB3Trail/&12434;&34920;&31034;&12375;&12390;&12367;&12384;&12373;&12356;&12290;&20986;&30330;&12506;&12540;&12472;&12364;&34920;&31034;&12373;&12428;&12289;&12487;&12540;&12479;&12505;&12540;&12473;&12473;&12463;&12522;&12503;&12488;&12364;&23455;&34892;&12373;&12428;&12414;&12377;&12290;

     

    EJB 3.0&12469;&12540;&12496;&12434;&35373;&23450;&12377;&12427;&65288;Configure the EJB 3.0 server&65289;

     

    All the EJB 3.0 libraries and server-wide configuration files are located in the Server_installation/server/default/deploy directory. The server works out of the box with the default configuration. But if you need to change the server properties. Here is a list of configuration files you can edit. The details of the configurations files are discussed in later trails or in the official documentation.

     

    EJB 3.0&12521;&12452;&12502;&12521;&12522;&12392;&12469;&12540;&12496;&20840;&20307;&12398;&35373;&23450;&12501;&12449;&12452;&12523;&12399;&12377;&12409;&12390;[124691254012496124341245212531124731248812540125231237512383124871245112524124631248812522|サーバをインストールしたディレクトリ]/server/default/deploy&12487;&12451;&12524;&12463;&12488;&12522;&12395;&12354;&12426;&12414;&12377;&12290;&12469;&12540;&12496;&12399;&12487;&12501;&12457;&12523;&12488;&12398;&35373;&23450;&12384;&12369;&12391;&23455;&34892;&12391;&12365;&12414;&12377;&12364;&12289;&35373;&23450;&12434;&22793;&26356;&12377;&12427;&24517;&35201;&12364;&12354;&12427;&22580;&21512;&12399;&20197;&19979;&12398;&35373;&23450;&12501;&12449;&12452;&12523;&12434;&20462;&27491;&12375;&12390;&12367;&12384;&12373;&12356;&12290;&35373;&23450;&12501;&12449;&12452;&12523;&12398;&35443;&32048;&12399;&12289;&21029;&12398;&12488;&12524;&12452;&12523;&12289;&12414;&12383;&12399;&27491;&24335;&12489;&12461;&12517;&12513;&12531;&12488;&12391;&35500;&26126;&12373;&12428;&12390;&12356;&12414;&12377;&12290;

     

    • The ejb3.deployer/META-INF/persistence.properties file configures the default database for all entity beans and EntityManager in this server. The default is the server's embedded HSQLDB database.

     

     

    {FOOTNOTE RED #1 1} &12300;&12371;&12398;&12469;&12540;&12496;&12398;&12377;&12409;&12390;&12398;&12456;&12531;&12486;&12451;&12486;&12451;Bean&12392;EntityManager&12398;&12487;&12501;&12457;&12523;&12488;&12487;&12540;&12479;&12505;&12540;&12473;&12301;&12384;&12392;&24605;&12356;&12414;&12377;&12290;&12391;&12418;&23455;&38555;&12399;Hibernate&12398;&21508;&31278;&12503;&12525;&12497;&12486;&12451;&12364;&12354;&12427;&12384;&12369;&12391;&12289;&12487;&12501;&12457;&12523;&12488;&12487;&12540;&12479;&12505;&12540;&12473;&12392;&12363;&25351;&23450;&12373;&12428;&12390;&12356;&12394;&12356;&12290;&12290;&12290; -tokobayashi

     

    • The ejb3-clustered-sfsbcache-service.xml file contains the MBean configuration for the JBoss Cache service that replicates stateful session beans in a cluster.

     

    • ejb3-clustered-sfsbcache-service.xml&12501;&12449;&12452;&12523;&12399;&12289;&12463;&12521;&12473;&12479;&29872;&22659;&12391;&12473;&12486;&12540;&12488;&12501;&12523;&12475;&12483;&12471;&12519;&12531;Bean&12398;&12524;&12503;&12522;&12465;&12540;&12471;&12519;&12531;&12434;&34892;&12358;JBossCache&12469;&12540;&12499;&12473;&12398;MBean&12434;&12375;&12414;&12377;&12290;

     

    • The ejb3-entity-cache-service.xml file contains the MBean configuration for the JBoss Cache service that caches and replicates entity bean objects in a cluster.

     

    • ejb3-entity-cache-service.xm&12501;&12449;&12452;&12523;&12399;&12289;&12463;&12521;&12473;&12479;&29872;&22659;&12391;&12456;&12531;&12486;&12451;&12486;&12451;Bean&12398;&12461;&12515;&12483;&12471;&12517;&12392;&12524;&12503;&12522;&12465;&12540;&12471;&12519;&12531;&12434;&34892;&12358;JBossCache&12469;&12540;&12499;&12473;&12398;MBean&12398;&35373;&23450;&12375;&12414;&12377;&12290;

     

    JBoss AS&12398;&20197;&21069;&12398;&12496;&12540;&12472;&12519;&12531;&12395;EJB 3.0&12487;&12503;&12525;&12452;&12516;&12434;&12452;&12531;&12473;&12488;&12540;&12523;&12377;&12427;&65288;Install and run the EJB 3.0 deployer in earlier JBoss AS versions&65289;

     

    It is also possible to install EJB 3.0 RC5 into JBoss AS 4.0.3, 4.0.2 and 4.0.1. You first need to download a standalone release of JBoss EJB 3.0 RC4 from http://www.jboss.com/products/list/downloadsejb3. Then, you should unzip it and copy contents from the JBoss EJB 3.0 release directory into the server's server/all/deploy. This tutorial outlines the steps to install the latest EJB 3.0 module in JBoss AS 4.0.3 SP1.

     

    JBoss AS 4.0.3&12289;4.0.2&12289;4.0.1&12395;EJB 3.0 RC5&12434;&12452;&12531;&12473;&12488;&12540;&12523;&12377;&12427;&12371;&12392;&12418;&21487;&33021;&12391;&12377;&12290;&12414;&12378;&12399;JBoss EJB 3.0 RC4&65288;&35379;&27880;&65306;RC5&12398;&38291;&36949;&12356;&12363;&65311;&65289;&12398;&12473;&12479;&12531;&12489;&12450;&12525;&12531;&29256;&12434;http://www.jboss.com/products/list/downloadsejb3&12363;&12425;&12480;&12454;&12531;&12525;&12540;&12489;&12375;&12390;&12367;&12384;&12373;&12356;&12290;&12480;&12454;&12531;&12525;&12540;&12489;&12375;&12383;&12501;&12449;&12452;&12523;&12434;&23637;&38283;&12375;&12289;JBoss EJB 3.0&12364;&20837;&12387;&12390;&12356;&12427;&12487;&12451;&12524;&12463;&12488;&12522;&12434;&12469;&12540;&12496;&12398;server/all/deploy&12487;&12451;&12524;&12463;&12488;&12522;&12395;&12467;&12500;&12540;&12375;&12414;&12377;&12290;[このチュートリアル|http://docs.jboss.com/ejb3/app-server/tutorial/installing.html]&12391;JBoss AS 4.0.3SP1&12395;&26368;&26032;&12398;EJB 3.0&12514;&12472;&12517;&12540;&12523;&12434;&12452;&12531;&12473;&12488;&12540;&12523;&12377;&12427;&25163;&38918;&12434;&35500;&26126;&12375;&12390;&12356;&12414;&12377;&12290;

     

    To run the EJB 3.0 container, you need to start the server with the bin/run.sh -c all command.

     

    EJB 3.0&12467;&12531;&12486;&12490;&12434;&23455;&34892;&12377;&12427;&12395;&12399;&12289;bin/run.sh -c all&12467;&12510;&12531;&12489;&12391;&12469;&12540;&12496;&12434;&36215;&21205;&12375;&12390;&12367;&12384;&12373;&12356;&12290;

     

    &12414;&12392;&12417;&65288;Summary&65289;

     

    In this trail, we covered how to install and start the JBoss EJB 3.0 application server. In the next trail, we will discuss how to build and package EJB 3.0 applications.

     

    &12371;&12398;&12488;&12524;&12452;&12523;&12391;&12399;&12289;JBoss EJB 3.0&12450;&12503;&12522;&12465;&12540;&12471;&12519;&12531;&12469;&12540;&12496;&12434;&12452;&12531;&12473;&12488;&12540;&12523;&12375;&12289;&36215;&21205;&12377;&12427;&26041;&27861;&12395;&12388;&12356;&12390;&23398;&32722;&12375;&12414;&12375;&12383;&12290;&12391;&12399;&12289;&27425;&12398;&12488;&12524;&12452;&12523;&12391;EJB 3.0&12450;&12503;&12522;&12465;&12540;&12471;&12519;&12531;&12398;&12499;&12523;&12489;&12392;&12497;&12483;&12465;&12540;&12472;&12531;&12464;&12395;&12388;&12356;&12390;&35696;&35542;&12375;&12414;&12375;&12423;&12358;&12290;

     

    (c) 2005 JBoss, Inc. All Rights Reserved