CORBA/IIOP
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

Tutorials
Burlap Clients
Hessian Clients
CORBA/IIOP Server
Scrapbook

CORBA/IIOP Client
Hessian Clients
EJB
CORBA/IIOP Client

EJB 2.0 requires servers to implement CORBA/IIOP as a wire protocol. So in addition to the (preferred) usage of Burlap and Hessian as protocols, Resin-EE makes CORBA/IIOP available.

  1. Server Configuration
  2. Client Example

Server Configuration

The Resin CORBA server configuration is almost identical to the Burlap or Hessian configuration. The difference is that CORBA uses a dedicated port instead of a servlet to listen for CORBA requests. Everything else is identical, including the <ejb-server> , so beans do not need to be aware which wire protocol is used.

resin.conf
<server>

 ...

 <port port="2099">
   <protocol resin:type="com.caucho.iiop.IiopProtocol"/>
 </port>

 ...

</server>

webapps/appname/WEB-INF/web.xml
<web-app>

  ...

  <ejb-server config-directory="WEB-INF"/>

  ...

</web-app>

Client Example

Clients will use JNDI to look up beans in the server. The JNDI name uses the same name as the bean's Burlap URL. If the EJBServlet is at http://localhost:8080/app/ejb, the IIOP server is localhost:2099, and the bean name is "hello", the JNDI path will be /localhost:2099/hello.

CORBA client
import javax.naming.*;

env.put("java.naming.factory.initial", "com.sun.jndi.cosnaming.CNCtxFactory");
env.put("java.naming.provider.url", "iiop://localhost:2099/hello");
Context ejb = new InitialContext(env);
Object helloHomeObj = ctx.lookup("hello");
HelloHome helloHome = 
  (HelloHome) PortableRemoteObject.narrow(helloHomeObj, HelloHome.class);

You can also use Resin's jndi features to configure the factory:

corba jndi client configuration
<web-app>

   ...

  <jndi-link jndi-name='java:comp/env/ejb'
             factory='com.sun.jndi.cosnaming.CNCtxFactory'>
    <init-param java.naming.provider.url='http://localhost:2099/hello'/>
  </jndi-link>

corba jndi client code
Context ejb = (Context) new InitialContext().lookup("java:comp/env/ejb");
Object helloHomeObj = ejb.lookup("hello");
HelloHome helloHome =
  (HelloHome) PortableRemoteObject.narrow(helloHomeObj, HelloHome.class);


Hessian Clients
EJB
CORBA/IIOP Client
Copyright © 1998-2006 Caucho Technology, Inc. All rights reserved.
Resin® is a registered trademark, and HardCoretm and Quercustm are trademarks of Caucho Technology, Inc.