EJBServer
Resin 3.0

Features
Installation
Configuration
Web Applications
IOC/AOP
Resources
JSP
Quercus
Servlets and Filters
Databases
Admin (JMX)
CMP
EJB
Amber
EJB 3.0
Security
XML and XSLT
XTP
JMS
Performance
Protocols
Third-party
Troubleshooting/FAQ

User's Guide
Reference
Tutorials
Scrapbook

EJBServer
EJB Config
EJB-QL Syntax
Xdoclet tags
Reference
Reference
EJB Config

The Resin-CMP EJB Server is implemented as a JNDI resource. Like any other resource, it is to be set up in resin.conf or web.xml.

  1. The EJBServer resource
  2. Protocol Servlets
    1. Burlap

The EJBServer resource

The following stripped-down web.xml sets up Resin-CMP so local clients can use java:comp/env/cmp to find the home interfaces.

Because the EJB server is a JNDI resource, it can be placed in any JNDI resource context: <web-app>, <host>, or <http-server>. An EJBServer in the <host> context, for example, will be shared across all applications for that host.

The following is a sample web.xml configuration. More details are available in:

EJBServer will automatically read the *.ejb files in WEB-INF and load their defined beans.

web.xml
<web-app>
  <!-- Database configuration -->
  <database>
    <jndi-name>jdbc/test</jndi-name>
    <driver type="org.gjt.mm.mysql.Driver">
      <url>jdbc:mysql://localhost:3306/test</url>
    </driver>
  </database>

  <!-- Resin-CMP server configuration -->
  <ejb-server>
    <jndi-name>java:comp/env/cmp</jndi-name>
    <data-source>java:comp/env/jdbc/test</data-source>
  </ejb-server>
</web-app>

EJBServer init-parameters
ParameterMeaningDefault
auto-compileIf true, automatically generate the persistence and EJB codetrue
create-database-schemaIf the entity beans do not yet exist in the data-source, create the tablesfalse
data-sourceThe database's JNDI namejava:comp/env/jdbc/test
distributedSet true for multiple parallel serversfalse
ejb-config-dirDirectory to search for *.ejb filesWEB-INF
entity-cache-sizeHow many entity beans are cached8192
entity-cache-timeoutHow long a loaded CMP bean can be cached before reloadingInfinity
resin-isolationWhether updates should use row-locking (FOR UPDATE) or rely on the database's isolation databasedatabase
jdbc-isolationSelects the JDBC isolation for an update transactionthe database's default
transaction-timeoutHow long a transaction should wait before timing out (in seconds)60
queue-connection-factorySets the JNDI name for the QueueConnectionFactorynone
topic-connection-factorySets the JNDI name for the TopicConnectionFactorynone

Protocol Servlets

External protocols are generally implemented as servlets. Only applications which expose an external interface will have protocol servlets.

Burlap

<!-- Burlap protocol configuration -->
<servlet-mapping>
  <url-pattern id='/burlap/*'/>
  <servlet-name id='com.caucho.burlap.EJBServlet'/>
</servlet-mapping>


Reference
Reference
EJB Config
Copyright © 1998-2006 Caucho Technology, Inc. All rights reserved.
Resin® is a registered trademark, and HardCoretm and Quercustm are trademarks of Caucho Technology, Inc.