1. ejbddinit

This section explains how to automatically create the JEUS EJB DD file (jeus-ejb-dd.xml), using the information in the ejb-jar.xml file and previously created property files.

The properties required to deploy EJB can be set as default values, so the JEUS EJB DD file is not required. Although the JEUS EJB DD file is not necessary to create a new EJB, it can be used to create an application or to easily create templates to migrate applications to JEUS.

The annotation-based method implemented in Java EE 6 is no longer supported since it can be configured within the source files.

The following describes how to use the tool and parameters.

  • Usage

    ejbddinit [-property property_file_path]
              [-level log_level]
              [-source application_file_or_directory_name]
  • Parameters

    Parameter Description

    [-property property_file_path]

    Path to the property files. This option is required to create the jeus-ejb-dd.xml file correctly. Values can be set by mapping properties to JEUS EJB DD tags. For more information about the list of configurable properties, refer to List of properties.

    • Example 1)

      export-port=40001

      Creates the jeus-ejb-dd.xml file and sets export-port to 40001 for all EJBs.

    • Example 2)

      SampleBean.export-port=40004

      Creates the jeus-ejb-dd.xml file and sets export-port to 40004 for the EJB with a name of SampleBean in the ejb.jar file. By placing a dot(.) separator before each property name, the property of a specific EJB can be set. If the same property exists in a EJB, the property that names a specified EJB has higher property.

    [-level log_level]

    Log level displayed on the screen when executing ejbddinit.

    [-source application_file_or_directory_name]

    Path to the EJB modules. The EJB module can be a directory or a compressed file with the .jar extension.

    If a JEUS EJB DD file is successfully created and the EJB module is a directory, the jeuc-ejb-dd.xml file is created under the META-INF folder. If the EJB module is a compressed file, a new compressed file with the ".new" extension, added to the original file name, is created. The jeus-ejb-dd.xml file is also created under the META-INF folder within the compressed file.

  • Example

    • Display usage information.

      $ ejbddinit
    • Create the ejb.jar.new file based on the propertied defined in ejbddinit.properties for the ejb.jar file. The jeus-ejb-dd.xml file is under the META-INF folder in the ejb.jar.new file.

      $ ejbddinit -property ejbddinit.properties -source ejb.jar
    • Create the jeus-ejb-dd.xml file for the ejb_dir based on the properties defined in the ejbddinit.properties in the META-INF folder.

      $ ejbddinit -property ejbddinit.properties -source ejb_dir
    • Create the jeus-ejb-dd.xml file based on the properties defined in ejbddinit.properties. Since the source option value is not provided, the path to the EJB module must be set in ejbddinit.properties.

      $ ejbddinit -property ejbddinit.properties
    • Create the ejb.jar.new file based on the properties defined in ejbddinit.properties for the ejb.jar file. The jeus-ejb-dd.xml file is under the META-INF folder in the ejb.jar.new file. The FILE logging level outputs the logs onto the screen.

      $ ejbddinit -property ejbddinit.properties -level FINE -source ejb.jar

      ejbddinit supports Ant Task. The ejbddinit Ant Task is described in [sect_jeus_ejb_ejbddinit_ant_task].

List of properties

The following is a list of properties supported by ejbddinit. Refer to the descriptions of the corresponding jeus-ejb-dd.xml tags for property details.

Property Type Note

source

String

Path to EJB modules. This is not related to the jeus-ejb-dd.xml tags.

logging-level

String

Log level displayed when ejbddinit is executed. This is not related to jeus-ejb-dd.xml tags.

export-name

String

Corresponds to the <export-name> tag of jeus-ejb-dd.xml. This property is recommended only for specific EJBs. For more information, refer to Supported patterns for export-name property.

local-export-name

String

Corresponds to the <local-export-name> tag of jeus-ejb-dd.xml. This property is recommended only for specific EJBs.

export-port

int (not negative)

Corresponds to the <export-port> tag of jeus-ejb-dd.xml.

export-iiop

boolean

Corresponds to the <export-iiop> tag of jeus-ejb-dd.xml.

thread-max

int (not negative)

Corresponds to the <thread-max> tag of jeus-ejb-dd.xml.

bean-pool-min

int (not negative)

Corresponds to the <bean-pool>/<pool-min> tag of jeus-ejb-dd.xml.

bean-pool-max

int (not negative)

Corresponds to the <bean-pool>/<pool-max> tag of jeus-ejb-dd.xml.

connect-pool-min

int (not negative)

