Here is an excerpt from some test code for 2.4.4....  Did you make sure that
the client side jars from jboss/client directory are in your classpath?
It also looks like you are missing one of the env. settings.  What exception
are you getting?

-Dat


*** excerpts from my code *** 


protected void setUp() throws Exception
    {
        /** set up jndi connection to app server **/
        Hashtable env = new Hashtable();
        env.put("java.naming.factory.initial",
"org.jnp.interfaces.NamingContextFactory");
        env.put("java.naming.provider.url", "jnp://localhost:1099");
        env.put("java.naming.factory.url.pkgs",
"org.jboss.naming:org.jnp.interfaces");
        jndiContext = new InitialContext(env);
    }

public void testHelloEJB() throws Exception
    {
            Object helloObj = jndiContext.lookup("HelloBean");
            HelloHome helloHome =
(HelloHome)PortableRemoteObject.narrow(helloObj, HelloHome.class);
            Hello hello = helloHome.create();
            assertEquals("This tests the sayHello method on HelloBean",
"Hello", hello.sayHello());
    }



-----Original Message-----
From: Christine [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 01, 2002 7:54 PM
To: [EMAIL PROTECTED]
Subject: [JBoss-user] JNDI lookup EJB Home interface failed from Test driver


Please help, Since I haven't got any reply for my previous question
regarding JBoss hanged. Now I am trying to figure out whether it is
JBoss's problem or Tomcat's
problem. I wrote a test driver which is a java class. It tries to
connect to EJB outside JBoss. But It can not find EJB JNDI name in the
context. I checked
http://localhost:8082 for the JNDI view, all my EJB are bound in the
Global JNDI namespace list.

  + milos (class: org.jnp.interfaces.NamingContext)
  |   + enactment (class: org.jnp.interfaces.NamingContext)
  |   |   + Agent (proxy: $Proxy36 implements milos.enactment.AgentHome)

 My test code is like:

    String initialContext = "org.jnp.interfaces.NamingContextFactory";
    String providerURL = "jnp://localhost:1099/";
 Hashtable environment = new Hashtable(2);
   environment.put(javax.naming.Context.PROVIDER_URL, providerURL);
   environment.put(
    javax.naming.Context.INITIAL_CONTEXT_FACTORY,
    initialContext);
Context ctx = new javax.naming.InitialContext(environment);
AgentHome aHome = (AgentHome) ctx.lookup("milos/enactment/Agent");

I executed the test driver like : (i didn't generate client jar file, I
simply used the jar file under tmp/deploy directory)

C:\MilosWL61_Mar18\source>c:\jdk1.3.1\bin\java -classpath
.;C:\JBoss-2.4.4_Tomcat-4.0.1\jboss\tmp\deploy\Default\Milos.e
ar\ejb1002.jar;C:\JBoss-2.4.4_Tomcat-4.0.1\jboss\conf\catalina\;C:\JBoss-2.4
.4_Tomcat-4.0.1\jboss\lib\ext\jnpserver.jar;

C:\JBoss-2.4.4_Tomcat-4.0.1\jboss\lib\ext\jboss-j2ee.jar
milos.servlet.enactment.testProject

I do appreciate any suggestion!

Regards,

--
Jia (Christine) Li

524N ICT Building
Department of Computer Science
University of Calgary



_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user


***************************************************************
Confidentiality note: This e-mail contains information from the 
GFI Group Inc. and/or its affiliates, including GFInet inc., 
that is confidential and/or legally privileged.   This 
information is intended only for the use of the individual or 
entity named on this e-mail.  This e-mail and its content may 
not be reproduced or retransmitted without the express written 
permission of The GFI Group.
***************************************************************


_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to