|
|  |
The resource for the EJB Server itself is described in the
EJBServer page. EJB Server is a JNDI
resource.
Additional JNDI configuration is needed for using Burlap or Hessian
clients. In other words, if you just need local beans, the
EJBServer configuration is sufficient. If you need to use a remote
bean, you need to configure the JNDI for the remote interface.
The remote Hessian factory is HessianContextFactory.
The remote Burlap factory is BurlapContextFactory.
web.xml for Hessian
<web-app>
<!-- Remote Hessian JNDI configuration -->
<jndi-link>
<jndi-name>java:comp/env/ejb</jndi-name>
<jndi-factory>com.caucho.hessian.HessianContextFactory</jndi-factory>
<init-param java.naming.provider.url="http://gryffindor/hessian"/>
</jndi-link>
</web-app>
|
web.xml for Burlap
<web-app>
<!-- Remote Burlap JNDI configuration -->
<jndi-link>
<jndi-name>java:comp/env/ejb</jndi-name>
<jndi-factory>com.caucho.burlap.BurlapContextFactory</jndi-factory>
<init-param java.naming.provider.url="http://gryffindor/burlap"/>
</jndi-link>
</web-app>
|
| Property | Meaning
|
| jndi-link | links a JNDI subtree into the main tree
|
| jndi-name | location in the main tree to link the subtree
|
| jndi-factory | JNDI factory to create the subtree's root
|
| java.naming.provider.url | EJB server URL
|
The local context factory will normally use a relative URL for
java.naming.provider.url. That way, the client doesn't care about the
server name or the web-app name. So local Resin-CMP servers and clients
can be easily deployed as .war files.
Remote contexts need to know the full URL of the server, so they must
be configured specifically for each server.
sample home lookup
private CourseHome;
void init() throws ServletException
{
try {
Context ejb = (Context) new InitialContext().lookup("java:comp/env/ejb");
CourseHome = (CourseHome) cmp.lookup("course");
} catch (NamingException e) {
throw new ServletException(e);
}
}
|
Copyright © 1998-2006 Caucho Technology, Inc. All rights reserved.
Resin® is a registered trademark,
and HardCoretm and Quercustm are trademarks of Caucho Technology, Inc. | ![]() |
|