Peter,

In getting my app-client running, I down loaded
http://java.sun.com/dtd/application-client_1_3.dtd and found this statement:
"The ejb-ref-name element contains the name of an EJB reference. The EJB
reference is an entry in the application client's environment and is
relative to the java:comp/env context.  The name must be unique within the
application client."  As you can see, <ejb-ref> cannot be used in your case
since you do not want your client in every ejb container. Also <res-ref> has
the same problem. It looks like your client needs to use rmi to call the
ejbs. Look at rmi.xm.html in Orion's docs. Set up the server, using rmi.xml,
that contain the ejbs your client-app needs to use.  Then set up you client
to connect to the appropriate server:port for the needed ejb using rmi. 

Hope this helps.

Dave


-----Original Message-----
From: SAURUGGER,PETER (A-PaloAlto,ex2)
[mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 19, 2001 12:21 PM
To: Orion-Interest
Subject: RE: Which JAR do I need to run an external client app


In my case at least it is java:whatever-is-in-application-client.xml or
orion-application-client.xml that's not available. Is there any other place
to specify the jndi location for an ejb? Experimented with
RMIInitialContextFactory as well without success.

with the follwoing entry in application-client.xml:

<ejb-ref-name>ejb/ArticleHandler</ejb-ref-name>

Whatever I specify, I get the following error (cm is application name),
e.g.:

Communication error: Invalid name:cm/ejb/ArticleHandler
Communication error: Invalid name:/cm/ejb/ArticleHandler
Communication error: Invalid name:ejb/ArticleHandler
Communication error: Invalid name:/ejb/ArticleHandler
Communication error: Invalid name:ArticleHandler

now what? How do I correctly specify the jndi name?

-----Original Message-----
From: David Libke [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 18, 2001 1:35 PM
To: Orion-Interest
Subject: RE: Which JAR do I need to run an external client app


Peter,

The problem you are experiencing is because the JNDI locations need to be
changed when the location of the client jar is changed -- namely change
'java:comp/env/' to 'java:hello/client/' or some other path that is
appropriate.  'java:comp/env' is reserved for the application server's
environment resources; thus, a different JNDI entry must be created for your
application client when it is outside of the server.

Good luck on synchronizing all the xml entry names.

Dave

-----Original Message-----
From: Cugier (extern) [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 18, 2001 11:18 AM
To: Orion-Interest
Subject: Which JAR do I need to run an external client app


Hello,

I have the following problem. I created a Java Client application that
accesses an EJB. I start the client with the following batch file.

set
CLASSPATH=H:\oc4j\j2ee\home\ejb.jar;.;H:\oc4j\j2ee\home\orion.jar;H:\oc4j\j2
ee\home\jndi.jar
java HelloClient

where H:\oc4j\j2ee\home ist the directory where I installed the OC4J/Orion
Server on my computer. When I start the client with this batch file
everything works fine.

As I don't want to install OC4J/Orion on each PC where the client should run
I copied the three JAR file that ar listed in the CLASSPATH from
H:\oc4j\j2ee\home to D:\ExtraJARs. I changed the batch file to 

set
CLASSPATH=D:\ExtraJARs\ejb.jar;.;D:\ExtraJARs\orion.jar;D:\ExtraJARs\jndi.ja
r
java HelloClient

After the change I get the following error

javax.naming.NamingException: java:comp/env namespace is only available from
within a J2EE component
        at
com.sun.enterprise.naming.java.javaURLContext.getComponentContext(../../src/
share/com/sun/enterprise/naming/java/javaURLContext.java:392)
        at
com.sun.enterprise.naming.java.javaURLContext.lookup(../../src/share/com/sun
/enterprise/naming/java/javaURLContext.java:51)
        at javax.naming.InitialContext.lookup(Unknown Source)
        at HelloClient.main(HelloClient.java:9)

Can anyone explain why it works when I use the three JARs from the
H:\oc4j\j2ee\home directory but doesn't work when I try to use the copied
JAR files.

Thanks

Peter

Reply via email to