Hi i am having trouble accessing a simple session bean from a stand alone
client.
The bean looks like its been deploy correctly.
Here's the steps that i have done on windows 2000.
1. Create class files, this is the director structure.
         e:\beans\test\
         e:\beans\test\TestRemote
         e:\beans\test\TestEJB
         e:\beans\test\TestHome
2. Create ejb-jar.xml.  Not sure i am coding it right??
         e:\beans\Meta-Inf\
         e:\beans\Meta-Inf\ejb-jar.xml
3. Create these files into testEJB.jar
4. Create ear file.
         e:\apps\
         e:\apps\testEJB.jar
         e:\apps\Meta-Inf\
         e:\apps\Meta-Inf\application.xml
5. put the ear file into the orion\application
6. add application entry into the server.xml file.
7. start orion and it does unpack the ear file with no errors.

now i want to get the client access the bean.
8. create the Client.java file in the same directory as the EJB source
files.
        e:\beans\test\Client
9. add application-client.xml
        e:\beans\test\Meta-inf\application-client.xml

Now when i try and run this client a dialog pops up to enter the user,pass
word,and server.
The 2 messages printed out are;
        Got context.
        java.lang.SecurityException: No such domain/application: test/TESTApp

So i think i'm pretty close to getting it to work. The problems lies in the
xml files and correctly setting the JNDI mappings.

Not sure if or how to make the orion xml file like orion-ejb-jar.xml, and
orion-application.xml.
I would love some help getting the xml conig working!
Thanks for any help you can give, Harley Rana.

This is the client.

package test;

import javax.naming.*;
import java.util.Hashtable;
import javax.rmi.PortableRemoteObject;

class Client {

  public static void main(String[] args) {

System.setProperty("java.naming.factory.initial","com.evermind.server.Applic
ationClientInitialContextFactory");
    System.setProperty("java.naming.provider.url",
      "ormi://localhost/test/TESTApp");

    try {
      InitialContext jndiContext = new InitialContext();
      System.out.println("Got context");
      Object ref  = jndiContext.lookup("test/TestApp");
      System.out.println("Got reference");
      TestHome home = (TestHome)
       PortableRemoteObject.narrow (ref, TestHome.class);
      TestRemote test = home.create();
      System.out.println("Calling EJB....");
      System.out.println(test.getTest()); // should return a simple String.
    } catch(Exception e) {
      System.out.println(e.toString());
    }
  }
}


Reply via email to