Hi,

Commenting on myself..... I forgot to add the client side code.... Just
remeber you can only make a context once from a client. Then you must reuse
that one to get the ejb-instances.

Her it is initialisation:

            java.util.Hashtable env = new java.util.Hashtable();
            env.put(javax.naming.Context.APPLET, this);
            env.put(javax.naming.Context.SECURITY_PRINCIPAL,
getParameter("java.naming.security.principal"));
            env.put(javax.naming.Context.SECURITY_CREDENTIALS,
getParameter("java.naming.security.credentials"));
            AppitUtilities.setEnviroment(env);

(AppitUtilities is a singelton which stores the information for later use)

snip of code which we uses to collect


          final StringBuffer homeName =
            new StringBuffer("com.telenor.mobil.planit.");
            homeName.append(moduleName.replace('/', '.'));
          homeName.append(".ejb.");
          homeName.append(remoteInterfaceName);
          homeName.append("Home");
          if (context == null) {
                  context = new InitialContext(env);
          }
          final Object homeObject =
            context.lookup("java:comp/env/ejb/" + moduleName + "/" +
            remoteInterfaceName);
            final Class homeClass = Class.forName(homeName.toString());
          final EJBHome home = (EJBHome)
            PortableRemoteObject.narrow(homeObject, homeClass);
            return home;
    }

Regards,
Torgeir Lerkerød
----------------------------------------------------------------------------
Nett/IT
T +47 (227) 84588
M +47 91837430

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: 12. februar 2001 20:43
To: Orion-Interest
Subject: RE: JNDI Lookup from Applet


Hi,

The simpel answer is everything..... You need the include orion.jar and all
it friends. I know this is a pain in the neck as it adds around 3mb to the
application and hurts us a lot her. (Thats the one of the reasons why I am
sitting her at the moment porting xml files to be valis so the works with
sybase EAS 3.6.1. (Orion doesnt validate the ejb-jar.xml's properly so it
was a huch task correcting them to spec. (with more that 1200 session and
entitybeans its a pain.)))

Back to your question her is how I load applets from a jsp page in orion:

<%@ page errorPage="/misc/errorpage.jsp" %>
<%@ page language="java" import = "
    java.io.*,
    java.rmi.RemoteException,
    java.util.*,
    java.text.*,
    javax.naming.*,
    javax.rmi.PortableRemoteObject,
    java.net.*,
    javax.servlet.http.HttpServletRequest
    "
%>
  
<html>
<head>
</head>
<body>
       <jsp:plugin type="applet" 
                    code="com/telenor/mobil/planit/pakka/Pakka.class" 
                    codebase="/classes" 
                    align="bottom"
                    height="600"
                    width="800"
                    jreversion="1.3" %>
            <jsp:params>
                    <jsp:param name="cache_option" value="Plugin" /> 
                    <jsp:param name="cache_archive"
value="sessionbeans.jar,PakkaApplet.jar,exense.jar,planitbeans.jar,ejb.jar,o
rion.jar,jndi.jar,objectfx.jar,parser.jar,mail.jar,jaxp.jar,jdbc.jar,VisualN
umerics.jar"/> 
                    <jsp:param name="java.naming.factory.initial"
value="com.evermind.server.ApplicationClientInitialContextFactory" /> 
                    <jsp:param name="java.naming.provider.url"
value="ormi://nt-osl-8789/appit" /> 
                    <jsp:param name="java.naming.security.principal"
value="someone" /> 
                    <jsp:param name="java.naming.security.credentials"
value="something" /> 
            </jsp:params>                       
            <jsp:fallback>
                    This software requiers that you have installed the java
plugin for Explorer/Netscape version 1.3. Contact helpdesk at 85150.
            </jsp:fallback>
    </jsp:plugin>
</body>
</html>


Regards,
Torgeir Lerkerød
----------------------------------------------------------------------------
Nett/IT
T +47 (227) 84588
M +47 91837430

-----Original Message-----
From: John McManus [mailto:[EMAIL PROTECTED]]
Sent: 12. februar 2001 20:11
To: Orion-Interest
Subject: JNDI Lookup from Applet


Does anyone have a simple example of an Applet doing a JNDI lookup of a
bean?
We are not using servlets, but a Swing Applet client contacting the
beans directly and I'm getting the
following exception:


> javax.xml.parsers.FactoryConfigurationError:
> com.sun.xml.parser.DocumentBuilderFactoryImpl
>         at
>
javax.xml.parsers.DocumentBuilderFactory.newInstance(DocumentBuilderFactory.
java:80)
>         at com.evermind.xml.e.getJavaxDocument(JAX)
>         at com.evermind.xml.XMLUtils.getDocument(JAX)
>         at com.evermind.xml.XMLConfig.ay(JAX)
>         at
>
com.evermind.server.ApplicationClientInitialContextFactory.getInitialContext
(JAX)
>         at
> javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:668)
>         at
> javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:246)
>

Exactly what jars need to be on the client side?  I'm using and HTML
page to launch the applet and assuming
the jars are downloaded via http...

Thanks

--
***********************************************************
                  |^^^^^^|
                  |      |
                  |  _  _|     John B McManus
                  | (.)(.)     email: [EMAIL PROTECTED]
                  @      _)    phone: (303)734-6002
                   | ,___|
                   |   /

************************************************************


Reply via email to