JOnAS or Enhydra Enterprise EJB
Resin 3.0

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

IDE's
Scottit
Groovy
PHP
Code Libraries
EJB Servers
JMS
JCA Resources
JMX
SSL Accelerators

jBoss
Inprise
JOnAS
Weblogic
Orion
Inprise
EJB Servers
Weblogic

From Pedro Costa:

To use Resin as an EJB client with JOnAS or Enhydra Enterprise follow these steps:

  1. Under JOnAS or Enhydra do nothing
  2. Copy JEREMIE_jonas.jar (RMI_jonas.jar if you are using rmi and not jeremie) into WEB-INF/lib or resin1.2/lib.

    If you are using JOnAS on the same machine as Resin you can do the same by adding the following line to your app on resin.conf (assuming JOnAS is installed on \JONAS)

    <classpath id='/JONAS/lib/JEREMIE_jonas.jar'/>
    

  3. Copy the EJB jar's file containing your beans to WEB-INF/lib If you are using JOnAS on the same machine as Resin you can do the same by adding the following line to your app on resin.conf (assuming JOnAS is installed on \JONAS and your beans are on a dir called \JONAS\mybeans)

    <classpath id='/JONAS/mybeans' source='/JONAS/mybeans' compile='false'/>
    

  4. In resin.conf add these lines to your app (assuming you are using jeremie):

    <jndi-link>
      <jndi-name>java:comp/env/ejb</jndi-name>
      <jndi-factory>
        org.objectweb.jeremie.libs.services.registry.jndi.JRMIInitialContextFactory
      </jndi-factory>
      <init-param java.naming.provider.url="jrmi://YOUR_HOST:12340"/>
      <init-param java.naming.factory.url.pkgs="org.objectweb.jonas.naming"/>
    </jndi-link>
    

  5. Don't forget to change YOUR_HOST to your hostname...

Sample JSP showing how to access your beans
<!DOCTYPE html public "-//W3C//DTD HTML 4.0 Transitional//EN">
<%@ page language="java"%>
<%@ page import="javax.naming.InitialContext" %>
<%@ page import="javax.naming.Context" %>
<%@ page import="javax.rmi.PortableRemoteObject" %>
<%@ page import="YOUR_BEANS_PACKAGE.*" %>
<html>
<head>
<title>Test</title>
</head>
<body>
<%
  Context initialContext = new InitialContext();
  Object ref = initialContext.lookup("java:comp/env/ejb/ExpHome");
  ExpHome home = (ExpHome) PortableRemoteObject.narrow(ref, ExpHome.class);
  Exp t1 = home.create(); 
%>
dummy result value = <%=t1.dummyMethod()%>
<%
  t1.remove();    
%>
</body>
</html>


Inprise
EJB Servers
Weblogic
Copyright © 1998-2005 Caucho Technology, Inc. All rights reserved.
Resin® is a registered trademark, and HardCoretm and Quercustm are trademarks of Caucho Technology, Inc.