⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ejb-jonas.xtp

📁 解压在c盘
💻 XTP
字号:
<title>Resin using JOnAS EJB</title>From Pedro Costa:<p/>To use Resin as an EJB client with JOnAS or Enhydra Enterprise follow these steps:<ol><li>Under JOnAS or Enhydra do nothing<li>Copy JEREMIE_jonas.jar (RMI_jonas.jar if you are using rmi and notjeremie) into WEB-INF/lib or resin1.2/lib.<p>If you are using JOnAS on the same machine as Resin you can do the sameby adding the following line to your app on resin.conf (assuming JOnAS is installed on \JONAS)<example>&lt;classpath id='/JONAS/lib/JEREMIE_jonas.jar'/></example><li>Copy the EJB jar's file containing your beans to WEB-INF/libIf you are using JOnAS on the same machine as Resin you can do the sameby 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)<example>&lt;classpath id='/JONAS/mybeans' source='/JONAS/mybeans' compile='false'/></example>        <li>In resin.conf add these lines to your app (assuming you are using jeremie):<example>&lt;jndi-link>  &lt;jndi-name>java:comp/env/ejb&lt;/jndi-name>  &lt;jndi-factory>    org.objectweb.jeremie.libs.services.registry.jndi.JRMIInitialContextFactory  &lt;/jndi-factory>  &lt;init-param java.naming.provider.url="jrmi://YOUR_HOST:12340"/>  &lt;init-param java.naming.factory.url.pkgs="org.objectweb.jonas.naming"/>&lt;/jndi-link></example><li>Don't forget to change YOUR_HOST to your hostname...</ol><example title="Sample JSP showing how to access your beans">&lt;!DOCTYPE html public "-//W3C//DTD HTML 4.0 Transitional//EN">&lt;%@ page language="java"%>&lt;%@ page import="javax.naming.InitialContext" %>&lt;%@ page import="javax.naming.Context" %>&lt;%@ page import="javax.rmi.PortableRemoteObject" %>&lt;%@ page import="YOUR_BEANS_PACKAGE.*" %>&lt;html>&lt;head>&lt;title>Test&lt;/title>&lt;/head>&lt;body>&lt;%  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 = &lt;%=t1.dummyMethod()%>&lt;%  t1.remove();    %>&lt;/body>&lt;/html></example>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -