Well,

i did not find the problem, but if i remove the demo folder from the orion
folder, the error on connecting seems to be more reasonable:

javax.naming.NamingException: META-INF/application-client.xml resource not
found
        at
com.evermind.server.ApplicationClientInitialContextFactory.getInitialContext
(JAX)
        at
javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:668)
        at
javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:246)
        at javax.naming.InitialContext.init(InitialContext.java:222)
        at javax.naming.InitialContext.<init>(InitialContext.java:198)
        at de.netmedia.ejb.test.clienttest.main(clienttest.java:59)

The only thing, i need to know: where do i have to put the
application-client.xml ? I tried both the META-INF folder of my ear file and
the one of the ejb-jar file.


P.S.: Currently my ear contains the following:
ejb-jar51841.jar (created by the j2ee deploytool...)
META-INF/MANIFEST.MF (created by the j2ee deploytool...)
META-INF/application.xml (created by the j2ee deploytool...)
Contents: -------------------------------------------------
        <?xml version="1.0" encoding="UTF-8"?>

        <!DOCTYPE application PUBLIC '-//Sun Microsystems, Inc.//DTD J2EE
Application 1.2//EN' 'http://java.sun.com/j2ee/dtds/application_1_2.dtd'>

        <application>
          <display-name>BaseModule</display-name>
          <description>Application description</description>
          <module>
            <ejb>ejb-jar51841.jar</ejb>
          </module>
        </application>
-----------------------------------------------------------
META-INF/sun-j2ee-ri.xml (created by the j2ee deploytool...)

The ejb-jar51841.jar contains:
jndi.properties (added manually by myself)
Contents: -------------------------------------------------
        
java.naming.factory.initial=com.evermind.server.ApplicationClientInitialCont
extFactory
        java.naming.provider.url=ormi://localhost/BaseModule
        java.naming.security.principal=admin
        java.naming.security.credentials=123
-----------------------------------------------------------
META-INF/MANIFEST.MF (created by the j2ee deploytool...)
Contents: -------------------------------------------------
        Manifest-Version: 1.0
-----------------------------------------------------------
META-INF/application-client.xml (added manually by myself:)
Contents: -------------------------------------------------
        <?xml version="1.0"?>
        <!DOCTYPE application-client PUBLIC "-//Sun Microsystems, Inc.//DTD
J2EE Application Client 1.2//EN"
"http://java.sun.com/j2ee/dtds/application-client_1_2.dtd">
        <application-client>
                <ejb-ref>
                        <ejb-ref-name>NMejbBinary</ejb-ref-name>
                        <home>NMejbBinaryHome</home>
                        <remote>NMejbBinaryObject</remote>
                </ejb-ref>
        </application-client>
-----------------------------------------------------------
META-INF/ejb-jar.xml (created by the j2ee deploytool...)
de/netmedia/ejb/general/basebean/NMejbBinaryObject.class (added by the j2ee
deploytool...)
de/netmedia/ejb/general/basebean/NMejbBinaryHome.class (added by the j2ee
deploytool...)
de/netmedia/ejb/general/basebean/NMejbBinaryBean.class (added by the j2ee
deploytool...)


-----Urspr�ngliche Nachricht-----
Von: Jens Stutte [mailto:[EMAIL PROTECTED]]
Gesendet am: Montag, 21. Februar 2000 19:05
An: Orion-Interest
Betreff: Problems while connecting to ejb server

Hi again,
 
i tried to write a client for my freshly deployed bean and ran into a
problem about looking up the jndi context "the right way".
 
I assume, that the "application-client.xml" gives some hints about the jndi
names of the deployed bean(s) in an ejb-jar. And on creating the initial
context with the
"com.evermind.server.ApplicationClientInitialContextFactory" and an url like
"ormi://servername/appname", orion tries to look up an appropriate
application-client.xml for that application.
However, i get strange results with this.
 
First of all, i wasn't able to create an initial context for my application,
since orion complained about missing application client values.
Unfortunately i cannot reproduce this behaviour (see below) and therefore
cannot give the exact error message. I than had a look at the samples and
tried them:
 
I created an initial context for the samples like that:
   Hashtable h = new Hashtable();
 
h.put(Context.INITIAL_CONTEXT_FACTORY,"com.evermind.server.ApplicationClient
InitialContextFactory");
   h.put(Context.PROVIDER_URL, "ormi://beatnix.net-media.de/ejbsamples");
   h.put(Context.SECURITY_PRINCIPAL, "admin");
   h.put(Context.SECURITY_CREDENTIALS, "123");
   Context context = new InitialContext(h);

with only one application in the server.xml, that is ejbsamples. This works,
even remote (actually i replaced the new InitialContext(); of the CartClient
sample).
 
Then i changed my server.xml to contain only my application's ear (created
with the j2ee deployment wizard) and changed the client appropriate:
   Hashtable h = new Hashtable();
 
h.put(Context.INITIAL_CONTEXT_FACTORY,"com.evermind.server.ApplicationClient
InitialContextFactory");
   h.put(Context.PROVIDER_URL, "ormi://beatnix.net-media.de/BaseModule");
   h.put(Context.SECURITY_PRINCIPAL, "admin");
   h.put(Context.SECURITY_CREDENTIALS, "123");
   Context context = new InitialContext(h);

This leads to the following exception:
 
java.lang.InstantiationException: No location specified and no suitable
instance of the type 'Cart' found for the ejb-ref MyCart
        at com.evermind.server.rmi.au.invokeMethod(JAX)
        at com.evermind.server.rmi.al.invoke(JAX)
        at Proxy0.getEJBHome(Unknown Source)
        at com.evermind.server.fo.aca(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)
        at javax.naming.InitialContext.init(InitialContext.java:222)
        at javax.naming.InitialContext.<init>(InitialContext.java:198)
        at de.netmedia.ejb.test.clienttest.main(clienttest.java:59)
javax.naming.NamingException: Error reading application-client descriptor:
No location specified and no suitable instance of the type 'Cart' found for
the ejb-ref MyCart
        at
com.evermind.server.ApplicationClientInitialContextFactory.getInitialContext
(JAX)
        at
javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:668)
        at
javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:246)
        at javax.naming.InitialContext.init(InitialContext.java:222)
        at javax.naming.InitialContext.<init>(InitialContext.java:198)
        at de.netmedia.ejb.test.clienttest.main(clienttest.java:59)

 
What ? Cart ? MyCart ? I ensure, i uncommented the ejbsamples application in
my server.xml. And my Clients code not even mentions these names, neither
the beans code/xmls.
 
Am i missing something ? Is there any further information on how to set up
the application-client.xml and where to place it ? Is there any chance to
actually "see" which application-client.xml is used by orion (something like
a debug mode) ?
 
Any help would be very appreciated,
 
Jens Stutte

____________________________________________
[EMAIL PROTECTED], http://www.net-media.de

NetMedia GmbH
Schubertstr. 8
66111 Saarbruecken
Germany

fon: +49 (0) 681 - 37 98 80
fax: +49 (0) 681 - 33 89 3


 

Reply via email to