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