Corresponds to the <connect-pool>/<pool-min> tag of jeus-ejb-dd.xml.

connect-pool-max

int (not negative)

Corresponds to the <connect-pool>/<pool-max> tag of jeus-ejb-dd.xml.

capacity

int (not negative)

Corresponds to the <capacity> tag of jeus-ejb-dd.xml.

passivation-timeout

long (not negative or -1 for disable)

Corresponds to the <passivation-timeout> tag of jeus-ejb-dd.xml.

disconnect-timeout

long (not negative or -1 for disable)

Corresponds to the <disconnect-timeout> tag of jeus-ejb-dd.xml.

engine-type

String (defined)

Corresponds to the <engine-type> tag of jeus-ejb-dd.xml.

Input options:

  • EXCLUSIVE_ACCESS

  • SINGLE_OBJECT

  • MULTIPLE_OBJECT

subengine-type

String (defined)

Corresponds to the <subengine-type> tag of jeus-ejb-dd.xml.

Input options:

  • ReadLocking

  • WriteLocking

  • WriteLockingFind

fetch-size

int (not negative)

Corresponds to the <fetch-size> tag of jeus-ejb-dd.xml.

init-caching

boolean

Corresponds to the <init-caching> tag of jeus-ejb-dd.xml.

table-name

String

Corresponds to the <table-name> tag of jeus-ejb-dd.xml.

creating-table

String (defined)

Corresponds to the <creating-table> tag of jeus-ejb-dd.xml.

Input options:

  • none

  • use-existing

  • force-create

deleting-table

boolean

Corresponds to the <deleting-table> tag of jeus-ejb-dd.xml.

db-vendor

String

Corresponds to the <db-vendor> tag of jeus-ejb-dd.xml.

datasource-name

String

Corresponds to the <data-source-name> tag of jeus-ejb-dd.xml.

enable-instant-ql

boolean

Corresponds to the <enable-instant-ql> tag of jeus-ejb-dd.xml.

Supported patterns for the export-name property

In general, export-name is set to the EJB module name or set by using the values of the <ejb-name> and <ejb-class> tags of the EJB component defined in ejb-jar.xml. Patterns are provided for easier use of these values.

Pattern Name Pattern Value

%{module-name}

EJB module name. For jar files, use the file name without the .jar extension.

%{ejb-name}

EJB component name. The tag value of <ejb-name> of the EJB component defined in ejb-jar.xml.

%{ejb-fqn}

Fully qualified name of the EJB class of the EJB component. The value of the <ejb-class> tag of the EJB component defined in ejb-jar.xml.

%{ejb-class}

Class name without the package name from the value of %{ejb-fqn}.

The following describes how to use patterns. The example assumes that an EJB class named 'sample-ejb' exists and the fully qualified EJB component class name is 'sample.SampleBean'. It is packaged within an EJB module named 'myejb'.

  • Set export-name to 'myejb_sample-ejb'.

    export-name=%{module-name}_%{ejb-name}
  • Set export-name to 'PREFIX_sample.SampleBean'.

    export-name=PREFIX_%{ejb-fqn}
  • Set export-name to 'SampleBean_POSTFIX'.

    export-name=%{ejb-class}_POSTFIX

As shown in the previous example, when setting export-name, a combination of patterns can be used or the required (such as PREFIX or POSTFIX) character strings can be appended to a pattern. The pattern name is case insensitive.

Property File Example

The following is an example of creating the ejbddinit property file. It is recommended to modify the following example to suit each EJB in which JEUS EJB DD is created.

# PROPERTY FILE SAMPLE
# JEUS EJB DD Generation Option

# target file or directory path
source=/home/workspace/ejb.jar

# log-level for EJB DD init
logging-level=DEBUG

# JEUS EJB DD configuration tag and value pairs for all EJBs
db-vendor=mysql
datasource-name=jdbc/__default
creating-table=use-existing
deleting-table=false
engine-type=EXCLUSIVE_ACCESS
subengine-type=ReadLocking
fetch-size=1111
enable-instant-ql=true
export-port=9999
export-iiop=false
thread-max=100
bean-pool-min=10
bean-pool-max=100
capacity=10000
passivation-timeout=300000
disconnect-timeout=-1
connect-pool-min=10
connect-pool-max=100
init-caching=false

# JEUS EJB DD configuration tag and value pairs for BookBean EJB
BookBean.export-name=BookBeanFromProperty
BookBean.local-export-name=LocalBookBeanFromProperty
BookBean.export-port=55555
BookBean.thread-max=100