JOnAS configuration files

This section is a survival guide to JOnAS main configuration files. If you need more in-depth information, check JOnAS Configuration Guide.

JOnAS configuration resides in few configuration files:

Additional configuration files may be required for specific features such as security propagation context or use of JCA. For those advanced features, refer to the JOnAS Configuration Guide documentation.

jonas.properties

JOnAS checks first for $JONAS_ROOT/config/jonas.properties, then $HOME/jonas.properties and finally ./jonas.properties. Files are read in this order each one overriding the values previously defined. Here is a jonas.properties file example:

###################### JOnAS Server configuration
#

#  Set the name of the JOnAS Server
jonas.name			jonas

#  Set the port number on which the remote objects receive calls
#  If port is zero, an anonymous port is chosen.
jonas.orb.port			0

#  Set the Registry launching mode
#  If set to 'automatic', the registry is launched in the same JVM as EJBServer,
#                         if it's not already started.
#  If set to 'collocated', the registry is launched in the same JVM as EJBServer
#  If set to 'remote', the registry has to be launched before in a separate JVM
jonas.registry			automatic

#  Set the list of the services launched in the JOnAS Server.
#  all JOnAS services possible are: jmx,security,jtm,dbm,resource,jms,ejb.
#  jtm,ejb are mandatory
# Order in the list is important.
# - jmx must be declared first.
# - jms must be declared before ejb.
# 
jonas.services			jmx,security,jtm,dbm,resource,jms,ejb

#
###################### JOnAS JMX service configuration
#
#  Set the name of the implementation class of the jmx service
jonas.service.jmx.class		org.objectweb.jonas.jmx.JmxServiceImpl


#
###################### JOnAS EJB Container service configuration
#
#  Set the name of the implementation class of the ejb service
jonas.service.ejb.class		org.objectweb.jonas.container.EJBServiceImpl

#  Set the list of container that must be created JOnAS  Server launch time.
#  Here should be given a coma-separated list of ejb-jar files names or standard XML deployment 
#  descriptors files names.
#  If the file name has a relative path, this path is relative from where the
#  EJB Server is launched.
#  in case of ejb-jar files if the file is not found 
#  it will be searched in $JONAS_ROOT/ejbjars/ directory. 
jonas.service.ejb.descriptors	myBean.xml,oneApp.jar

#  Set the XML deployment descriptors parsing mode (with or without validation)
jonas.service.ejb.parsingwithvalidation		false

#  Set the size of the thread pool used for message driven beans
jonas.service.ejb.mdbthreadpoolsize	10

#
###################### JOnAS DBM Database service configuration
#
#  Set the name of the implementation class of the dbm service
jonas.service.dbm.class		org.objectweb.jonas.dbm.DataBaseServiceImpl

#  Set the jonas DataSources. This enables the JOnAS server to load
#  the data dources, to load related jdbc drivers, and to register the data 
#  sources into JNDI.
#  This property is set with a coma-separated list of Datasource properties
#  file names (without the '.properties' suffix).
#  Ex: Oracle1,InstantDB1 (while the Datasources properties file names are
#                          Oracle1.properties and InstantDB1.properties)
jonas.service.dbm.datasources	Oracle1	


#
###################### JOnAS JTM Transaction service configuration
#

#  Set the name of the implementation class of the jtm service
jonas.service.jtm.class		org.objectweb.jonas.jtm.TransactionServiceImpl

#  Set the Transaction Manager launching mode.
#  If set to 'true', TM is remote: TM must be already launched in an other JVM.
#  If set to 'false', TM is local: TM is going to run into the same JVM 
#  than the jonas Server. 
jonas.service.jtm.remote	false

#  Set the default transaction timeout, in seconds.
jonas.service.jtm.timeout	60


#
###################### JOnAS SECURITY service configuration
#
#  Set the name of the implementation class of the security service
jonas.service.security.class	org.objectweb.jonas.security.JonasSecurityServiceImpl


#
###################### JOnAS JMS service configuration
#
#  Set the name of the implementation class of the jms service
jonas.service.jms.class		org.objectweb.jonas.jms.JmsServiceImpl

#  Indicates the Jms service must be started with this class for administering the mom
jonas.service.jms.mom		org.objectweb.jonas_jms.JmsAdminForJoram

#  Set the Jms Server launching mode
#  If set to 'true'  it is launched in the same JVM as EJBSErver
#  If set to 'false' Jms Server is launched in a separate JVM
jonas.service.jms.collocated	true

#  Set to the url connexion when the Jms server is not collocated
#jonas.service.jms.url		joram://localhost:16010

#  Set the list of administered objects topics to be created at EJBServer launching time
#  If this property isn't set a default topic named sampleTopic	is created
#jonas.service.jms.topics	

#  Set the list of administered objecst queuess to be created at EJBServer launching time
#  If this property isn't set a default queue named sampleQueue	is created
#jonas.service.jms.queues
		
#
###################### JOnAS JCA resource service configuration
#
#  Set the name of the implementation class of the JCA resource service
jonas.service.resource.class	org.objectweb.jonas.resource.ResourceServiceImpl

#  Set the list of Resource Adapter to be used. 
#  This enables the JOnAS server to configure the resource adapter and register it into JNDI.
#  This property is set with a coma-separated list of Resource Adapter properties
#  file names (without the '.properties' suffix).
#  Ex: XXXX,YYYY (while the Resource Adapter properties file names are
#                          XXXX.properties and YYYY.properties)
jonas.service.resource.resources		

jndi.properties

The jndi.properties file is automatically looked up by JNDI in the classpath.

Properties to set for use with RMI or DAVID:

java.naming.factory.initial	com.sun.jndi.rmi.registry.RegistryContextFactory
java.naming.provider.url	rmi://localhost:1099
java.naming.factory.url.pkgs	org.objectweb.jonas.naming

Properties to set for use with JEREMIE:

java.naming.factory.initial	org.objectweb.jeremie.libs.services.registry.jndi.JRMIInitialContextFactory
java.naming.provider.url	jrmi://localhost:12340
java.naming.factory.url.pkgs	org.objectweb.jonas.naming

Database access

Any database with a JDBC driver can be used with JOnAS. Sample properties files are provided for Oracle, InstantDB, Interbase and PostgreSQL. If you want to setup a new database you can take one of those configuration files and modify it to suit your database driver requirements. Here is a minimal example for use with MySQL and the MM-MySQL JDBC driver:

#####
#  DataSource configuration
#
datasource.name         mysql_ds
datasource.url          jdbc:mysql://localhost/mytestdb
datasource.classname    org.gjt.mm.mysql.Driver
datasource.username     client
datasource.password     clientpassword


#####
#  ConnectionManager configuration
#

#  JDBC connection checking level.
#     0 = no special checking
#     1 = check physical connection is still open before reusing it
#     2 = try every connection before reusing it
jdbc.connchecklevel	1

#  Max age for jdbc connections
#     nb of minutes a connection can be kept in the pool
jdbc.connmaxage		30

#  Test statement
jdbc.connteststmt	select 1

Note that mysql_ds is the name that you will have to use in your beans deployment descriptors to reference this datasource. Also if you called this file mysql.properties, you must define a line like jonas.service.dbm.datasources mysql in your jonas.properties file.