I am trying to get to work the examples from Ed Roman's book "Mastering
Enerprise Java Beans".
One of his examples is "CountBean" client application.

Here is what I have done so far.

I have Orion installed in 
D:\Program Files\SPSSWeb\Orion

J2EE sdk installed in
C:\j2sdkee1.2.1

Java SDK installed in
C:\jdk1.3

I created classes CountBean, CountHome, Count in a package session.count and
located them 
in c:\orionapp\classes\session\count. In the same directory I also have
CountClient class.
I compiled allclasses from C:\orionapp\classes.

Using Sun's deploytool I crated the Mastering.ear file containing
ejb-jar-ic.jar
app-client-ic.jar
META-INF\MANIFEST.MF
META-INF\applicatioin.xml
META-INF\sun-j2ee-ri.xml

I deployed the application into Orion and got the following confirmation:
Auto-deploying mastering (Assembly had been updated)...
Auto-deploying ejb-jar-ic.jar (ejb-jar.xml had been touched since the
previous d
eployment)... done.
Auto-deploying app-client-ic.jar (Previous deployment not found)... done.

I extracted the files contained int the app-client-ic.jar into
c:\orionapp\classes.

Now I am trying to run the client application like this and get the
following error:

C:\orionapp\classes>java -classpath
c:\orionapp\classes\;C:\orionapp\orionlib\or
ion.jar session.count.CountClient
javax.naming.NameNotFoundException: Count_JNDIName not found
        at com.evermind.server.rmi.RMIContext.lookup(Unknown Source)
        at com.evermind._dkb.lookup(Unknown Source)
        at javax.naming.InitialContext.lookup(InitialContext.java:350)
        at session.count.CountClient.main(CountClient.java:15)


The code in CountClient.java that tries to look up the CountHome object
looks like this:
package session.count;

import javax.ejb.*;
import javax.naming.*;
import java.util.Properties;

public class CountClient 
{
    public static void main(String [] args)
    {
        try
        {
            Properties props = System.getProperties();
            Context ctx = new InitialContext(props);
            CountHome home = (CountHome) ctx.lookup("Count_JNDIName");


According to some postings in this mail list when the client application is
looking up
ejbs it shouldn't use the java:comp/env prefixed names.

Here is the contents of the various xml files (minus the headers).  All of
these files were
created either by deploytool or by Orion's deployment process.

c:\orionapp\classes\META-INF\application-client.xml
---------------------------------------------------------
<application-client>
  <display-name>CountClient</display-name>
  <description>Description entered via New Client Application
Wizard</description>
  <env-entry>
    <description>Some environment entry</description>
    <env-entry-name>xyz</env-entry-name>
    <env-entry-type>java.lang.String</env-entry-type>
    <env-entry-value>6</env-entry-value>
  </env-entry>
  <ejb-ref>
    <description>main EJB referenced in the code</description>
    <ejb-ref-name>session.count.CountBean</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <home>session.count.CountHome</home>
    <remote>session.count.Count</remote>
  </ejb-ref>
</application-client>


c:\orionapp\classes\META-INF\orion-application-client.xml
---------------------------------------------------------
<orion-application-client>
        <ejb-ref-mapping name="session.count.CountBean" location="Count" />
</orion-application-client>


c:\orionapp\classes\jndi.properties
---------------------------------------------------------
#Orion JNDI properties
#Tue Oct 02 17:57:23 CDT 2001
java.naming.provider.url=ormi\://127.0.0.1\:23791/mastering
java.naming.factory.initial=com.evermind.server.ApplicationClientInitialCont
extFactory
java.naming.security.principal=admin
java.naming.security.credentials=123


c:\orionapp\classes\META-INF\sun-j2ee-ri.xml
---------------------------------------------------------
<j2ee-ri-specific-information>
  <app-client>
    <ejb-ref>
      <ejb-ref-name>session.count.CountBean</ejb-ref-name>
      <jndi-name>Count_JNDIName</jndi-name>
    </ejb-ref>
  </app-client>
</j2ee-ri-specific-information>


I have been trying to solve this problem for the last 2 days by looking on
Orion's site,
this site, javasoft site but I can't figure out what is wrong.  It seems to
me that 
JNDI doesn't have the right name or maybe the xml files don't contain the
right information.

Please help.

Thank you
Swavek


Reply via email to